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

Squeezelite & pipewire - buffer size #170

Open
mervinbeng opened this issue Oct 24, 2022 · 3 comments
Open

Squeezelite & pipewire - buffer size #170

mervinbeng opened this issue Oct 24, 2022 · 3 comments

Comments

@mervinbeng
Copy link

I use squeezelite on an arch linux system (6.0.2 kernel) and have observed this issue for some time, but could not identify that it was squeezelite-related. I now believe that it is quite likely:

By default squeezelite's buffer of 40msec in a pipewire-pulse environment. Using this default buffer I find the buffer (pipewire "quantum") is 441 when sample rate is 44100Hz. This is not a good factor of 2^n (like 256 or 512 ..) and when starting up I often here a high-pitched squeal. Occasionally I will hear this squeal mid-stream when playing music.

When I start up with -a 4096:4 or 8192:4, the quantum as seen on pw-top is 1024 or 2048, and the program start without this high-pitched squeal.

It has taken a long time to trace this issue, and so far it appears that keeping to a buffer which forces squeezelite to use a multiple of 256 seems to reduce occasional noise. In addition the output sounds clearer (but this is purely subjective). Perhaps if the output is pipewire:, squeezelite should adjust the buffer size to a power of 2? 441 or 882 or 480 don't seem to make sense here.

@th2j
Copy link

th2j commented Oct 31, 2023

Why do you need Pipewire ? What is you sound card ?
Can you use ALSA instead ? There will be a more direct patch between Squeezelite and the sound card

@mervinbeng
Copy link
Author

mervinbeng commented Oct 31, 2023 via email

@th2j
Copy link

th2j commented Oct 31, 2023

maybe it isn't link to the use of multiple of 256
maybe the glitch disappears because you use higher buffers
have you tried 400:4 instead of 40:4 ?

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

2 participants