defining sound card in xorg.conf

linux-service.be bvba guy at linux-service.be
Mon Jun 18 07:56:29 PDT 2012


start such script when user is logging in:

#!/bin/bash

# in order to match a screen-set to a pulseaudio sink :

if [ "$DISPLAY" ]
then
    if [ "$DISPLAY" = ":1" ]
    then
sleep 3
      pacmd "set-default-sink alsa_output.usb-0d8c_C-Media_USB_Headphone_Set-00-Set_1.analog-stereo"
pulseaudio -D
    fi
    if [ "$DISPLAY" = ":2" ]
    then
sleep 3
        pacmd "set-default-sink alsa_output.usb-0d8c_C-Media_USB_Headphone_Set-00-Set.analog-stereo"
pulseaudio -D
    fi
if [ "$DISPLAY" = ":3" ]
    then
sleep 3
        pacmd "set-default-sink alsa_output.usb-0d8c_C-Media_USB_Headphone_Set-00-Set_2.analog-stereo"
pulseaudio -D
    fi
fi


ofcourse edit script with your sound devices and find out where the sound is going to( at which display).
Make sure the user's /home/user/.pulse is empty upon login.
Enjoy
guy

> Hi,
> Actually it goes out of scope space of X.
> You should ask to sound system developers, how i can set default sound
> card according to my environment variables with multiple sound cards
> on board.
> 
> Here is little outdated link:
> http://perso.nnx.com/pludov/sessiond/
> 
> This tool will replace sound device files like /dev/dsp* with links to
> each sound card files
> depending of DISPLAY variable.
> 
> Aivils
> 
> Citējot "StompDagger1 at yahoo.com" <stompdagger1 at yahoo.com>:
> > Hello,
> > 
> > Thanks for the replay but I'm not sure how this answers my question.
> > using xorg I can "seats", e.g. xorg will run a session limited to a
> > specific combination of gpu, screen, keyboard and mouse.
> > I just want to add sound card to it.
> > 
> >  
> > An wise Scandinavian old man once said: "in the end, everything is
> > going to be alright"
> > 
> > 
> > ________________________________
> > 
> >  From: Giuseppe Penone <giuspen at gmail.com>
> > 
> > To: "StompDagger1 at yahoo.com" <stompdagger1 at yahoo.com>
> > Cc: "xorg at lists.freedesktop.org" <xorg at lists.freedesktop.org>
> > Sent: Monday, June 18, 2012 9:31 AM
> > Subject: Re: defining sound card in xorg.conf
> > 
> > 
> > for usb audio cards there's a good explanation here
> > https://help.ubuntu.com/community/UbuntuStudio/UsbAudioDevices
> > 
> > anyway to make it simple:
> > 
> > 1) check that your system recognized the usb audio:
> > cat/proc/asound/cards
> > 
> > 2) set the desired card as default used:
> > sudo nano  /etc/modprobe.d/alsa-base
> > go to the bottom and change the index of the default card from -2 to 0
> > 
> > cheers.
> > 
> > 
> > 
> > 
> > 
> > On Sat, Jun 16, 2012 at 10:54 PM, StompDagger1 at yahoo.com
> > <stompdagger1 at yahoo.com> wrote:
> > 
> > Hello All,
> > 
> >> I'm about to reinstate my 3 way multiseat configuration (2 seats
> >> and one for the tv), up until now I didn't used the sound cards but
> >> now as I got a usb sound card I want to add sound support.
> >> 
> >> 
> >> is there a way to define in xorg.conf what sound card will be used
> >> by what seat?
> >> 
> >> 
> >> Thanks.
> >> 
> >>  
> >> An wise Scandinavian old man once said: "in the end, everything is
> >> going to be alright"
> >> _______________________________________________
> >> xorg at lists.x.org: X.Org support
> >> Archives: http://lists.freedesktop.org/archives/xorg
> >> Info: http://lists.x.org/mailman/listinfo/xorg
> >> Your subscription address: giuspen at gmail.com
> > 
> > _______________________________________________
> > xorg at lists.x.org: X.Org support
> > Archives: http://lists.freedesktop.org/archives/xorg
> > Info: http://lists.x.org/mailman/listinfo/xorg
> > Your subscription address: stompdagger1 at yahoo.com
> 
> _______________________________________________
> xorg at lists.x.org: X.Org support
> Archives: http://lists.freedesktop.org/archives/xorg
> Info: http://lists.x.org/mailman/listinfo/xorg
> Your subscription address: guy at linux-service.be



More information about the xorg mailing list