Score:1

ALSA lib pcm.c:8526:(snd_pcm_recover) underrun occurred...?

cn flag

I recently installed Xubuntu 20.04 on a new computer with the hardware configuration listed below :

  • mother board HP type Memphis 2-S
  • CPU Intel Pentium G3250 Dual core à 3.2 GHz
  • 16 Go Ram
  • 500 Go SSD
  • Videocard GeForce 1030 (using the either the NVidia proprietary or the open source drivers).

To listen to the sound, I’m using either a mixing USB console Yamaha MG12XU as external soundcard,or a KVM HDMI switch which also can be used as USB external soundcard, or I plug my headphone straight in the plug for it on the computer.

The problem is I’m having «jumps» and «gaps» when I’m listening music. It’s like if the reading was jumping backward of forward of few dozen of milliseconds, or sometimes just leaving a blank.

This problem is totally random : if I move backward my song, the problem won’t reproduce at the same moment in the song. It occurs with sound listened from a stream (deezer, youtube....) or with local files played either with VLC or Mixxx or anything else ; and no matter the kind of file : ogg, mp3 or flac, same problem.

As Mixxx seems to be a bit «talkative» when I launch it from the console, I noticed some errors appeared at launching (but they also appears when Mixxx is launched from my laptop which don’t have this sound problem) and a recuring error each time the jump / gap occurs.

Here are the errors at the launching of Mixxx

ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
Warning [Controller]: USB permissions problem (or device error.) Your account needs write access to USB HID controllers.
Warning [Controller]: USB permissions problem (or device error.) Your account needs write access to USB HID controllers.
Warning [Controller]: USB permissions problem (or device error.) Your account needs write access to USB HID controllers.
Warning [Controller]: USB permissions problem (or device error.) Your account needs write access to USB HID controllers.
Warning [Controller]: USB permissions problem (or device error.) Your account needs write access to USB HID controllers.
Warning [Controller]: USB permissions problem (or device error.) Your account needs write access to USB HID controllers.
ALSA lib pcm.c:8526:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8526:(snd_pcm_recover) underrun occurred
Warning []: SoundDeviceNetworkThread: Failed bumping priority

Here is the error when I jump / gap occurs

ALSA lib pcm.c:8526:(snd_pcm_recover) underrun occurred

I also noticed something strange : this error can appears in the console, even when no sound is playing. When all Mixxx players are stopped, sometimes, I see a bunch of «underrun» errors appearing in the console.

As found on some forum, I modified the /etc/pulse/daemon.conf file as below :

default-fragments = 4 => modified to 100
default-fragment-size-msec = 25 => modified to 10000

With 100 seconds of buffer, I supposed the problem would be solved but, it didn’t changed anything : neither worse or better.

It’s desperating. I know this computer is not a «gamer» computer, but it seems powerful enough to read sound files. Even my old 32 bit laptop don’t have this problem...

Maybe the «underrun» error is not the problem. But in this case

  1. I don’t know where looking for an error message to try to identify the source of the problem
  2. Why does this message would appears each time the problem occurs?
in flag
Silly question, but did you remove the `;` at the start of the lines in `/etc/pulse/daemon.conf` for the two values that you changed? The large change for `default-fragment-size-msec` is likely introducing additional latency to the system, as the fragments are not expected to be that large. Do you notice a high CPU load when using audio?
cn flag
It’s not a silly question at all as I forgot to remove the «;» first time I modified the daemon.conf. But yes, I did removed it since. And, about the CPU load, yes, I notice some small peaks when the error occurs. For example, now, I’m having Firefox open to answer you, and Mixxx. The peaks are making the CPU increase from 25 to 50%.
in flag
Have you seen [this document regarding Mixxx troubleshooting](https://github.com/mixxxdj/mixxx/wiki/troubleshooting#hid_and_usb_bulk_controllers_on_gnu_linux)? The USB permission error could be contributing to your issue. Another option would be to adjust the `nice-level` in `daemon.conf` to something higher, such as `-5`, but this could have adverse effects if the CPU is busy doing other things. Giving audio too much priority is generally not recommended when not using a realtime kernel
cn flag
I just did modified the nice-level. It seemed promising at first but, finally, the problem still occurs. And, yes, I had a view on the Mixxx troubleshooting documentation. But I didn’t finished to explore it as the USB error appears on both of my computers and the second one don’t have this sound problem.
cn flag
A silly question : would it be possible that ALSA module had some problem after one of the system update ? If yes, is there an easy way to force a reinstall of Alsa and Pulse ? Or will I get crazy with thousands of errors when I’ll reinstall it ?
in flag
You can generally reinstall software with a `sudo apt install --reinstall {package}` but, if the problem is in a config file, then reinstalling a package may not replace a configuration file.
cn flag
I’m not very experienced in solving problems in Linux. So, what would you advise me ?
vn flag
[This means underrun](https://www.linuxjournal.com/article/6735?page=0,1). You could [set the app to _use the ALSA drivers directly (bypassing other sound system "layers")_](https://forum.audacityteam.org/viewtopic.php?t=99274#p344187), or try [this tweak](https://retro64xyz.gitlab.io/how-to/2017/05/26/how-to-fix-audacity-underrun/).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.