alsa-project / alsa-lib

The Advanced Linux Sound Architecture (ALSA) - library
GNU Lesser General Public License v2.1
357 stars 176 forks source link

chromium - cracking pulseaudio issue (small buffer size settings - 512) #262

Closed shmohawk closed 2 years ago

shmohawk commented 2 years ago
Aug 17 01:11:23 hellokitty pulseaudio[12938]: [alsa-sink-CX20590 Analog] alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Aug 17 01:11:23 hellokitty pulseaudio[12938]: [alsa-sink-CX20590 Analog] alsa-sink.c: Most likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers.
Aug 17 01:11:23 hellokitty pulseaudio[12938]: [alsa-sink-CX20590 Analog] alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.

It is symptomous with a crackling sound for ~5 seconds after any playback starts.

alsa-lib 1.2.7.2 alsa-utils 1.2.7 alsa-plugins 1.2.2

perexg commented 2 years ago

Duplicate #90 .

For the crackling sound - it's probably a driver issue. Please, report it here: https://bugzilla.kernel.org (Audio group). Attach output from alsa-info.sh --no-upload.

shmohawk commented 2 years ago

I updated to pulseaudio 16 and the latest alsa-plugins, but it's still crackling. For some reason it does not happen with software using pulseaudio directly, only with alsa-over-pulseaudio, so I'm hesitant to be accepting of this being a kernel driver issue.

perexg commented 2 years ago

How do you test the alsa -> pulseaudio plugin ? Do things work with speaker-test or aplay utility ?

Crosslink: https://bugzilla.kernel.org/show_bug.cgi?id=216377

Additional comment in the kernel bugzilla: "They are symptomous with ~5s of crackling at the start of audio playbacks via pulseaudio-over-alsa. It does not occur with software interfacing with pulseaudio directly."

shmohawk commented 2 years ago

cmus is using pulseaudio directly (displaying "C* music player: playback" in pavucontrol), where it does not crackle. Google Chrome is showing up in pavucontrol as "ALSA plug-in [chrome]: ALSA playback".

I tested aplay with CantinaBand60.wav from https://www2.cs.uic.edu/~i101/SoundFiles/, displaying similar to Chrome in pavucontrol - without crackling. So this may very well be a problem in the ALSA interface of Google Chrome.

Edit: try launching chromium with --audio-buffer-size=2048 did actually seem to have fixed it. Chromium bug: Set audio buffer size to 2048.

perexg commented 2 years ago

So the issue is not directly ALSA related. Closing.