Thanks for the udev info alet_roux but I'm having a little trouble with it. I have a Logitech 350 and I have it working as far as plugging in and unplugging the headset switches the symlink but I'm still only getting sound through my onboard sound card whether the headset is plugged in or not. You'll have to bear with me because I don't know much about alsa or udev but I'll try and give as much info as possible.
Code: Select all
deadboi@localhost ~ $ uname -a
Linux localhost 2.6.15-gentoo-r1 #9 SMP PREEMPT Thu Jun 22 11:16:05 MDT 2006 i686 AMD Athlon(tm) XP 2800+ GNU/Linux
Code: Select all
Device Drivers --->
Sound --->
<M> Sound card support
<M> Advanced Linux Sound Architecture
<M> Sequencer support
< > Sequencer dummy client
<M> OSS Mixer API
<M> OSS PCM (digital audio) API
[ ] OSS Sequencer API
[ ] Verbose printk
[ ] Debug
Generic devices --->
ISA devices --->
PCI devices --->
<M> Intel/SiS/nVidia/AMD/ALi AC97 Controller
USB devices --->
<M> USB Audio/MIDI driver
Code: Select all
deadboi@localhost ~ $ cat /proc/bus/usb/devices | grep snd-usb-audio
I: If#= 0 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=snd-usb-audio
I: If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
I: If#= 1 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
I: If#= 1 Alt= 2 #EPs= 1 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
I: If#= 2 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
I: If#= 2 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
Code: Select all
deadboi@localhost ~ $ cat /etc/modules.d/alsa
# Alsa 0.9.X kernel modules' configuration file.
# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsa-modules.conf-rc,v 1.4 2004/11/16 01:31:22 eradicator Exp $
# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore
##
## IMPORTANT:
## You need to customise this section for your specific sound card(s)
## and then run `update-modules' command.
## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
##
# ALSA portion
alias snd-card-0 snd-intel8x0
alias snd-card-1 snd-usb-audio
options snd-intel8x0 index=0
options snd-usb-audio index=1
## OSS/Free portion
alias sound-slot-0 snd-card-0
alias sound-slot-1 snd-card-1
# OSS/Free portion - card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
## OSS/Free portion - card #2
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-1 snd-seq-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-8 snd-seq-oss
alias sound-service-1-12 snd-pcm-oss
alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss
# Set this to the correct number of cards.
options snd cards_limit=2
Code: Select all
deadboi@localhost ~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: CK8 [NVidia CK8], device 0: Intel ICH [NVidia CK8]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: CK8 [NVidia CK8], device 1: Intel ICH - MIC ADC [NVidia CK8 - MIC ADC]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Headset [Logitech USB Headset], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
Code: Select all
deadboi@localhost ~ $ arecord -L
PCM list:
hw {
@args.0 CARD
@args.1 DEV
@args.2 SUBDEV
@args.CARD {
type string
default {
@func getenv
vars {
0 ALSA_PCM_CARD
1 ALSA_CARD
}
default {
@func refer
name 'defaults.pcm.card'
}
}
}
@args.DEV {
type integer
default {
@func igetenv
vars {
0 ALSA_PCM_DEVICE
}
default {
@func refer
name 'defaults.pcm.device'
}
}
}
@args.SUBDEV {
type integer
default {
@func refer
name 'defaults.pcm.subdevice'
}
}
type hw
card $CARD
device $DEV
subdevice $SUBDEV
}
plughw {
@args.0 CARD
@args.1 DEV
@args.2 SUBDEV
@args.CARD {
type string
default {
@func getenv
vars {
0 ALSA_PCM_CARD
1 ALSA_CARD
}
default {
@func refer
name 'defaults.pcm.card'
}
}
}
@args.DEV {
type integer
default {
@func igetenv
vars {
0 ALSA_PCM_DEVICE
}
default {
@func refer
name 'defaults.pcm.device'
}
}
}
@args.SUBDEV {
type integer
default {
@func refer
name 'defaults.pcm.subdevice'
}
}
type plug
slave.pcm {
type hw
card $CARD
device $DEV
subdevice $SUBDEV
}
}
plug {
@args.0 SLAVE
@args.SLAVE {
type string
}
type plug
slave.pcm $SLAVE
}
shm {
@args.0 SOCKET
@args.1 PCM
@args.SOCKET {
type string
}
@args.PCM {
type string
}
type shm
server $SOCKET
pcm $PCM
}
tee {
@args.0 SLAVE
@args.1 FILE
@args.2 FORMAT
@args.SLAVE {
type string
}
@args.FILE {
type string
}
@args.FORMAT {
type string
default raw
}
type file
slave.pcm $SLAVE
file $FILE
format $FORMAT
}
file {
@args.0 FILE
@args.1 FORMAT
@args.FILE {
type string
}
@args.FORMAT {
type string
default raw
}
type file
slave.pcm null
file $FILE
format $FORMAT
}
null {
type null
}
cards 'cards.pcm'
front 'cards.pcm.front'
rear 'cards.pcm.rear'
center_lfe 'cards.pcm.center_lfe'
side 'cards.pcm.side'
surround40 'cards.pcm.surround40'
surround41 'cards.pcm.surround41'
surround50 'cards.pcm.surround50'
surround51 'cards.pcm.surround51'
surround71 'cards.pcm.surround71'
iec958 'cards.pcm.iec958'
spdif 'cards.pcm.iec958'
modem 'cards.pcm.modem'
phoneline 'cards.pcm.phoneline'
default 'cards.pcm.default'
dmix 'cards.pcm.dmix'
dsnoop 'cards.pcm.dsnoop'
alet {
type plug
slave.pcm hw:1
}
Code: Select all
deadboi@localhost ~ $ cat /dev/urandom > /dev/dsp
produces static from the onboard speakers
Code: Select all
deadboi@localhost ~ $ cat /dev/urandom > /dev/dsp1
produces static from the headset
Code: Select all
deadboi@localhost ~ $ cat /etc/udev/rules.d/10-local.rules
#My headset
ACTION=="add", BUS=="usb", SYSFS{product}=="Logitech USB Headset", RUN+="/bin/ln -sf /etc/asound-headset /etc/asound.conf"
#ACTION=="remove", BUS=="usb", SYSFS{product}=="Logitech USB Headset", RUN+="/bin/ln -sf /etc/asound-onboard /etc/asound.conf"
ACTION=="remove", KERNEL=="audio1", RUN+="/bin/ln -sf /etc/asound-onboard /etc/asound.conf"
Code: Select all
deadboi@localhost ~ $ cat /etc/asound-headset
pcm.alet {
type plug
slave.pcm "hw:1"
}
Code: Select all
deadboi@localhost ~ $ cat /etc/asound-onboard
pcm.alet {
type plug
slave.pcm "hw:0"
Any help would be greatly appreciated.