raspberrypi / bookworm-feedback

12 stars 1 forks source link

[KMS DRM][rpi zero 2w] - crackle sound, ALSA lib pcm.c:8570:(snd_pcm_recover) underrun occurred 0B f=0/0 #265

Open qrp73 opened 1 week ago

qrp73 commented 1 week ago

This issue appears on Raspberry Pi Zero 2W running on latest Raspi Bookworm Lite aarch64.

Steps to reproduce: 1) Use Raspberry Pi Zero 2W at default clock, running on Linux rpi2w 6.6.31+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux 2) Connect HDMI display (I'm using 1280x1024@60 resolution) 3) Connect USB hub with keyboard and USB sound card 4) sudo reboot 5) mkdir TEST && cd TEST 6) wget https://www.mediacollege.com/audio/tone/files/1kHz_44100Hz_16bit_05sec.wav 7) aplay 1kHz_44100Hz_16bit_05sec.wav

Notice sound is played ok, as expected

8) SDL_VIDEODRIVER=kmsdrm ffplay 1kHz_44100Hz_16bit_05sec.wav

Expected result: sound is played ok

Actual result: sound is played with crackles and a bunch of errors appears in console output:

ALSA lib pcm.c:8570:(snd_pcm_recover) underrun occurred  0B f=0/0
ALSA lib pcm.c:8570:(snd_pcm_recover) underrun occurred  0B f=0/0
ALSA lib pcm.c:8570:(snd_pcm_recover) underrun occurred  0B f=0/0
...

The same issue on attempt to play any sound/video file with SDL_VIDEODRIVER=kmsdrm ffplay. The video is played ok, and sound is played but for some unknown reason the sound periodically breaks for 0.1 second and then resumes again.

I tested it on Raspberry Pi 4 rev 1.5 and it works ok. So the issue happens only when running on Raspberry Pi Zero 2W.

qrp73 commented 1 week ago

Some more findings. It appears that this issue happens with CX31993 USB sound card.

When I use different type USB sound card dongle it plays sound with no crackle. It seems that this is an issue in USB driver for CX31993 chip or for RPI Zero 2W USB chipset in general.