Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I need to write a default mic and default speaker output in the asound.conf config file. But I don't know exactly how I can find my external sound card or microphone device's name, so that on reboot or unplug/plug I don't have to reconfigure it again.

I tried to find them by using:

sun@sun-To-be-filled-by-O-E-M:/tmp$ pacmd dump | grep alsa_input
set-source-volume alsa_input.pci-0000_00_1b.0.analog-stereo 0xddb
set-source-mute alsa_input.pci-0000_00_1b.0.analog-stereo no
suspend-source alsa_input.pci-0000_00_1b.0.analog-stereo yes
set-source-volume alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono 0x9091
set-source-mute alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono no
suspend-source alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono yes
set-source-volume alsa_input.usb-046d_HD_Pro_Webcam_C920_8E9E4FCF-02-C920.analog-stereo 0xfffe
set-source-mute alsa_input.usb-046d_HD_Pro_Webcam_C920_8E9E4FCF-02-C920.analog-stereo no
suspend-source alsa_input.usb-046d_HD_Pro_Webcam_C920_8E9E4FCF-02-C920.analog-stereo yes
set-default-source alsa_input.usb-046d_HD_Pro_Webcam_C920_8E9E4FCF-02-C920.analog-stereo

or:

sun@sun-To-be-filled-by-O-E-M:/tmp$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Device [C-Media USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

But it confused me. Which one is the name that I have to use when doing sudo vim /etc/asound.conf?

From the information given above this device is my microphone:

card 2: Device [C-Media USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

And from the above information this device is my audio output:

card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

How can I tell this in my /etc/asound.conf? I tried the following but it does not work:

pcm.usb
{
    type hw
    card C-Media USB Audio Device
}
pcm.!default
{
    type asym
    playback.pcm
    {
        type plug
        slave.pcm "dmix"
    }
    capture.pcm
    {
        type plug
        slave.pcm "usb"
    }
}
share|improve this question

1 Answer 1

up vote 3 down vote accepted

If I understand correctly, you want playback on your build in sondcard and capture (microphone) from external USB device.

Your external device is listed as card 2: device 0 and your build in soundcard as card 0: device 0

I think your asound.conf should look something like this:

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

  playback.capture
  {
    type hw
    card 2
    device 0
  }
}
share|improve this answer
1  
Did some Googleing and found this page on alsa-project.org. Try something like plug:default:C-Media USB Audio Device for the USB device and plug:default:HDA Intel PCH for the build in device. –  AcId May 21 '13 at 9:51
    
in that case card and device lines should be removed by adding those lines right? –  YumYumYum May 21 '13 at 10:03
    
@YumYumYum I think so, but I'm not entirely sure. –  AcId May 21 '13 at 10:05
    
It says invalid file: sun@sun-To-be-filled-by-O-E-M:~$ alsamixer ALSA lib conf.c:1686:(snd_config_load1) toplevel:24:4:Unexpected char ALSA lib conf.c:3406:(config_file_open) /etc/asound.conf may be old or corrupted: consider to remove or fix it –  YumYumYum May 21 '13 at 10:06
1  
Maybe this could be of some help. It talks about asound.conf and naming of devices. –  AcId May 21 '13 at 11:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.