gwmngilfen
Posts: 3
Joined: Mon Jun 10, 2013 12:40 am

Getting 5.1 Sound working on a C-Media USB Audio device

Mon Jun 10, 2013 12:49 am

Hi all,

I've got a Conrad AA 1570 7.1 SoundBox (which is listed as working here: http://elinux.org/RPi_VerifiedPeriphera ... ound_Cards) which is connected to an old set of 5.1 speakers I had lying around. Sound plays, but only from the FrontLeft / FrontRight channels – if I mute those, I hear nothing from the other 3.

I've tested the SoundBox on a laptop (which uses Pulseaudio) and I could test all 5 channels independently, so the hardware seems to work fine with Linux in general.

I'm guessing I just need the right asoundrc.conf to configure the USB card, but all my attempts so far have pretty much failed. Does anyone have any advice for getting this working?

For diagnostic purposes, here's some data. The Pi is running Arch (but I had similar results on Debian). It's connected to a powered USB hub, as is the USB sound card. lsusb reports:

Code: Select all

[root@citrine ~]# lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. LAN9500 Ethernet 10/100 Adapter / SMSC9512/9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 006: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 007: ID 0d8c:0102 C-Media Electronics, Inc. CM106 Like Sound Device
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
aplay sees the card just fine:

Code: Select all

[root@citrine ~]# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=Device
    USB Sound Device, USB Audio
    Default Audio Device
sysdefault:CARD=Device
    USB Sound Device, USB Audio
    Default Audio Device
front:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    Front speakers
surround40:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround71:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
surround51:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
All help gratefully received!

binderth
Posts: 3
Joined: Thu Aug 22, 2013 12:01 pm

Re: Getting 5.1 Sound working on a C-Media USB Audio device

Thu Aug 22, 2013 12:09 pm

Hi gwmngilfen,

got the same card and am stuck at the exact same place.
alsa gets the card all right, but pulseaudio don't - because it's 8channels, module-udev-detect won't work:

Code: Select all

[pulseaudio] alsa-mixer.c Volume element Speaker has 8 channels. That's too much! I can't handle that!
I even reinstalled pulseaudio with testing raspbian (jessie), so I got pulseaudio 4 instead of pulseaudio 2, but still hardware detection didn't work.

I don't come through to the hardware-ids of the channels:
my /etc/pulse/default.pa:

Code: Select all

load-module module-alsa-sink sink_name=front device hw:1,0 channels=2 channel_map=front-left,side-right
load-module module-alsa-sink sink_name=side device hw:1,0 channels=2 channel_map=front-left,side-right
crashes pulsaudio. see "hw:1,0" won't work
Did you work this out? What hw-id do the side and rear channels have?

gwmngilfen
Posts: 3
Joined: Mon Jun 10, 2013 12:40 am

Re: Getting 5.1 Sound working on a C-Media USB Audio device

Thu Aug 29, 2013 10:24 am

@binderth:

I can't use pulseaudio at all on the RPi - I'm using a headless setup, so there's no desktop to attach the Pulse session to, and the Pulse authors explicitly discourage running pulseaudio as a system daemon.

So, I'm trying to figure out how to configure ALSA to use the card properly - as explained in my first post, I can get 2channel audio from it, but not 6 or 8 channel. So far no-one seems to know how to configure ALSA to work properly - a naive attempt to switch the input to the 5:1 output in aplay results in heavily distorted sound.

gwmngilfen
Posts: 3
Joined: Mon Jun 10, 2013 12:40 am

Re: Getting 5.1 Sound working on a C-Media USB Audio device

Thu Aug 29, 2013 10:29 am

Oh I forgot to mention, individual channels don't have hw-ids, as far as I understand it. The card itself is at hw:0,0 since I blacklisted the onboard sound module. See 'aplay -l':

Code: Select all

[root@citrine ~]# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Device [USB Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

binderth
Posts: 3
Joined: Thu Aug 22, 2013 12:01 pm

Re: Getting 5.1 Sound working on a C-Media USB Audio device

Thu Aug 29, 2013 11:38 am

didn't came across pulseaudio won't work headless! but this would explain things! ;)

eventually I did find a way with ALSA and mpd to get 7.1 Sound out of the card!
and yes - the card only uses one hardware-id for all channels... :roll:
here is how:

1) install MPD as described here:
http://www.forum-raspberrypi.de/Thread- ... spberry-pi
edit /etc/mpd.conf as follows:

Code: Select all

audio_output {
  type           "alsa"
  name           "extern USB"
  device         "hw:1,0"
  mixer_device   "mpdvol"
  mixer_control  "MPD"
  mixer_typ      "software"
}
please note: "device hw:1,0" could change!

2) create /etc/asound.conf as described here (sorry, this is in german):
http://wiki.ubuntuusers.de/.asoundrc#Kanal-Splitting

With this you can have stereo-Sound with "stereox" and everything works as expected. You can then start different MPD-instances for each channel one and have an easy multiroom environment for example!

feel free to aks, especially if the german howto arouses questions.

greets,
Thomas.

southafricanrob
Posts: 31
Joined: Wed Sep 18, 2013 12:54 pm

Re: Getting 5.1 Sound working on a C-Media USB Audio device

Wed Sep 18, 2013 1:03 pm

hi thomas, i'm ideally hoping to have the Pi sending audio to the soundbox via USB and out to 5.1 speakers as well as another media player sending audio to the speakers via the optical in - have you tried this setup at all? trying to figure out if this 2 inputs to 1 output setup is possible before i buy the external sound box.

thanks,,

skyrave
Posts: 1
Joined: Fri May 02, 2014 7:34 pm

Re: Getting 5.1 Sound working on a C-Media USB Audio device

Fri May 02, 2014 7:37 pm

Hey binderth, did you ever get the 5.1 channel sound card to work?

User avatar
przemof
Posts: 168
Joined: Mon Dec 30, 2013 6:43 pm

Re: Getting 5.1 Sound working on a C-Media USB Audio device

Tue Nov 18, 2014 9:15 pm

Stereo works fine, but I can't get 5.1 working. Anyone?

P.S. I cam confirm that 5.1 works, Now passthrough from SPDIF....

Return to “Media centres”