ALSA EPIPE (underrun) [Linux]

Found a bug? Post it here.
Post Reply
app4soft
Posts: 3
Joined: Sun Jan 14, 2018 3:13 pm

ALSA EPIPE (underrun) [Linux]

Post by app4soft » Sun Jan 14, 2018 3:57 pm

SunVox version: 1.9.3b Nov 25 2017
OS: MX Linux MX-17 (Debian 9 "Stretch"), x86_64 (64-bit)

Description: On some examples got issue with ALSA output.

UPD: Still reproduced after switch to Driver=ALSA; Output=hw:0,0

Used example: "Pavel Ti - Boomer" (but few other examples also give such issue)

Terminal/console output:

Code: Select all

$ ./sunvox
SunDog Engine / Nov 25 2017 12:26:49
WM: device start
WM: language = en_US.UTF-8
WM: screen_zoom = 1
WM: screen_ppi = 96
WM: screen size = 800 x 600
WM: flags SCALABLE OPTIMIZE_MOVE_EVENTS FRAMEBUFFER 
WM: system palette init...
WM: initialized
Audio buffer size: 2048 frames
ALSA: hw:0,0
ALSA HW Default rate: 44100
ALSA HW Rate: 44100 frames
ALSA HW Buffer size: 4096 frames
ALSA HW Period size: 256
ALSA HW Periods: 0
ALSA SW Avail min: 256
ALSA SW Start threshold: 1
ALSA SW Stop threshold: 4096
WM: system palette init...
Stack ptr: 0
Stack is clean
SunVox v1.9.3b Nov 25 2017 12:26:51; driver: ALSA; 32bit floating-point; sample rate: 44100
SOUND: sundog_sound_deinit() begin
SOUND: sundog_sound_deinit() end
SDL: video deinit...
Max memory used: 10377221
SunDog Engine / Nov 25 2017 12:26:49
WM: device start
WM: language = en_US.UTF-8
WM: screen_zoom = 1
WM: screen_ppi = 96
WM: screen size = 800 x 600
WM: flags SCALABLE OPTIMIZE_MOVE_EVENTS FRAMEBUFFER 
WM: system palette init...
WM: initialized
Audio buffer size: 2048 frames
ALSA: hw:0,0
ALSA HW Default rate: 44100
ALSA HW Rate: 44100 frames
ALSA HW Buffer size: 4096 frames
ALSA HW Period size: 256
ALSA HW Periods: 0
ALSA SW Avail min: 256
ALSA SW Start threshold: 1
ALSA SW Stop threshold: 4096
WM: system palette init...
Stack ptr: 0
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
ALSA snd_pcm_writei error: Broken pipe
ALSA EPIPE (underrun)
Last edited by app4soft on Sun Jan 14, 2018 5:20 pm, edited 2 times in total.

User avatar
NightRadio
Site Admin
Posts: 2882
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: ALSA EPIPE (underrun) [Linux]

Post by NightRadio » Sun Jan 14, 2018 4:04 pm

I have the same error when using the default sound settings. PulseAudio is the reason. Please try to use the real ALSA device:
Driver=ALSA;
Output=hw:0,0 (or some other device).

app4soft
Posts: 3
Joined: Sun Jan 14, 2018 3:13 pm

Re: ALSA EPIPE (underrun) [Linux]

Post by app4soft » Sun Jan 14, 2018 4:46 pm

Well, after change settings still got such issues.

Details added in first post.

User avatar
NightRadio
Site Admin
Posts: 2882
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: ALSA EPIPE (underrun) [Linux]

Post by NightRadio » Mon Jan 15, 2018 12:19 am

Thank you for the log!
1) Do these messages affect sound? Is the sound stuttering?
2) What is the CPU Usage (in the window with modules) in these moments?
3) What is your sound card?
4) Please also try to switch the sample rate to 48000

app4soft
Posts: 3
Joined: Sun Jan 14, 2018 3:13 pm

Re: ALSA EPIPE (underrun) [Linux]

Post by app4soft » Mon Jan 15, 2018 6:16 am

1) Do these messages affect sound? Is the sound stuttering?

Yes.

2) What is the CPU Usage (in the window with modules) in these moments?

In a moment it jump from 5%-15% to 90%-100%. Overload is not static, mostly look like jumps every one-half a second.

3) What is your sound card?

Code: Select all

Card Advanced Micro Devices [AMD/ATI] SBx00 Azalia (Intel HDA) driver: snd_hda_intel
Sound: Advanced Linux Sound Architecture v: k4.13.0-1-amd64
4) Please also try to switch the sample rate to 48000

Set it, but issue still reproducable.

P.S.: It's very easy reproduce this issue on my PC with any song:
  • Run SunVox;
  • Open any song;
  • Start play;
  • Minimize SunVox window (hide to panel);
  • In few seconds after minimazing window issue start cause sound and CPU by jumping with pulling each time "ALSA EPIPE (underrun)" in terminal window.
  • If unminimize SunVox window (make it visible again) in few seconds it could be stop causing and play as normal.
UPD: As addition, I try reproduce this issue on SunVox v1.9.1, but it not reproducable on it.

So, maybe, this issue in some way related to migration from SDL1.2 to SDL2?

UPD2: Also found that "./sunvox/examples/nt - Berlin FM.sunvox" in SunVox v1.9.3b generate me tonns of "ALSA EPIPE (underrun)". So, "nt - Berlin FM.sunvox" is best testcase for detect this issue, and now I can reproduce this issue with SunVox v1.9.1!

User avatar
NightRadio
Site Admin
Posts: 2882
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: ALSA EPIPE (underrun) [Linux]

Post by NightRadio » Tue Jan 16, 2018 7:23 pm

Thanks for the detailed information!
I still can't reproduce it on my Linux machines :(
More thoughts...
1) Try to launch the SunVox with the following command: pasuspender -- ./sunvox . This will open an exclusive access to the sound card for the SunVox. But, probably, this will close the access to sound for other applications.
2) Try the other audio drivers: JACK (qjackctl must be running in the background) or SDL.

Post Reply