Project

General

Profile

Bug #973

"snd_pcm_recover failed" alsa error and "String leaked" warnings

Added by Igor Kushnir 3 months ago. Updated 3 months ago.

Status:
New
Priority:
Minor
Assignee:
-
Category:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Affects version:

Description

Steps to reproduce:
1. Enable Song Change Audacious plugin and set its Command to run at the end of the playlist to:

bash -c "sleep 0.1 && audacious -p -E '/usr/share/sounds/alsa/Front_Center.wav'" 

2. Set Audio Output plugin to ALSA Output.
3. Disable all Repeat and Shuffle options in Audacious to let the configured Song Change command run.
4. Quit Audacious and run it from terminal like this:

audacious -p '/usr/share/sounds/alsa/Front_Center.wav'

5. Let Audacious play this short file repeatedly for several minutes. You may want to mute Audacious in pavucontrol.
6. If no errors appear in Audacious output after 10 minutes, try a different sleep interval. I get more than one error per minute with the interval 0.1. But I also get at least one error in less than 10 minutes with intervals 0.01, 0.05, 0.2 and 0.5.
7. Quit Audacious and examine its output. Possible result:

$ audacious -p '/usr/share/sounds/alsa/Front_Center.wav' 
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
ERROR alsa.cc:253 [get_delay_locked]: snd_pcm_recover failed: Input/output error.
WARNING strpool.cc:181 [operator()]: String leaked: sounds - alsa - Front_Center
WARNING strpool.cc:181 [operator()]: String leaked: file:///usr/share/sounds/alsa/Front_Center.wav
WARNING strpool.cc:181 [operator()]: String leaked: Microsoft WAV (signed 16 bit)
WARNING strpool.cc:181 [operator()]: String leaked: wav
WARNING strpool.cc:181 [operator()]: String leaked: Mono, 48 kHz
WARNING strpool.cc:181 [operator()]: String leaked: /usr/share/sounds/alsa
WARNING strpool.cc:181 [operator()]: String leaked: sounds
WARNING strpool.cc:181 [operator()]: String leaked: alsa
WARNING strpool.cc:181 [operator()]: String leaked: Front_Center
WARNING runtime.cc:364 [aud_leak_check]: Bytes allocated at exit: 160

8. Expected result: empty output.
9. Note that the String leaked warnings don't appear every time. Perhaps once in three such tests on average.
10. In case you don't have an audio file at the specified path, I'm attaching mine to this bug report. The path to the file shouldn't matter. The bug is not limited to this particular file, but it allows to reproduce the issue with minimum effort due to its short duration.
11. I have reproduced this bug with audacious and audacious-plugins built from current git master: https://github.com/audacious-media-player/audacious/commit/ffd9ac46a43f3fb0e02d06adf382291f82037a16 ; https://github.com/audacious-media-player/audacious-plugins/commit/89b6ab575ec823b67655bea2fbd2dc7429465377 (built both in Debug and Release modes)

Front_Center.wav (134 KB) Front_Center.wav Igor Kushnir, April 21, 2020 17:48

History

#1 Updated by John Lindgren 3 months ago

The ALSA EIO errors and the "String leaked" warnings sound like two different issues to me. But I cannot reproduce either one.

An EIO error returned by ALSA is also not necessarily a bug in Audacious; it could be also a bug in the driver or in libasound. What ALSA device have you selected? Does the same EIO error occur with "hw:0,0"?

#2 Updated by John Lindgren 3 months ago

As for the "String leaked" warning, does it occur if you disable all other General plugins except Song Change? Does it occur in headless mode?

#3 Updated by John Lindgren 3 months ago

  • Subject changed from "snd_pcm_recover failed" alsa error and "String leaked" warnings when Audacious is asked to play the same file almost immediately after the end of the current playlist is reached to "snd_pcm_recover failed" alsa error and "String leaked" warnings

#4 Updated by Igor Kushnir 3 months ago

I have two sound cards:
  • CMI8788 [OXygen HD Audio] (Virtuoso 100 (Xonar D1)) (in pavucontrol) or CARD=D1 - Xonar D1, Multichannel (in Audacious ALSA Output Settings)
  • Built-in Audio (in pavucontrol) or CARD=Intel - HDA Intel ALC887 Analog (in Audacious ALSA Output Settings)

I keep one of them disabled in PulseAudio settings.
When I try to select "hw:0:0 - Multichannel" or "hw:1:0 - ALC887 Analog" as PCM device in Audacious ALSA Output Settings, I get one of the following errors in a combobox:
ALSA error: snd_pcm_open failed: Device or resource busy. (more common) or ALSA error: snd_pcm_hw_params_set_channels failed: Invalid argument.
So I usually select "default - Default PCM device" as PCM device and "default - Default mixer device" as Mixer device. This configuration works with the currently enabled sound card, regardless of which card I enable/disable in pavucontrol. But the snd_pcm_recover failed error also happens regardless of which card is the default and being used.

#5 Updated by Igor Kushnir 3 months ago

I have disabled all plugins except for Song Change, Sndfile Plugin (to play the WAW file) and Audacious Playlists (audpl). Still get the String leaked warnings sometimes.

I am not able to reproduce the error in headless mode. But I've been able to reproduce the warnings in headless mode, even with all but three plugins disabled. I start and quit Audacious like this:

audacious -p '/usr/share/sounds/alsa/Front_Center.wav' -H

audtool shutdown

Could the alsa error output be redirected elsewhere or not printed at all? Or does this mean that the ALSA issue simply doesn't happen in headless mode?

John Lindgren wrote:

The ALSA EIO errors and the "String leaked" warnings sound like two different issues to me. But I cannot reproduce either one.

Yes, probably different, but I hoped that you'll be able to reproduce both in the same way.
Did you make sure that it is the Song Change plugin that repeats the playback? Repeat and Shuffle options can be indistinguishable from this Song Change configuration if the sleep interval is small. So you could verify that Song Change is being activated by temporarily increasing the sleep interval to 5 [seconds] and making sure that this delay actually occurs.

Also available in: Atom PDF