ALSA sound broken again - "Playback open error: -16,Device or resource busy"

Once again, my sound is broken. I can hear but my microphones produce nothing.

I’m running 13.1 on x86_64 ASUS. I don’t run PulseAudio because I have never been able to get it to work.

aplay -vv /opt/kde3/share/sound/KDE_Beep_Ahem.wav works. speaker-test shows the following:


$speaker-test -c2 -D hw:0,0 -l3 -twav

speaker-test 1.0.27.2

Playback device is hw:0,0
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Playback open error: -16,Device or resource busy

I have run alsa-info.sh and posted the output at


http://www.alsa-project.org/db/?f=0fcbef194f4653178cafec084b05cb222f57c2f0

Is there some way to determine what program is locking up the sound card? I can’t see anything obvious with top or ps.

Leslie

lsof /dev/dsp

Should list the programs using the sound device in a alsa only system

Can you run another test ? Try this in a terminal as both a regular user and also with root permissions:


 aplay -vv /usr/share/sounds/alsa/test.wav

and advise what errors you get with that ?

No. /dev/dsp is the sound device for OSS.
ALSA has its devices in /dev/snd/.
So it should rather be “lsof /dev/snd/*”.

Normally it should be no problem for more than one application to use ALSA devices at the same time though (the dmix plugin is enabled by default).
But if an application uses the device via OSS, it blocks all others, so it still might be worth to check whether one is using /dev/dsp as well.

@OP:
Are you sure that PulseAudio is not running?
This takes exclusive control over the sound devices, so all other programs using ALSA will not work.
Better check in with “ps aux|grep pulse” or in the system monitor.

OTOH:

So playback does actually work, doesn’t it?
You have a problem with recording, right?

Regarding speaker-test, have you tried it without any parameters?

The speakers are working fine. Both aplay and speaker-test produce sound. What I have is no microphone response; i.e., no sound is getting into the system.
Specifically, I’m using Mumble. It was working fine on Monday, but yesterday participants in a Mumble session were unable to hear me. Both the Mumble Audio Wizard and the Configuration dialog show no microphone response.


**#lsof /dev/snd/***
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /var/run/user/1000/gvfs
      Output information may be incomplete.
COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
kmix    2742 leslie   10u   CHR  116,6      0t0 7801 /dev/snd/controlC0
kmix    2742 leslie   11u   CHR  116,9      0t0 7807 /dev/snd/controlC1
mumble  3112 leslie  mem    CHR  116,3          7798 /dev/snd/pcmC0D0p
mumble  3112 leslie  mem    CHR  116,4          7799 /dev/snd/pcmC0D0c
mumble  3112 leslie   21r   CHR 116,33      0t0 8855 /dev/snd/timer
mumble  3112 leslie   22u   CHR  116,4      0t0 7799 /dev/snd/pcmC0D0c
mumble  3112 leslie   23u   CHR  116,6      0t0 7801 /dev/snd/controlC0
mumble  3112 leslie   24r   CHR 116,33      0t0 8855 /dev/snd/timer
mumble  3112 leslie   25u   CHR  116,3      0t0 7798 /dev/snd/pcmC0D0p
mumble  3112 leslie   26u   CHR  116,6      0t0 7801 /dev/snd/controlC0

Normally it should be no problem for more than one application to use ALSA devices at the same time though (the dmix plugin is enabled by default).
But if an application uses the device via OSS, it blocks all others, so it still might be worth to check whether one is using /dev/dsp as well.

@OP:
Are you sure that PulseAudio is not running?
[/quote]
Yes; that was the first thing I checked.

This takes exclusive control over the sound devices, so all other programs using ALSA will not work.
Better check in with “ps aux|grep pulse” or in the system monitor.

OTOH:

So playback does actually work, doesn’t it?
You have a problem with recording, right?

Correct.

Regarding speaker-test, have you tried it without any parameters?

It produces static.

For a while I thought the problem might be merely something gone wrong with Mumble, but then I noticed that if I close the laptop I get faint feedback sounds between the built-in microphone and the built-in speakers; so I tried recording some audio with arecord, and get this output:


$**arecord -vv -d 10 sample.wav**
Recording WAVE 'sample.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
Plug PCM: Rate conversion PCM (48000, sformat=U8)
Converter: libspeex (builtin)
Protocol version: 10002
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : U8
  subformat    : STD
  channels     : 1
  rate         : 8000
  exact rate   : 8000 (8000/1)
  msbits       : 8
  buffer_size  : 2730
  period_size  : 170
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 170
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 2730
  silence_threshold: 0
  silence_size : 0
  boundary     : 768426686420090880
Slave: Route conversion PCM (sformat=S32_LE)
  Transformation table:
    0 <- 0
Its setup is:
  stream       : CAPTURE
  access       : MMAP_INTERLEAVED
  format       : U8
  subformat    : STD
  channels     : 1
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 8
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 6
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Slave: Soft volume PCM
Control: Digital Capture Volume
min_dB: -30
max_dB: 30
resolution: 121
Its setup is:
  stream       : CAPTURE
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 6
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Slave: Direct Snoop PCM
Its setup is:
  stream       : CAPTURE
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 6
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Hardware PCM card 0 'HDA Intel MID' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : ENABLE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 0
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
  appl_ptr     : 0
  hw_ptr       : 3539313696
#+                                                 | 00%

The last line is presumably a sort of VU meter; it shows no activity. The file it produces looks like


$**ll sample.wav**
-rw-r--r-- 1 leslie users 80044 2014-08-09 09:40:10 sample.wav

When I play it back with aplay I get this output, but no sound:


$**aplay -vv sample.wav**
Playing WAVE '/opt/kde3/share/sounds/KDE_Beep_Beep.wav' : Unsigned 8 bit, Rate 7418 Hz, Mono
Plug PCM: Rate conversion PCM (48000, sformat=U8)
Converter: libspeex (builtin)
Protocol version: 10002
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : U8
  subformat    : STD
  channels     : 1
  rate         : 7418
  exact rate   : 7418 (7418/1)
  msbits       : 8
  buffer_size  : 2532
  period_size  : 158
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 158
  period_event : 0
  start_threshold  : 2532
  stop_threshold   : 2532
  silence_threshold: 0
  silence_size : 0
  boundary     : 712694641031380992
Slave: Route conversion PCM (sformat=S32_LE)
  Transformation table:
    0 <- 0
    1 <- 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : U8
  subformat    : STD
  channels     : 1
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 8
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Slave: Soft volume PCM
Control: PCM Playback Volume
min_dB: -51
max_dB: 0
resolution: 256
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Slave: Direct Stream Mixing PCM
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Hardware PCM card 0 'HDA Intel MID' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : ENABLE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 0
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
  appl_ptr     : 0
  hw_ptr       : 3548426272
Playing WAVE 'sample.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
Plug PCM: Rate conversion PCM (48000, sformat=U8)
Converter: libspeex (builtin)
Protocol version: 10002
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : U8
  subformat    : STD
  channels     : 1
  rate         : 8000
  exact rate   : 8000 (8000/1)
  msbits       : 8
  buffer_size  : 2730
  period_size  : 170
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 170
  period_event : 0
  start_threshold  : 2730
  stop_threshold   : 2730
  silence_threshold: 0
  silence_size : 0
  boundary     : 768426686420090880
Slave: Route conversion PCM (sformat=S32_LE)
  Transformation table:
    0 <- 0
    1 <- 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : U8
  subformat    : STD
  channels     : 1
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 8
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Slave: Soft volume PCM
Control: PCM Playback Volume
min_dB: -51
max_dB: 0
resolution: 256
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Slave: Direct Stream Mixing PCM
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Hardware PCM card 0 'HDA Intel MID' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : ENABLE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 0
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
  appl_ptr     : 0
  hw_ptr       : 3548434468

We have a lot of cooks here. Tell me to stop contributing if I am not helpful.

I misread your message . I thought you had no sound.

wrt your mic, you may have your mic muted. Note this:


**Simple mixer control 'Mic Boost',0**
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 **0%**] [0.00dB]
  Front Right: 0 **0%**] [0.00dB]
**Simple mixer control 'Capture',0**
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 46
  Front Left: Capture 32 [70%] [15.00dB] [on]
  Front Right: Capture 32 [70%] [15.00dB] [on]
**Simple mixer control 'Auto-Mute Mode',0**
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
**Simple mixer control 'Digital',0**
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 120
  Front Left: **Capture** 0 **0%**] -30.00dB]
  Front Right:** Capture** 0 **0%**] -30.00dB]

**Simple mixer control 'Internal Mic Boost',0**
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 **0%**] [0.00dB]
  Front Right: 0 **0%**] [0.00dB] 

On some computers, the mic will not record with boost levels at 0%. Your PC has both the internal mic set to 0% boost and the mixer control boost set to 0%.

In addition the digital control capture is set to 0% capture. If this is an internal mic in a laptop that prevents capture.

wrt testing, FIX your mixer settings. Then try this command in a terminal as a regular user, and also if that fails with root permissions:


arecord -vv -f S16_LE -c 2 -D hw:0,0 newrecording.wav

stop the recording by pressing < ctrl > < c > and then play back the file ‘newrecording.wav’.

Note any error messages when running arecord and post them here.

Okay, it turns out the problem was that** KMix set the Input Digital slider to 0**. I’ll have to remember this in future; it has happened several times now, for no apparent reason.

I can’t find any information on the purposes of the Output PCM slider, the Input Digital slider, and the Switch IEC598. Can anyone enlighten me?

Typically PCM is associated with your output volume control for sound files (where PCM is for “Pulse Code Modulation”.).

Input Digital mic control is for a digital mic - typically that is applicable for laptops with an integrated webcam, and that controls the laptop microphone which is usually associated with the integrated webcam and is usually digital.

IEC958 is a standard for digital audio transfer published by the IEC (International Electrotechnical Commission). wrt IEC 958 and alsa, possibly an explanation here may help: http://www.alsa-project.org/~tiwai/writing-an-alsa-driver/ch10s03.html . A lot of this is hardware dependent and varies from PC to PC.