openSUSE Forums > Hardware » Only one user has sound?

Go Back   openSUSE Forums > Hardware
Forums FAQ Members List Search Today's Posts Mark Forums Read


Hardware Questions about drivers, peripheral cabling, configuration

Reply
Page 2 of 3 1 2 3
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 13-Feb-2009, 02:40
Puzzled Penguin
 
Join Date: Feb 2009
Location: Finland
Posts: 13
ughi hasn't been rated much yet
Send a message via Skype™ to ughi
Default Re: Only one user has sound?

Quote:
Originally Posted by oldcpu View Post
Thats true. ....

ughi, is that what you are trying to do ?
Not exactly, if I understood correctly...

I have one PC that everyone in the family is using. Almost always sessions are left open, mainly because we use pc as netradio. And usually radio is left on as background "noise".

Now, when "new" user logs in there might be someone already logged in and using netradio software and thus their sound can be heard with every user.

What if this user just logged in wants to hear another station while doing his own thing in the pc or want to watch video or something else requiring audio? Now the radio from the other user distracts active user.

So, I am looking for a way to not hear the possible other sound sources from the background users.
Reply With Quote
  #12 (permalink)  
Old 13-Feb-2009, 09:23
Student Penguin
 
Join Date: Feb 2009
Location: London Ontario Canada
Posts: 75
RCCrouch hasn't been rated much yet
Default Re: Only one user has sound?

Now I'm not totally sure, but the problem may lie in the fact that we now use "udev". So I'm wondering if there might be a way to solve this through the use of the udev configuration files. If I have time I'll look at them.
Reply With Quote
  #13 (permalink)  
Old 13-Feb-2009, 09:42
Student Penguin
 
Join Date: Feb 2009
Location: London Ontario Canada
Posts: 75
RCCrouch hasn't been rated much yet
Default Re: Only one user has sound?

I think I have the answer. The configuration file for alsa is /etc/asound.state. This is a global system file. Therefore all users use the same alsa config. To get around this copy this file to your home directory and rename it .asoundrc. Then edit this file in each users home directory and assign unique device names for all devices in the file for that user. If you use a unique naming scheme for the devices and they are unique only to each individual user, then access to the devices by all users should be preserved without all users being able to hear each others audio.

I'll be sure to test this over the weekend on my own system and report my findings.
Reply With Quote
  #14 (permalink)  
Old 13-Feb-2009, 09:55
Puzzled Penguin
 
Join Date: Feb 2009
Location: Finland
Posts: 13
ughi hasn't been rated much yet
Send a message via Skype™ to ughi
Default Re: Only one user has sound?

In the .asoundrc I now have something like this
---------clip---------
state.Intel {
control.1 {
comment.access 'read write'
comment.type INTEGER
comment.count 2
comment.range '0 - 31'
comment.dbmin -4650
comment.dbmax 0
iface MIXER
name 'Front Playback Volume'
value.0 31
value.1 31
}
--------clip---------

and there are many like this, ending in control.34 and then two for the microphone.

So, You think that changing names in all of these might help?

Is there still some tweaking in the sound softwares, or will this naming do the trick?
Reply With Quote
  #15 (permalink)  
Old 13-Feb-2009, 09:57
Student Penguin
 
Join Date: Feb 2009
Location: London Ontario Canada
Posts: 75
RCCrouch hasn't been rated much yet
Default Re: Only one user has sound?

Give me a chance to work on it first. I'll let you know what I discover by Monday.
Reply With Quote
  #16 (permalink)  
Old 13-Feb-2009, 21:51
Student Penguin
 
Join Date: Feb 2009
Location: London Ontario Canada
Posts: 75
RCCrouch hasn't been rated much yet
Default Re: Only one user has sound?

Here is your answer ughi.

After trying several different methods to relinquish audio control from one user to the next, I have come to the conclusion that there is only one viable alternative. That would be to pause the other users process. It's an ugly solution but it does work rather well.

First, after you log in and discover that another user has audio running, open a terminal and enter the command "ps -ax". This will give you a list of all processes with their PID number shown in the left column. Find the PID number attached to the process you want to pause. Now in order to pause the process you must be able to execute commands as root either by way of "su" which isn't very secure, or by way of the "sudo" facility which is more secure in that you can specify what commands the user can run. In this case it is the "kill" command. The command to pause the process is "kill -STOP "pid-number", to restart the process the command is "kill -CONT "pid-number". Don't get confused here, stop does not totally kill the process, it only pauses it. If you give this a try on an audio file you are playing you will notice that when you restart the process it picks back up at the same point it was when paused, just like the pause button on an audio app like AmaroK.

As I say it's an ugly solution but it does work.
Reply With Quote
  #17 (permalink)  
Old 14-Feb-2009, 03:13
Puzzled Penguin
 
Join Date: Feb 2009
Location: Finland
Posts: 13
ughi hasn't been rated much yet
Send a message via Skype™ to ughi
Default Re: Only one user has sound?

So, the re-naming did not work?


At the moment, in the ps list, there is a netradio running in the background in the firefox plugin. I am guessing that the ones with lower PID are those of the other user. Pausing them did not mute.

Since, I have some knowledge of computers, I might assume that I find what process(es) to pause. But even I don't, so I think it impossible to assume that other users will find it.


I wonder how this is done in the other distros (ie. Fedora) since in there only the active user has audio by default.

Last edited by ughi; 14-Feb-2009 at 03:16. Reason: typo
Reply With Quote
  #18 (permalink)  
Old 14-Feb-2009, 08:33
Student Penguin
 
Join Date: Feb 2009
Location: London Ontario Canada
Posts: 75
RCCrouch hasn't been rated much yet
Default Re: Only one user has sound?

Ok! Sorry ughi I gave you the wrong ps command. The one I gave you does not list the owner of the process. Modify that to "ps -aux". Now you will get the owner of the process in the left hand column with the "pid" number in the next column to the right. That should help you identify the exact process you want to pause. The one thing I did try because it used to be the default, was to assign permissions of 0600 instead of 0660 for the audio devices (doesn't work).
Reply With Quote
  #19 (permalink)  
Old 14-Feb-2009, 09:32
Puzzled Penguin
 
Join Date: Feb 2009
Location: Finland
Posts: 13
ughi hasn't been rated much yet
Send a message via Skype™ to ughi
Default Re: Only one user has sound?

I am sure that this info gives me a possibility to mute others while I am logged in, but...
...for this to be final solution to others using this pc, I am not so convinced.

At least, if there were some kind of script to be made. But, I am 99.999% sure that some of the users will not find the PID, no matter how I try to teach how to find it.

I am capable of otherwise doing it (the script that is) my self, but for now I don't have a clue how to find that correct PID(s) automatically. And they could be found, then adding that script to log in procedure should mute others.
Reply With Quote
  #20 (permalink)  
Old 14-Feb-2009, 10:54
Puzzled Penguin
 
Join Date: Feb 2009
Location: Finland
Posts: 13
ughi hasn't been rated much yet
Send a message via Skype™ to ughi
Default Re: Only one user has sound?

This is what I come up with so far:

ps -ef | grep 'vlc' | grep '<user>' | awk '{ print $2 }'


This gives me pid from <user> with vlc in them.

When firefox is used, then it is a bit harder. List is longer.
Sure, I could stop them all, though it is bit hard

Now, my knowledge ends. How do I add those pids I found to 'kill -stop' command.
Preferably in the same line, without any copy/paste.
Reply With Quote
Reply
Page 2 of 3 1 2 3

Bookmarks


Thread Tools
Display Modes

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




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2