-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[alsa stream] Detect idle state based on dBFS threshold #846
Comments
I'd like to jump in and +1 this issue. I have the non-pro Hifiberry DAC+ADC hat on a raspberry pi 3. The alsa source always indicates that the stream is playing. Using some sort of noise detection would be great for these devices. |
@Thyself17 are you also talking about a line-in/mic-in analog stream? |
Correct! Just as @cmelbye has setup with their also source, I am using the line-in input on the Hifiberry ADC as the source for my snapserver instance. Even when there is no media playing, the alsa source in the web UI always shows the alsa stream is playing- never idle. I have also tried unplugging line-in, but snapserver still does not detect silence, and therefore, never idles. As the OP states, I imagine there is still some inaudible noise passing through the ADC signal converter, so it never is 100% silent. Thus the proposal for some dB or volume threshold for detecting silence |
Added with commit 216714b, you can find an automated build in actions.
@cmelbye, @Thyself17 would be great if you could test the development snapshot |
@badaix I'll have to test in the next couple weeks when I get home from travel. I'll be sure to follow up with results! This is an amazing feature for my use case. Thank you! |
@cmelbye Thanks for the idea and @badaix Thanks for implementing it! |
@Mohawi thanks for the feedback |
Released in Snapcast v0.25.0 |
Chiming in to say this feature has worked flawlessly and has been an amazing feature for my usecase. thanks! |
OMG I have the exact same use case (HiFiBerry DAC+ ADC Pro - actually two of them, one for the turntable, another one for a long-distance Bluetooth receiver) and this has been bothering me for the longest time! Asked in the HiFiBerry forums for solutions etc. |
ist there a way to get rid of the to low-level noise described in the first posts? it is quite annoying, especially when listening with headphones. in between tracks or when you pause sound to get a call or something, you allways have that noise in the background ... cheers |
Is your feature request related to a problem? Please describe.
I use an ADC (HifiBerry DAC+ ADC Pro) connected to a Turntable as input for the following ALSA stream:
source = alsa://?name=Turntable&device=sysdefault&send_silence=true&sampleformat=48000:32:2&idle_threshold=10
The problem I'm seeing is that Snapcast always reports its state as "playing", even if the Turntable is not playing anything. I assume this is because it constantly outputs some low-level noise.
I set
send_silence
andidle_threshold
in an attempt to fix the issue, but it doesn't change anything. After looking at the source code, it seems likeidle_threshold
is expecting "true silence" from ALSA.Describe the solution you'd like
It would be great if there were an alternate way to specify an idle threshold. I looked at the HifiBerry forums, and a thread seemed to suggest that using a dBFS threshold could work to detect "silent" noise.
I'm not experienced with this, so I could definitely be misunderstanding how this works. If it is possible, whether via that solution or something else, it would be a great improvement to get accurate state information from these types of ALSA sources.
For example, the snapclient web UI could accurately report whether or not the source is playing, or users could build automations that react to the stream moving from idle to playing.
The text was updated successfully, but these errors were encountered: