DeaDBeeF-Player / deadbeef

DeaDBeeF Player
https://deadbeef.sourceforge.io/
Other
1.59k stars 174 forks source link

Stuttering since some last (kernel?) update #3053

Closed sushi2503 closed 3 months ago

sushi2503 commented 3 months ago

Steps to reproduce the problem

Launch a music file or a radio.

What's going on? Describe the problem in as much detail as possible.

Files or radios are unstable, stuttering, accelerating like a buffer/timing problem. The same files or radios are playing without problems through mpv. I have tried to change the buffer size without success. Somethings strange, if I play the same radio it shows ~ 60 kbps in Deadbeef and 150 kbps in mpv (aac).

https://fr1.streamhosting.ch/lounge64.aac

No error in journalctl nor xsenssion-erros and Deadbeef journal.

Information about the software:

Deadbeef version: 1.9.6-1

Sound card: RME HDSP 9632

OS: Archlinux up to date

Let me know if you need more information.

Thank you.

Edit : I have tried to revert the kernel from 6.7.9 to 6.7.7 but the problem still occur. Sounds like something else is causing it.

sushi2503 commented 3 months ago

Hello,

It has to do with the buffer size. I was by 1024/512 (buffer/period) and now 512/256 and it seems to work better but not perfectly. But mpv still uses 4096/2048 with same card without problems. A year ago I could use 4096/2048 with deadbeef but after some change (I don't know which) I had to drop the buffer/period size to 1024/512 and now to 512/256. What is the rational explanation for that ?

Thanks

Oleksiy-Yakovenko commented 3 months ago

Did you try restoring it back to defaults and see if it helps?

Oleksiy-Yakovenko commented 3 months ago

Somethings strange, if I play the same radio it shows ~ 60 kbps in Deadbeef and 150 kbps in mpv (aac). https://fr1.streamhosting.ch/lounge64.aac

I checked this stream, 60 is correct.

sushi2503 commented 3 months ago

I just set it to default which is 8192/1024 to try (but untick alsa upscaling) . Looks good till now.

Something that I don't understand, is deadbeef's buffer the real sound card buffer or just from deadbeef itself ? Because I read that the card is supposed to have a max buffer for 44.1/48000 kHz of 1024 and 2048 for 88.2 kHz and upward.

Thanks to confirm for the stream !

Oleksiy-Yakovenko commented 3 months ago

This specific one is a setting, which tells ALSA which buffer/period size it should be using while interacting with the application. It's possible that under some circumstances ALSA will use the same buffer size for soundcard data, but this is not guaranteed.

Oleksiy-Yakovenko commented 3 months ago

Small buffer size reduces latency, but increases the likelihood of stuttering when the application can't process data with high enough frequency. In music playback, latency is only important as long as it doesn't affect visualizations and pausing/unpausing in a significant way. So you should always prefer the buffer which is as large as possible, but not large enough to introduce issues in visualizations. So if you aim for 60fps -- you need the buffer at most 1/60th of a second.

sushi2503 commented 3 months ago

I see, thanks for the explanation. I will let it to default, if it's stable I will close this "issue".

P.S. With the default buffer size it's consuming far less then my setting.

Just a question, is there any way to play (repeat mode) just a sequence from a file ?

Clear about buffer and latency, this is the reason way I prefer to use a larger one for playback.

Oleksiy-Yakovenko commented 3 months ago

Just a question, is there any way to play (repeat mode) just a sequence from a file ?

what do you mean by a sequence? a playlist?

sushi2503 commented 3 months ago

By sequence I mean just few seconds from a music file, like in Audacity where you can put a cursor from A to B and repeat this sequence how many time you want.

Oleksiy-Yakovenko commented 3 months ago

Sorry, but no -- I don't believe there's such feature in deadbeef UI. You would need to create a CUE file for that.

sushi2503 commented 3 months ago

No problem, deadbeef has already enough things and fulfills my every day's use since a long time...

Thank you.

As soon as the buffer is stable I will close the "issue".

sushi2503 commented 3 months ago

It's now stable with the default buffer setting 8192/1024 but the result of : /proc/asound/card0/pcm0p/sub0/hw_params

Gives : buffer_size: 8192 period_size: 4096

It means that ALSA is anyway changing the period from 1024 to 4096 probably due to the card. So, I put 4096 as period size in Deadbeef and no stuttering.

Closing.