You are not logged in.

#1 2009-05-04 03:08:13

camphor
Member
Registered: 2009-03-01
Posts: 32

USB headphones and ALSA (.asoundrc)

Since the audio in jack on my older laptop is broken, I've bought a stereo to USB adapter so I can keep using my trusty Sennheisers. Everything does work with enough workarounds, but I'm running into trouble setting it as my default playback device. It's not an issue with the hardware itself, as I'm able to get into a mixer and even run mplayer using the device, but only through some  terminal options.

To run mplayer:

mplayer -ao alsa:device=hw=1.0

alsamixer:

alsamixer -c 1

(It's interesting to note that in the mixer there is no PCM column.)

If possible, I'd like all of the USB adapter's and these headphones' channels to be available to use. Normally I've just been testing the front speakers as it's been easiest. I easily achieved all of this through OSS, but it frequently lags Mplayer and my videos, which is what I generally use this laptop for, and is not as practical as I find ALSA to be. That is, when it works..

aplay -L output:

default:CARD=NVidia
    HDA NVidia, CONEXANT Analog
    Default Audio Device
front:CARD=NVidia,DEV=0
    HDA NVidia, CONEXANT Analog
    Front speakers
surround40:CARD=NVidia,DEV=0
    HDA NVidia, CONEXANT Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=NVidia,DEV=0
    HDA NVidia, CONEXANT Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=NVidia,DEV=0
    HDA NVidia, CONEXANT Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=NVidia,DEV=0
    HDA NVidia, CONEXANT Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=NVidia,DEV=0
    HDA NVidia, CONEXANT Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=NVidia,DEV=0
    HDA NVidia, Conexant Digital
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, NVIDIA HDMI
    HDMI Audio Output
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=Device
    USB Audio Device, USB Audio
    Default Audio Device
front:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    Front speakers
surround40:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Device,DEV=0
    USB Audio Device, USB Audio
    IEC958 (S/PDIF) Digital Audio Output

Obviously the card named Device is the one I'd like to be using in this case. So I guess my question is, how do I craft a .asoundrc that uses these by default? I've never needed one before and am unsure where to start. I've followed several suggestions on these forums, the ALSA wiki, and the ArchWiki to no avail. Also, alsaconf does not detect the card, but it's properly registered everywhere else.

This is the .asoundrc I've come up with so far, which hasn't been working.

pcm.!default {
type hw
card 1
device 0
}

ctl.!default {
type hw
card 1
device 0
}

Playback will be through the speakers as usual, and an snd_ctl_open error appears when trying to run alsamixer. snd-usb-audio is being loaded at boot, but is there a pcm module that needs to be loaded as well?

Hope I've provided enough information, and sorry for yet another question.. sad

Last edited by camphor (2009-05-04 03:10:45)

Offline

Board footer

Powered by FluxBB