Skip to content
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

Dsnoop and EAGAIN Handling #1210

Open
Jacob-Bishop opened this issue Mar 18, 2024 · 0 comments
Open

Dsnoop and EAGAIN Handling #1210

Jacob-Bishop opened this issue Mar 18, 2024 · 0 comments

Comments

@Jacob-Bishop
Copy link

Describe the bug
Thanks for this excellent piece of software. I have a working sound pipline using alsa loop, that goes audio source -> alsa plug pcm -> dmix -> loop in -> loop out -> plug -> snapcast server. However, I tried adding a dsnoop pcm in between the loop_out and plug pcms, but doing so causes clicking noises in the audio stream. It's not entirely clear to me whether fault here lies with alsa, snapcast, or my settings.

  1. Digging through your code, it looks like this is happening due to your handling of EAGAIN

    if (count == -EAGAIN)
    . Is there room in Snapcast's latency budget to retry this read instead of immediately giving up and sending silence? For what it's worth, based on a very cursory control-F, it looks like aplay has some sort of retry logic for this case https://github.com/alsa-project/alsa-utils/blob/906a56f9ff136211e53db201383a47d9b0ee445d/aplay/aplay.c#L2170.

  2. I tried increasing the snapcast buffer to 1000 ms (from 10 ms, I'm on a wired connection). I also tried increasing the number of fragments to 8. Neither seemed to help. On the alsa side, I tried increasing the period_size and buffer size to 2048/8092. This helped somewhat, but didn't solve the issue. Are there other settings on either the snapcast or alsa side that I should be adjusting?

Environment details

  • OS: Linux, 6.6.7-arch1-1
  • Snapcast version 0.25.0, installed binary from github release
  • Hardware: Fairly beefy X86_64 CPU, I don't think processing power is the issue?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant