Search code examples
ralsa

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


While starting to learn about the audio R package and other packages based on I run into 2 problem:

  • the sound is awful and can't be understood
  • my console is filled up with messages

at first I get those messages :

ALSA lib pcm_dsnoop.c:641:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave
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_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
ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slaveALSA lib pcm.c:8526:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8526:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8526:(snd_pcm_recover) underrun occurred

After some gess try and googling errors I manage to remove most of them and I only get those for now (Edit I still get the first messages they just became rare :/):

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

the number of error line is random sometimes no error sometimes a bunch.

I used the audio packages with the simple play(sin(1:10000/20)) code and Rmusic pakage with this : play_music(c("B5","A5","G5","F#5","E5","D5","C#5","B4"),c(1,1,1,1,1,1,1,1))

both are making the sames errors

I'm on kubuntu 20.04 lastest R-base installed 3.6.3

> audio.drivers()
       name      description current
1 portaudio PortAudio driver    TRUE

Portaudio19-dev installed just before starting to test


Solution

  • I've had a similar issue with my "silero" text to speech python framework:

    ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred silero
    

    I've fixed it by installing suggested codecs from the "Software"-application.

    Add-ons -> Codecs -> GStreamer Multimedia Codecs -> Install

    I installed all suggested codecs as well and rebooted. For me the error was gone. GL!