LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 06-22-2004, 10:41 AM   #1
nitrambass
LQ Newbie
 
Registered: Jun 2004
Location: France, near Disney, east of Paris
Distribution: Mandrake 9.2
Posts: 6

Rep: Reputation: 0
sharing sound in multiple sessions


First session get loverly sound. Second et al get the "can't access sound - continuing with null" message.

How do I stop that and have all sessions able to use the sound server?
 
Old 06-22-2004, 02:14 PM   #2
EricEarl
Member
 
Registered: Jun 2004
Location: Victoria BC Canada
Distribution: Suse 9.2-10.0 RH 6.1 ubuntu 8.10 Mint 6
Posts: 33

Rep: Reputation: 15
sharing sound

Because Linux is a multi-user system there are some things on the system that can't be shared such as the sound system. Once a user opens XMMS or mplayer that uses the sound devices there has to be a way to prevent others from interfering with that user's music. What happens is the devices change ownership/permission to the first user that gets it. This prevents others from running more than one music selection through the sound system. How do you get it back so that others can use it is up to the root user. I wrote a script that does just that so that my wife and I can hear music though not at the same time. We do have to take turns. This script is constructed by root and I keep it in his home /root for now. It is simple and I call it fixsound. All the action takes place in the /dev directory and essentially changes the ownership and permissions of the sound devices back to root. The fuser program is used to clobber any process that has tied up the device which occasionally happens. From here another session should be able to use the sound device as the new user will take possession of the dsp device. xmms may have to be reset to remove the null value but of that I am not sure. Make sure fixsound is executable: chmod 755 fixsound (the octal method) then type its name as root.


:
## this is called fixsound to bring the sound devices back for others to use
cd /dev
chown root dsp* aud* sound sound/*
chmod 777 dsp* aud* sound sound/*
/sbin/fuser -k /dev/dsp
cd
 
Old 06-22-2004, 02:38 PM   #3
nitrambass
LQ Newbie
 
Registered: Jun 2004
Location: France, near Disney, east of Paris
Distribution: Mandrake 9.2
Posts: 6

Original Poster
Rep: Reputation: 0
AHAAA. Thanks for the clue!!

It CAN be done - Mandrake sets the sound devices up in group audio. So, add all your users to group audio, make the device permissions 770 and voila - all sessions have access to the sound card no matter which one gets the ownership first

Thanks
 
Old 06-22-2004, 04:16 PM   #4
EricEarl
Member
 
Registered: Jun 2004
Location: Victoria BC Canada
Distribution: Suse 9.2-10.0 RH 6.1 ubuntu 8.10 Mint 6
Posts: 33

Rep: Reputation: 15
I think I tried that before but I will try your suggestion again. The problem is ownership excludes the group as in the case of my wife now:
drwxrwxrwx 1 root root 0 Jun 21 12:25 ataraid/
crw------- 1 bevearl audio 14, 4 Dec 31 1969 audio
drwxrwxrwx 1 root root 0 Jun 21 12:25 cciss/
crw------- 1 bevearl audio 14, 3 Dec 31 1969 dsp
crw------- 1 bevearl audio 14, 5 Dec 31 1969 dspW
crw------- 1 bevearl audio 14, 0 Dec 31 1969 mixer
crw------- 1 bevearl audio 14, 1 Dec 31 1969 sequencer
crw------- 1 bevearl audio 14, 8 Dec 31 1969 sequencer2
only root can wrest the ownership from her. I have been wrong before though. You can see that she is already part of the audio group as I myself am. Still need the script though maybe all I need to do is change the permission and not the ownership. fuser is still needed though as some sound apps don't release the device properly.
 
Old 06-23-2004, 01:06 PM   #5
nitrambass
LQ Newbie
 
Registered: Jun 2004
Location: France, near Disney, east of Paris
Distribution: Mandrake 9.2
Posts: 6

Original Poster
Rep: Reputation: 0
Actually, its the 'TakeConsole' and 'GiveConsole' actions at the end and beginning of the first session that reassigns the audio. The permissions that are used are found in /etc/security/console.perms - just change the default 600 for sound to 660, add yourself and your wife to the audio group and voila!

Well ALMOST voila - the /usr/bin/soundwrapper script that re-routes xmms etc through artsd will crash in the second session that is started. So either start xmms directly, or change /usr/bin/soundwrapper to look like this:

Code:
if [ -O "/dev/sound/dsp" ] ; then
	if [ `/sbin/pidof -s artsd` ] ; then
		artsdsp "$@"
	else
		if [ `/sbin/pidof -s esd` ]; then
			esddsp "$@"
		else
			"$@"
		fi
	fi
else
	"$@"
fi
which starts the sound app directly in all sessions but the owner of the sound devices.

Last edited by nitrambass; 06-23-2004 at 01:10 PM.
 
Old 06-23-2004, 05:19 PM   #6
EricEarl
Member
 
Registered: Jun 2004
Location: Victoria BC Canada
Distribution: Suse 9.2-10.0 RH 6.1 ubuntu 8.10 Mint 6
Posts: 33

Rep: Reputation: 15
Thank you very much. It is a bit of a bother to always run fixsound so I will try your suggestion. My wife is at a loss when it comes to this so if I can make it simple for her then that will be wonderful.

I am working on another computer (Duron 1M) to get Mandrake 10 up and running but my mouse doesn't work yet. I have a couple of suggestions about the kernel 2.6.3 that I am going to follow. Build some missed modules might do or revert back to 2.4.##.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sharing remote X sessions? Thinking Linux - Networking 2 11-27-2005 12:27 PM
Sound in multiple sessions LinuxConvert-06/05 Linux - Newbie 1 07-20-2005 12:00 PM
Multiple Sessions? ttague Linux - Newbie 4 01-02-2005 10:00 AM
Multiple X sessions tw001_tw Slackware 9 05-31-2004 12:35 PM
Multiple X sessions gluon Linux - General 1 09-29-2001 10:20 PM


All times are GMT -5. The time now is 11:01 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration