пятница, 30 марта 2012 г.

Sound Blaster Connect Hi-Fi USB + Linux

This will be interesting for those who want to buy an external sound card but not sure if it will work with Linux. Official ALSA site lacks this information, so I will try to fulfil it. Short answer - YES, Sound Blaster Connect Hi-Fi USB (SB1260) works with Linux, at least with Ubuntu 11 with PulseAudio server.

There are three main reasons for buying an external audio card:
  • Internal sound card of your laptop had fried
  • Your laptop lacks Line-In connector (this was the reason for me)
  • Sound quality or set or features of your internal sound card doesn't satisfy you
Here is minimal background required for further explanations: recent Linux kernels have built-in support for USB audio devices (snd-usb-audio kernel module), ALSA (Advanced Linux Sound Architecture) system is used to orchestrate all sound devices at low level. Morden Linux distributions come with audio server software, e.g. PulseAudio. PulseAudio acts as an audio dispatcher/router/manager between applications and ALSA system. It can do a lot of cool features, that would be difficult with bare ALSA.

As for playback, SB1260 started to work out-of-box: you just need to plug the card and change active output device in "Sound settings" menu (right click on the speaker icon in the tray in my distro). Line-In recording was a little more tricky. I've tried to select an active input device (in neighbour tab) and adjust record level but with no luck. The only thing I was able to record is a silence. After 3 evenings of experimenting with the %subj% I came up with a brilliant idea: use low-level alsamixer program to check & adjust recording level and ... it worked! Record level was at 0% and PulseAudio's mixer didn't change that.

I hope this will save 3 evening of your life!

UPDATE: Also I had to switch Capture Source from 'mic' to 'line-in' in alsamixer. Unfortunately doing the same thing using PulseAudio's front-end didn't help.

2 комментария:

  1. I have this device, USB ID 041e:30d8, and I can't get it to receive line-in sound in Debian. All I can get is silence. I have tried what you suggested but it makes no difference. Is your device the same or do we have different versions of the same device?

  2. Yes, I have the same device. Here is an excerpt from dmesg:

    [16626.532129] usb 2-2: new full-speed USB device number 2 using uhci_hcd
    [16627.033977] usbcore: registered new interface driver snd-usb-audio
    [16627.040396] input: C-Media Electronics Inc. SB Easy Record/SB Connect Hi-Fi as /devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.3/input/input11
    [16627.040933] generic-usb 0003:041E:30D8.0001: input,hidraw0: USB HID v1.00 Device [C-Media Electronics Inc. SB Easy Record/SB Connect Hi-Fi] on usb-0000:00:1d.0-2/input3
    [16627.041016] usbcore: registered new interface driver usbhid
    [16627.041024] usbhid: USB HID core driver

    My kernel version: 3.2.0-34-generic

    And here is my lsmod:

    lsmod | fgrep snd
    snd_usb_audio 101566 2
    snd_usbmidi_lib 24603 1 snd_usb_audio
    snd_hda_codec_realtek 174313 1
    snd_hda_intel 32765 3
    snd_hda_codec 109562 2 snd_hda_codec_realtek,snd_hda_intel
    snd_hwdep 13276 2 snd_usb_audio,snd_hda_codec
    snd_pcm 80845 3 snd_usb_audio,snd_hda_intel,snd_hda_codec
    snd_seq_midi 13132 0
    snd_rawmidi 25424 2 snd_usbmidi_lib,snd_seq_midi
    snd_seq_midi_event 14475 1 snd_seq_midi
    snd_seq 51567 2 snd_seq_midi,snd_seq_midi_event
    snd_timer 28931 2 snd_pcm,snd_seq
    snd_seq_device 14172 3 snd_seq_midi,snd_rawmidi,snd_seq
    snd 62064 21 snd_usb_audio,snd_usbmidi_lib,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
    soundcore 14635 1 snd
    snd_page_alloc 14115 2 snd_hda_intel,snd_pcm

    And don't forget to change value of "PCM Capture Source" parameter from 'Mic' to 'Line' in alsamixer(1)