Solved Ubuntu 14.04 + XBMC 13 + CM106 USB S/PDIF 5.1 audio problem
#1
Setup:
-ubuntu 14.04
-XBMC 13 Gotham
-Tvheadend 3.5.247 (saucy)
-Laptop: Compaq nc6220 motherboard in a larger old DVD-player box.
-CM106 USB audio "card" (id 0d8c:0102) modded for coaxial audio output. (btw, easiest mod ever, just solder 2 wires)

First of all all worked on ubuntu 12.04 (it was not easy on that system either)
I need 5.1 and 2.0 audio to get to work on xbmc, no need for menu sounds or operating system sounds.

At the beginning when I did nothing the 2.0 sound worked, XBMC downmixed to 2.0 sound. What I need is the S/PDIF-sound output for 5.1 DD + DTS.

There was no digital 5.1 sound available at the audio preferences, only analog 5.1 and I have no use for that. What I did was copy /home/USERNAME/.asoundrc from my old system to this system, no help.
This is the contains of that file:

Code:
pcm.dmixer {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:1.0"
        period_time 0
        period_size 1024
        buffer_size 8192
        #periods 128
        #rate 44100
        rate 48000
     }
     bindings {
        0 0
        1 1
     }
}


Then I searched the internet and changed the channels from 2 to 6 and enabled it (removed ; ) in /etc/pulse/daemon.conf
If i remember correctly now Pavucontrol shoved me analog 5.1 sound, before there was only 2.0 sounds available (also digital).

Code:
; default-sample-format = s16le
; default-sample-rate = 44100
; alternate-sample-rate = 48000
default-sample-channels = 6
; default-channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe

Next what I did to get the 5.1 digital option to show in pavucontrol --> created a file in /etc/asound.conf and added:

Code:
# /etc/asound.conf
# alsa plugin a52
# speaker-test -c 6 -l 1 -D pcm.a52:[CARD]
pcm.a52 {
  @args [CARD]
  @args.CARD {
    type string
  }
  type rate
  slave {
    pcm {
      type a52
      bitrate 448 # 448 is max for most
      channels 6
      card $CARD
    }
  rate 48000
  }
}

^This might not be the corrtect settings, do not know what this does, just googled it.^
Anyway, there is now 5.1 digital surround option in Pavucontrol.

With some settings from gstreamer-properties and pavucontrol I got 5.1 audio to work, but only for the operating system, when I started the XBMC, sound would go off (amplifier tells me the number of channels, if any). In XBMC I chose the digital 5.1 sound.

When is start a video with VLC after reboot --> 5.1 sound works, but when I start XBMC it disappeares, and does not come back on --> only after reboot it works again with VLC. Also xbmc hangs when trying to shut it down, have to force quit.

I got it to work once perfectly (with settings I have now), but after reboot it did not work. I think this issue has something to do with the XBMC-software itself, not the operating system?

Any ideas to how to get 5.1 to work?

EDIT: When I force xbmc to shut down, I need to run "pulseaudio -k" in terminal and then the sound works again in VLC. Does this somehow have something to do with passthrough-audio? Huh

Here is what the audio box looks like, very common
Image
Reply
#2
Using this I made it to work --> http://wiki.xbmc.org/index.php?title=PulseAudio

In pavucontrol audio HAS to be set to Digital STEREO, not 5.1, also started XBMC with:
Code:
AE_SINK=ALSA xbmc

I also installed these, but am not sure if they are needed:
Code:
sudo apt-get install libasound2-dev libavcodec-dev

I also added "keep audio device alive"-setting in XBMC to "off", so it releases audio-system and I can watch 2.0 video-files instantly after 5.1 video-files.

Now everything works okay!

Adding "AE_SINK=ALSA xbmc" to startup-programs does nothing. It has to be in /etc/rc.local. If it is not executed automatically add to startup programs "/etc/rc.local

I added also "wait 6" before that, so computer will wait 6 seconds before starting this up, so everything else is ready. With 4 seconds system gives gives me error.

This is my rc.local now, note that -e is missing from straight after "#!/bin/sh"; if it is there, system does not execute this script for some reason:
Code:
#!/bin/sh
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# /home/xbmc/serviio-1.3.1/bin/serviio.sh

wait 1

xrandr --newmode "1280x720_60.00"   74.50  1280 1344 1472 1664  720 723 728 748 -hsync +vsync

wait 1

xrandr --addmode VGA1 1280x720_60.00

wait 6

AE_SINK=ALSA xbmc

exit 0

Newmode and addmode are for forcing 720p resolution.


I have a bad habit of figuring things out my self and answering my own posts, I don't mind Nod
Reply

Logout Mark Read Team Forum Stats Members Help
Ubuntu 14.04 + XBMC 13 + CM106 USB S/PDIF 5.1 audio problem1