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:
Created attachment 121774 [details] asoundrc containing default device
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.
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.
Could you please check the latest update (lib/utils) for FC4?
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
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" }
Yup, this fixes the problem! Thanks!