Bug 174848

Summary: alsa fails to create IPC message queue since upgrade to 2.6.14 series
Product: [Fedora] Fedora Reporter: PvR <thenephilim13>
Component: alsa-libAssignee: Martin Stransky <stransky>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: netllama
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-12-13 09:14:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
asoundrc containing default device none

Description PvR 2005-12-02 18:45:06 UTC
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:
Sometimes

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

  

Additional info:

Comment 1 PvR 2005-12-02 18:46:33 UTC
Created attachment 121774 [details]
asoundrc containing default device

Comment 2 PvR 2005-12-02 18:52:33 UTC
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 20:51:57 UTC
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 09:11:06 UTC
Could you please check the latest update (lib/utils) for FC4?

Comment 5 PvR 2005-12-08 17:48:44 UTC
Nope, no change in behaviour.

[peter@dell bigcalm]$ rpm -qa | grep -i alsa
alsa-lib-1.0.10-2.FC4
alsa-utils-1.0.10-1.FC4
alsa-lib-devel-1.0.10-2.FC4
[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
GNU/Linux


Comment 6 Martin Stransky 2005-12-09 09:57:06 UTC
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 18:45:53 UTC
Yup, this fixes the problem! Thanks!