Discussion:
[Alsa-user] Soundblaster Live! dmix single application only
Sebastian Holtermann
2017-02-02 21:37:58 UTC
Permalink
Hi,

I'm running Debian testing/stretch and since a few days (weeks?)
dmix refuses to work with a old SoundBlaster Live! card
when multiple applications try to play music.

Any ideas and/or hints?

The mplayer test case in two shells:

------------------- Shell 2: -----------------------------------
Sound works. I pressed q to quit mplayer.
The semaphore error only occurs when the
second instance of mplayer was started - and failed - in Shell 2.
mplayer -ao alsa:device=dmixer \
07\(Lindsey\ Stirling\)\ -\ Transcendence.flac
.
.
.
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 57.64.101 (external)
AUDIO: 44100 Hz, 2 ch, s16le, 1033.9 kbit/73.27% (ratio: 129241->176400)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 3.3 (03.3) of 225.0 (03:45.0) 0.5%
[AO_ALSA] alsa-lib: pcm_direct.h:279:(snd_pcm_direct_semaphore_final)
invalid semaphore count to finalize 0: 0

Exiting... (Quit)
.
.
.


------------------- Shell 2: -----------------------------------
No sound. mplayer fails with an error.
mplayer -ao alsa:device=dmixer \
07\(Lindsey\ Stirling\)\ -\ Transcendence.flac
.
.
.
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 57.64.101 (external)
AUDIO: 44100 Hz, 2 ch, s16le, 1033.9 kbit/73.27% (ratio: 129241->176400)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
[AO_ALSA] alsa-lib: pcm_hw.c:1601:(snd_pcm_hw_open) open
'/dev/snd/pcmC0D0p' failed (-22): Invalid argument
[AO_ALSA] alsa-lib: pcm_dmix.c:1098:(snd_pcm_dmix_open) unable to open slave
[AO_ALSA] Playback open error: Invalid argument
Failed to initialize audio driver 'alsa:device=dmixer'
.
.
.


------------------- /etc/asounf.conf -----------------------------------

.
.
.
pcm.dmixer {
type dmix
ipc_key 1030
ipc_key_add_uid false
ipc_perm 0666
slave {
pcm "hw:Live"
period_time 0
period_size 1024
buffer_size 8192
rate 48000
channels 2
}
bindings {
0 0
1 1
}
}
.
.
.


------------------- System -----------------------------------
uname -a
Linux blauwal 4.9.0-1-amd64 #1 SMP Debian 4.9.2-2 (2017-01-12) x86_64
GNU/Linux

ALSA library version: 1.0.27
Sebastian Holtermann
2017-02-02 22:11:00 UTC
Permalink
Post by Sebastian Holtermann
------------------- Shell 2: -----------------------------------
Sound works. I pressed q to quit mplayer.
The semaphore error only occurs when the
second instance of mplayer was started - and failed - in Shell 2.
Sorry, that's Shell 1.
Clemens Ladisch
2017-02-03 07:30:40 UTC
Permalink
Post by Sebastian Holtermann
I'm running Debian testing/stretch and since a few days (weeks?)
dmix refuses to work with a old SoundBlaster Live! card
when multiple applications try to play music.
[AO_ALSA] alsa-lib: pcm_direct.h:279:(snd_pcm_direct_semaphore_final)
invalid semaphore count to finalize 0: 0
This sounds like a bug in the alsa-lib package.
Do you have the latest version (1.1.3)?


Anyway, the "Live!" can do hardware mixing with resampling, so you
don't need dmix.


Regards,
Clemens
Sebastian Holtermann
2017-02-03 09:22:46 UTC
Permalink
Post by Clemens Ladisch
Post by Sebastian Holtermann
I'm running Debian testing/stretch and since a few days (weeks?)
dmix refuses to work with a old SoundBlaster Live! card
when multiple applications try to play music.
[AO_ALSA] alsa-lib: pcm_direct.h:279:(snd_pcm_direct_semaphore_final)
invalid semaphore count to finalize 0: 0
This sounds like a bug in the alsa-lib package.
Do you have the latest version (1.1.3)?
Debian ships 1.1.2 at the moment (libasound2).
I'm not sure about their freezing state it but
it seems 1.1.3 is on the way.
https://tracker.debian.org/pkg/alsa-lib
I'll test it when its out in stretch/testing.
Post by Clemens Ladisch
Anyway, the "Live!" can do hardware mixing with resampling, so you
don't need dmix.
That works, thanks!

-Sebastian
Sebastian Holtermann
2017-02-04 11:38:05 UTC
Permalink
Post by Sebastian Holtermann
Post by Clemens Ladisch
Post by Sebastian Holtermann
[AO_ALSA] alsa-lib: pcm_direct.h:279:(snd_pcm_direct_semaphore_final)
invalid semaphore count to finalize 0: 0
This sounds like a bug in the alsa-lib package.
Do you have the latest version (1.1.3)?
I'll test it when its out in stretch/testing.
When using alsa-lib 1.1.3 the semaphore error is gone.
That's good.

On the other hand there still is no sound on the second mplayer
instance when using dmix. It quits with same error as before.

So on this system dmix with a "hw:Live" slave does not work.
What does work is dmix with the onboard Intel chip "hw:Intel" slave.
...
00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio
Controller
05:00.0 Multimedia audio controller: Creative Labs EMU10k1 [Sound
Blaster Live! Series] (rev 07)
...


Well, I can just report this behaviour.
It is not a big issues since the hardware mixing works perfectly.
But still it is a bit of a loss since dmix did work before with emu10k1.

-Sebastian

Loading...