Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting Up a User to Use a Particular Sound Card
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
papal_authority
Veteran
Veteran


Joined: 31 Mar 2004
Posts: 1823
Location: Canada

PostPosted: Mon Nov 20, 2006 5:32 am    Post subject: Setting Up a User to Use a Particular Sound Card Reply with quote

Setting Up a User to Use a Particular Sound Card

This deals with a box having multiple sound cards and running ALSA and gstreamer. It shows how to set up a user to use a particular sound card. The information on how to do this seems remarkably well hidden and it took a fair amount of searching and reading old mailing lists. Hopefully this will save someone else some time.

In my situation, I had a box with two SoundBlaster Live! cards and wanted each of the two users to have their own sound card. There's basically two parts, configuring ALSA and configuring gstreamer, which is what most GNOME apps use for their audio. Of course this information can be used to allow different apps to use different cards.

STEP 1 Login as the user you wish to edit.

STEP 2 % cat /proc/asound/cards
- note the number at the beginning of each line returned, we will use those numbers

STEP 3 % vi $HOME/.asoundrc
- create a file like the following (this user is using the second card which is numbered 1)
Code:
       # --------------------------------------------------------
       # use the first device on the second sound card as default
       # --------------------------------------------------------
       pcm.!default {
         type hw
         card 1
         device 0
       }


STEP 4 % aplay /some/wavfile.wav
- this should play through the sound card you chose

STEP 5 % gstreamer-properties
- under "Default Output Plugin", change the "Output" to "Custom"
- change "Pipeline" to: alsasink -device=hw:1
- click "Test", this should play through the second card

STEP 6 % gconftool-2 --type string --set /system/gstreamer/0.10/default/audiosink "alsasink -device=hw:1"
- the generic audio device

STEP 7 % gconftool-2 --type string --set /system/gstreamer/0.10/default/chataudiosink "alsasink -device=hw:1"
- the chat device

STEP 8 % gconftool-2 --type string --set /system/gstreamer/0.10/default/musicaudiosink "alsasink -device=hw:1"
- the music device

STEP 9 % gconftool-2 --type string --set /system/gstreamer/0.8/default/audiosink "alsasink -device=hw:1"
- this one is necessary for rhythmbox which uses gstreamer 0.8

Now you can repeat this for other users, using a different device number (highlighted in red) in steps 3,5,6,7,8 and 9.
_________________
The free market gave me gonorrhea.
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Mon Nov 20, 2006 9:54 pm    Post subject: Reply with quote

Thanks, I've been looking for something like this for a while!
One question though, does the 5, 6, 7, 8 and 9 steps really necessary? cause it just looks like a gnome stuff only ?
_________________
The End of the Internet!
Back to top
View user's profile Send private message
papal_authority
Veteran
Veteran


Joined: 31 Mar 2004
Posts: 1823
Location: Canada

PostPosted: Tue Nov 21, 2006 3:14 am    Post subject: Reply with quote

truc wrote:
Thanks, I've been looking for something like this for a while!
One question though, does the 5, 6, 7, 8 and 9 steps really necessary? cause it just looks like a gnome stuff only ?

Well it's anything that uses GStreamer as a backend for multimedia. Currently most GNOME apps do (e.g. Totem, Rhythmbox and Banshee), but even some big name KDE apps use GStreamer (e.g. JuK, Kaffeine and Amarok*).

*I've heard in the latest release, Amarok does not though.
_________________
The free market gave me gonorrhea.
Back to top
View user's profile Send private message
monolit
n00b
n00b


Joined: 29 Jan 2004
Posts: 64
Location: Paris/Texas

PostPosted: Fri Dec 29, 2006 12:18 am    Post subject: Reply with quote

Just for your info :)

I couldn't get sound from my second soundcard and I did the first four step( step 4 just being a test ). $ gstreamer-properties ( Multimedia Systems Selector from System->Preferences menu for Gnome ) was set to Autodetect( other controls were set for the heart of the sun :) and I got sound. I skipped the rest of the list, for at least now :)

Thanks papal_authority ;)
_________________
*SB*
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum