Config for 5.1 surround sound with ALSA + wireless problems

Raspberry Pi related support

Config for 5.1 surround sound with ALSA + wireless problems

Postby logitech_Z-640 » 23 Sep 2018, 15:12

Hello all,

first of all thanks for all the effort you put into Runeaudio. I really like the lean concept and the UI. It does exactly what it needs to do.

I own an old RPi B+ and a pretty old 5.1 system from Logitech (Z-640) which hasn't been used in a while. I decided to buy a cheap 7.1 USB sound card (Logilink UA0099) and give RuneAudio (v0.3-beta (29/10/2014)) a try.

In general, the setup is working. I'm able to access the UI, I can select music from a connected USB disk (which is connected via an active USB hub, where also the USB sound card is connected).

I do have two problems though:
1. playing music is only working for the two front speakers. The "rear" speakers don't do anything when playing music via the frontend.
2. Wifi is not working at all from the frontend

I really read a lot of different threads in the last days regarding problem 1), but can't find a proper solution. The speakers in general are working. I tried it with a live Manjaro 1710 system
and the Logilink USB sound card, and there all speakers are working. I can select "analogue 5.1 surround" in the GUI, and afterwards all speakers are good. The problem is that Manjaro uses pulseaudio, which overrides /etc/asound.conf and creates a config in /home/manjaro/.config/pulse. As soon as you update the config via GUI, the config file (cryptic filename 06dxxxx-default-sink) gets updated with value: alsa_output.usb-0d8c_USB_Sound_Device-00.analog-surround-51
I'm not sure if this is "real" 5.1 sound, but even if the front speakers are just mapped to the rear ones this is good for me.

Unfortunately, runeaudio does use alsa (not pulseaudio). I created file /etc/asound.conf (see code below), but even when mapping front to rear it doesn't work. At least not when playing music via the frontend. The speakers are working when using speaker-test with the following options:
speaker-test -Dsurround51:Device -c6 -twav
I can hear sound from all four speakers (front left, front right, rear left, rear right). There is no sound form the center speaker.

I also thought about changing the mpd.conf, but in general that's no good idea (because I would
have to set it to read-only afterwards)


Hardware:
Raspberry Pi B+
Cmedia CM2606 (Logilink UA0099 USB Sound Card)
Logitech Z-640
Active USB hub
USB stick with music
Speakers are connected with three cables (green, black, orange)

Software:
RuneAudio version v0.3-beta (29/10/2014)
for the wireless stuff, I tried the nightly build, but that totally crashed the system
(according to http://www.runeaudio.com/documentation/troubleshooting/updating/#nightly-builds)

My first question: is there any option to get my rear speakers working from the frontend as well?
My 2nd one would be the wireless stuff, but it only makes sense if the sound problems are solved.

Many thanks in advance!

aplay -l
Code: Select all
[root@runeaudio ~]# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Device [USB Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
[root@runeaudio ~]#


aplay -L
Code: Select all
[root@runeaudio ~]# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    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
surround21:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    2.1 Surround output to Front and Subwoofer 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
surround51:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer 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
[root@runeaudio ~]#


lsusb
Code: Select all
[root@runeaudio ~]# lsusb
Bus 001 Device 007: ID 0d8c:0102 C-Media Electronics, Inc. CM106 Like Sound Device
Bus 001 Device 006: ID 13fe:4200 Kingston Technology Company Inc.
Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[root@runeaudio ~]#


/etc/asound.conf
Code: Select all
pcm.!default {
    type hw
    card Device
}
pcm.!default {
    type route
    slave.pcm surround51
    slave.channels 6
    ttable.0.0 1
    ttable.1.1 1
    ttable.0.2 1
    ttable.1.3 1
    ttable.0.5 0.5
    ttable.1.5 0.5
}
pcm.upmix51 {
    type upmix
    slave.pcm "surround51"
    delay 15
    channels 6
}
pcm.!default "plug:upmix51"
logitech_Z-640
 
Posts: 5
Joined: 23 Sep 2018, 15:00

Re: Config for 5.1 surround sound with ALSA + wireless probl

Postby janui » 23 Sep 2018, 21:13

Hi logitech_Z-640,
See here, it might help: https://stackoverflow.com/questions/361 ... sound-card
janui
User avatar
janui
 
Posts: 323
Joined: 20 Dec 2014, 12:55
Location: Ollanda

Re: Config for 5.1 surround sound with ALSA + wireless probl

Postby logitech_Z-640 » 24 Sep 2018, 09:47

Hi janui,

thank you so much!! It's finally working with this configuration.
I adapted /etc/asound.conf according to the link you've pasted, restarted ALSA with "alsactl kill rescan", adapted /etc/mpd.conf and restarted mpd with "systemctl restart mpd".

I've really been searching a long time in several sources, but didn't manage to find a sufficient answer.
I hope mpd.conf won't get overwritten after reboot, but in case of doubt I'll create a small script and start it via cron. Alternatively, I'll use the hint (modify /srv/http/app/libs/runeaudio.php) given here:
http://www.runeaudio.com/forum/disable-auto-mpd-conf-t3750.html

Now I can go on with the wireless stuff. Will use another SD card to try out the new version 0.5-beta and see if it's working there.


BR logitech_Z-640
logitech_Z-640
 
Posts: 5
Joined: 23 Sep 2018, 15:00

Re: Config for 5.1 surround sound with ALSA + wireless probl

Postby logitech_Z-640 » 24 Sep 2018, 15:44

I adjusted the runeaudio.php script so that changes will be persistent even after a reboot.

For the wireless stuff: with 0.5-beta, the UI WLAN network configuration gets stuck at "scanning for networks" forever. Anyhow, I was able to connect my USB WLAN card (Edimax EW-7811UN, kernel module 8192cu) with iw and netctl tools.

I created a new profile wlan_profile in /etc/netctl with the following settings:
Code: Select all
Interface=wlan0
Connection=wireless
Security=wpa
ESSID='<myESSID>'
Key='<my passphrase>'
IP=dhcp


Then used netctl start wlan_profile to check if it's working and then enabled it to automatically start after reboot: netctl enable wlan_profile

For the old v0.3-beta (29/10/2014), netctl doesn't work. There is also no iw utility yet, so I would have to use wpa_supplicant. Since I didn't really move forward with this, I'll try to use one of the nightly builds to update the v0.3 (not sure if this will update to 0.5-beta, but I'll see).

For 0.5-beta, I noticed that the volume control decreases the volume automatically like 1 minute after playing. Also, once playing just started even though I didn't hit any button (at least I'm not aware of it). Anyway, I guess those are points which are better addressed in the 0.5-beta thread than here.

From my point of view, the thread can be marked as solved. If I can do that on my own, please let me know how.


BR logitech_Z-640
logitech_Z-640
 
Posts: 5
Joined: 23 Sep 2018, 15:00

Re: Config for 5.1 surround sound with ALSA + wireless probl

Postby Toube » 11 Oct 2018, 18:06

logitech_Z-640 wrote:Hi janui,

thank you so much!! It's finally working with this configuration.
I adapted /etc/asound.conf according to the link you've pasted, restarted ALSA with "alsactl kill rescan", adapted /etc/mpd.conf and restarted mpd with "systemctl restart mpd".

I've really been searching a long time in several sources, but didn't manage to find a sufficient answer.
I hope mpd.conf won't get overwritten after reboot, but in case of doubt I'll create a small script and start it via cron. Alternatively, I'll use the hint (modify /srv/http/app/libs/runeaudio.php) given here:
http://www.runeaudio.com/forum/disable-auto-mpd-conf-t3750.html

Now I can go on with the wireless stuff. Will use another SD card to try out the new version 0.5-beta and see if it's working there.


BR logitech_Z-640

Hi,

Could I possibly ask you to share the exact instruction on what you did? I would appreciate. I'm trying to get my 2.1 configuration to work using Asus Xonar U7 MK2 but I can't get any sound from the subwoofer out.

I created the file: etc/asound.conf
Code: Select all
cm.!default {
    type hw
    card MKII
}
pcm.!default {
    type route
    slave.pcm surround21
    slave.channels 3
    ttable.0.0 1
    ttable.1.1 1
    ttable.0.2 1
    ttable.1.3 1
    ttable.0.5 0.5
    ttable.1.5 0.5
}
pcm.upmix21 {
    type upmix
    slave.pcm "surround21"
    delay 15


But even after rebooting I cant get any sound from the subwoofer.
Please advice.
Thanks.
-Toube
Toube
 
Posts: 20
Joined: 10 Oct 2018, 08:10

Re: Config for 5.1 surround sound with ALSA + wireless probl

Postby Toube » 11 Oct 2018, 18:43

An update:

here's how my asound.conf looks like:
Code: Select all
pcm.ch21 {
    slave sl2
    #slave.channels 6
    type route
    ttable.0.0 1
    ttable.1.1 1
    ttable.0.2 1
    ttable.1.3 1
    ttable.0.4 0.5
    ttable.1.4 0.5
    ttable.0.5 0.5
    ttable.1.5 0.5
}

pcm_slave.sl2 {
    channels 3
    pcm "hw:1,0"
}


and here's the mpd.conf:
Code: Select all
audio_output {
   name       "bcm2835 ALSA_1"
   type       "alsa"
   device       "hw:1,0"
   mixer_control    "PCM"
   mixer_type    "hardware"
   mixer_device    "hw:1"
   auto_resample    "no"
   auto_format    "no"
}

audio_output {
   name       "Xonar U7 MKII"
   type       "alsa"
        channels        "3"
   device       "ch21"
   mixer_control    "PCM"
   mixer_type    "hardware"
   auto_resample    "no"
   auto_format    "no"
   enabled    "yes"
}

audio_output {
   name       "bcm2835 ALSA_2"
   type       "alsa"
   device       "hw:1,0"
   mixer_control    "PCM"
   mixer_type    "hardware"
   mixer_device    "hw:1"
   auto_resample    "no"
   auto_format    "no"
}


But using this config I cant get any music to play. Pressing play but it wont start playing the music.

Did a speaker test and looks like only front channels are in use:
sudo -u mpd speaker-test -c 6 -t wav

speaker-test 1.1.0

Playback device is default
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 2229 to 17832
Period size range from 1114 to 1115
Using max buffer size 17832
Periods = 4
was set period_size = 1114
was set buffer_size = 17832
0 - Front Left
1 - Front Right
2 - Unused
3 - Unused
4 - Unused
5 - Unused

-Tobias
Toube
 
Posts: 20
Joined: 10 Oct 2018, 08:10

Re: Config for 5.1 surround sound with ALSA + wireless probl

Postby Toube » 11 Oct 2018, 19:14

Wow looks like its working by setting all 6 channels in use instead of 3 :)
So mpd.conf looks like this:
Code: Select all
audio_output {
   name       "Xonar U7 MKII"
   type       "alsa"
   channels   "6"
   device    "ch51"
   mixer_control    "PCM"
   mixer_type   "hardware"
   auto_resample    "no"
   auto_format    "no"
   enabled    "yes"
}


and asound.conf:
Code: Select all
pcm.ch51 {
    slave sl2
    #slave.channels 6
    type route
    ttable.0.0 1
    ttable.1.1 1
    ttable.0.2 1
    ttable.1.3 1
    ttable.0.4 0.5
    ttable.1.4 0.5
    ttable.0.5 0.5
    ttable.1.5 0.5
}

pcm_slave.sl2 {
    channels 6
    pcm "hw:0,0"
}
Toube
 
Posts: 20
Joined: 10 Oct 2018, 08:10

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 2 guests