matrixhax0r n00b
Joined: 23 Jun 2004 Posts: 63
|
Posted: Sun Jul 10, 2005 1:44 am Post subject: Questions about ALSA + ESD + USB soundcard |
|
|
Okay, I have a laptop with the built-in onboard sound and a Audigy 2 NX.
The audigy 2 NX is a remable USB sound "card". Now, I can play sound out of both of these. However, applications using gstreamer or esd have really annoying issues. To give you an idea here's my /etc/asound.conf file:
Code: | ##################################################
#### Bind audio devices
##################################################
## Here we make a define our default soundcard
pcm.usb-audio {
type hw
card 1
device 0
}
## Up mix the rate
pcm.hard-audio {
type rate
slave.pcm "usb-audio"
slave {
rate 48000
}
}
## Here we make a define our default soundcard
pcm.intel-audio {
type hw
card 0
device 0
}
## Add dmixer to the soundcard
pcm.dmixer {
type dmix
ipc_key 1024
ipc_perm 0660 # Allow for this group
slave.pcm "intel-audio"
slave {
# Fix latency issues
period_time 0
period_size 1024
buffer_size 8192
}
bindings {
0 0
1 1
}
}
## Allow reading from sound card
pcm.dsnooper {
type dsnoop
ipc_key 2048
slave.pcm "intel-audio"
bindings {
0 0
1 1
}
}
## Create our full duplex device
pcm.soft-audio {
type asym
playback.pcm "dmixer"
capture.pcm "dsnooper"
}
##################################################
##### Additional Configuration
##################################################
## Change rate and set default device
pcm.!default {
type plug
slave.pcm "hard-audio"
}
##################################################
#### OSS Configuration
##################################################
# OSS dsp0
pcm.dsp0 {
type plug
slave.pcm "dmixer"
}
# OSS control for dsp0 (New OSS)
ctl.dsp0 {
type plug
slave.pcm "intel-audio"
}
# OSS control for dsp0 (Old OSS)
ctl.mixer0 {
type plug
slave.pcm "intel-audio"
}
|
As you can see, the top section has created a device "soft-audio" that's my on board audio and a device "hard-audio" which is my removable soundcard.
The onboard one needs dmix while the removable one needs to be resampled.
Mplayer:
I can tell it to use either default, hard-audio, or soft-audio and everything is happy.
Gstreamer:
If I tell gstreamer to use ALSA and set the default to soft-audio, things are fine. However, if I set the default to hard-audio gstreamer apps will crash or give an error. BTW, how do I set what device gstreamer uses for ALSA?
ESD:
If I tell gstreamer to use ESD set /etc/esd/esd.conf to soft-audio, it works as I would excpet. However, if I set it to default (hard-audio), ESD uses usb-audio (hw:1).
So basicly to summarize
Code: |
System Card Status
ALSA onboard working
removable working
gstreamer + ALSA onboard working
removable apps crash/error
gstreamer + ESD onboard working
removable use wrong device
|
Another questions is, can I set the default to go back to the onboard sound if my audigy is unplugged? I mean, I guess I could whip up some scripts to sweap asound.conf, but I was wondering if I can do it right in the configuration.
Thanks for any help.... _________________ We are Pentium of Borg. Division is futile. You will be approximated. |
|