Bug 174848 - alsa fails to create IPC message queue since upgrade to 2.6.14 series
alsa fails to create IPC message queue since upgrade to 2.6.14 series
Product: Fedora
Classification: Fedora
Component: alsa-lib (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Martin Stransky
Depends On:
  Show dependency treegraph
Reported: 2005-12-02 13:45 EST by PvR
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-12-13 04:14:24 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
asoundrc containing default device (271 bytes, text/plain)
2005-12-02 13:46 EST, PvR
no flags Details

  None (edit)
Description PvR 2005-12-02 13:45:06 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7

Description of problem:
Ever since upgrading to any of the 2.6.14 series kernels I seem to get the following message, using mplayer (with alsa plugin) or xmms (alsa output) as a non root user, sporadically:

alsa-init: 1 soundcard found, using: default
ALSA lib pcm_dmix.c:797:(snd_pcm_dmix_open) unable to create IPC shm instance
alsa-init: playback open error: Permission denied
Could not open/initialize audio device -> no sound.

The "default" device is a USB audio device (SPDIF) through a dmix plug (to resample to 48khz). I will attach my .asounrdc. Using the device directly (hw:2,0) continues to work fine or being the root user using the "default" device also works fine. 

Strace looks like:

munmap(0xaf8000, 4096)                  = 0
semget(1234, 1, IPC_CREAT|0600)         = 1081346
semop(1081346, 0xbffcfa58, 2)           = 0
shmget(1234, 1012, IPC_CREAT|0600)      = -1 EACCES (Permission denied)
write(2, "ALSA lib pcm_dmix.c:797:(snd_pcm"..., 44ALSA lib pcm_dmix.c:797:(snd_pcm_dmix_open) ) = 44
write(2, "unable to create IPC shm instanc"..., 33unable to create IPC shm instance) = 33

Version-Release number of selected component (if applicable):
kernel-2.6.14-1.1644_FC4 alsa-lib-1.0.9rf-2.FC4

How reproducible:

Steps to Reproduce:
1. Use mplayer or xmms with alsa plugin 
2. Play any audio


Additional info:
Comment 1 PvR 2005-12-02 13:46:33 EST
Created attachment 121774 [details]
asoundrc containing default device
Comment 2 PvR 2005-12-02 13:52:33 EST
Ok, I think I have figure out how to reproduce. I use the same .asoundrc for
root and for my normal user, both specifying the same IPC key. If root uses it
first, my normal user cannot use the same IPC key, if normal user uses it first
and then root uses it, the normal user can continue to use it. I guess a
workaround is just to specify different keys in the two .asoundrcs. However, I
don't think I've ran into this problem with kernel <= 2.6.13.
Comment 3 Martin Stransky 2005-12-04 15:51:57 EST
Yes, you're right, it's because we don't allow common users to read memory
allocated by root. I'll take a look on it. It's caused by alsa-lib.
Comment 4 Martin Stransky 2005-12-08 04:11:06 EST
Could you please check the latest update (lib/utils) for FC4?
Comment 5 PvR 2005-12-08 12:48:44 EST
Nope, no change in behaviour.

[peter@dell bigcalm]$ rpm -qa | grep -i alsa
[peter@dell bigcalm]$ uname -a
Linux dell 2.6.14-1.1644_FC4 #1 Sun Nov 27 03:25:11 EST 2005 i686 i686 i386
Comment 6 Martin Stransky 2005-12-09 04:57:06 EST
You can specify the right for shared memory in your .asoundrc files. If you want
 to share memory between root and other users you have to set rights to 0666.
Here is an example of .asoundrc file:

pcm.!fixed {
   type plug slave {
        pcm "hw:2,0"
        rate 48000

pcm.!output {
	type dmix
	ipc_key 1234
	ipc_perm 0666
	slave {
		pcm "hw:2,0"
		period_time 0
		period_size 1024
		buffer_size 8192
		rate 48000

pcm.!default {
   type plug
   slave.pcm "output"
Comment 7 PvR 2005-12-12 13:45:53 EST
Yup, this fixes the problem! Thanks!

Note You need to log in before you can comment on or make changes to this bug.