LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-25-2007, 02:55 AM   #1
usernamenumber
Member
 
Registered: Sep 2003
Location: Somerville, MA
Distribution: Fedora/RHEL currently. Red Hat, Slackware, Debian, SuSe and Mandrake at other times
Posts: 104

Rep: Reputation: 15
Sharing sound between users (Fedora 8)


Hi folks,

I have a Fedora 8 system where I want multiple users to be able to be logged in and able to access the sound card simultaneously. For example, if I log in as user foo at the local console, then ssh in as user bar, any attempt to run commands like "play sound.wav" results in an error like this:

Code:
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:3510:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:3510:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:3510:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib conf.c:3982:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2145:(snd_pcm_open_noupdate) Unknown PCM default
play stio: Failed writing default: cannot open audio device
strace shows this to be the result of the app getting permission denied when it tries to access /dev/snd/controlC0. I figured that it must be owned by the first user, foo, probably thanks to pam_console or the like, and that all I'd need to do is configure the system to grant all members of a given group rw access to the file by default.

However, upon investigation I find that this file, like everything else in /dev/snd/ is owned by root:root, so there must be more to this. I did an strace on foo successfully running play, and it shows that after controlC0 is accessed, /dev/snd/pcmC0D0p is used for the actual work, but again, everything in /dev/snd/ is root:root, so I can't figure out why foo is able to use it, let alone how to give that kind of access to bar.

If anyone can assist me with this, I will really appreciate it.
 
Old 12-25-2007, 03:33 AM   #2
elliott678
Member
 
Registered: Mar 2005
Location: North Carolina
Distribution: Arch
Posts: 977

Rep: Reputation: 74
Does Fedora use dmix? If so something like this in your asound.conf might help, depending on you system config some changes may need to be made:
Code:
pcm.dmixer { 
    type dmix 
    ipc_key 1024
    ipc_key_add_uid false
    ipc_perm 0666			# mixing for all users
    slave { 
        pcm "hw:0,0" 
        period_time 0 
        period_size 1024 
        buffer_size 8192
        rate 44100
    }
    bindings { 
        0 0 
        1 1 
    } 
}

pcm.dsp0 { 
    type plug 
    slave.pcm "dmixer" 
} 

pcm.!default { 
    type plug 
    slave.pcm "dmixer" 
} 

pcm.default { 
   type plug 
   slave.pcm "dmixer" 
} 

ctl.mixer0 { 
    type hw 
    card 0 
}
I had to do this to allow MPD, which is runs under its own user, to work and mix while running under my user.

Last edited by elliott678; 12-25-2007 at 03:34 AM.
 
Old 12-27-2007, 08:23 AM   #3
usernamenumber
Member
 
Registered: Sep 2003
Location: Somerville, MA
Distribution: Fedora/RHEL currently. Red Hat, Slackware, Debian, SuSe and Mandrake at other times
Posts: 104

Original Poster
Rep: Reputation: 15
Thanks, but the solution turned out to be even simpler. Linking to it here for others' reference.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to setup FTP users only users on LInux Fedora Soujiro Linux - Newbie 8 09-13-2010 07:34 AM
sharing users between several machines coal-fire-ice Linux - Security 3 08-24-2007 02:18 AM
Files sharing between users on same computer Artik Linux - Security 5 07-13-2005 02:23 PM
Sharing USB devices between users sleepkreep Linux - Software 1 07-01-2005 09:26 PM
Sharing your printer to Vendow$ Users ikw38 Linux - Newbie 0 12-28-2002 08:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration