[How-To] Acer Aspire Revo/ION - Output to both HDMI and SPDIF
#1
I have an old AV receiver that doesn't have a HDMI input. Until I can afford the upgrade, I wanted my Linux XBMC set-up to be able to output system sounds and all audio to the HDMI and the SPDIF/Optical simultaneously.

Why would you want to do this? ... Well, I wanted to be able to watch a movie or listen to music through my TV without having to switch on the AV Receiver. Ideal for when you don't want to wake the family in the middle of the night or just want to quickly watch something.

Here is my /etc/asound.conf file :

Code:
# Control device (mixer, etc.) for the card
ctl.!default {
  type hw
  card 0
}

pcm.!default {
  type plug
  slave {
    pcm multi
    rate 48000
  }
  ttable.0.0 1.0
  ttable.1.1 1.0
  ttable.0.2 1.0
  ttable.1.3 1.0
}

pcm.stereo {
  type plug
  slave {
    pcm multi
    rate 48000
  }
  ttable.0.0 1.0
  ttable.1.1 1.0
  ttable.0.2 1.0
  ttable.1.3 1.0
}

ctl.stereo {
  type hw
  card 0
}

pcm.multi {
  type multi
  slaves.a.pcm "tv-hw"
  slaves.a.channels 2
  slaves.b.pcm "digital-hw"
  slaves.b.channels 2
  bindings.0.slave a
  bindings.0.channel 0
  bindings.1.slave a
  bindings.1.channel 1
  bindings.2.slave b
  bindings.2.channel 0
  bindings.3.slave b
  bindings.3.channel 1
}

ctl.multi {
  type hw
  card 0
}

pcm.tv {
  type plug
  slave.pcm "tv-hw"
}

ctl.tv {
  type hw
  card 0
}

pcm.digital {
  type plug
  slave.pcm "digital-hw"
}

ctl.digital {
  type hw
  card 0
}

pcm.tv-hw {
  type hw
  card 0
  device 3
}

ctl.tv-hw {
  type hw
  card 0
}

pcm.digital-hw {
  type hw
  card 0
  device 1
}

ctl.digital-hw {
  type hw
  card 0
}

Now in XBMC audio settings :

Audio Output Device : "ALSAConfusedtereo"
Passthrough Device : "ALSA:digital"
Also ensure that you select any audio formats that your AV receiver is capable of decoding e.g. DTS, AC3 etc... Otherwise you will not be able to hear any files with DTS or AC3 etc.

Result
Menu sounds : Heard through TV and SPDIF
Stereo Music/ Audio : Heard through TV and SPDIF (Any sample rate will work)
DTS/AC3 : heard through SPDIF only.


Problems
There is only one problem I can think of with this setup (but I am working on it) and that is that DTS / AC3 (basically any of the options ticked in the audio settings) will not be down-mixed and sent out the HDMI. The only option at the minute is to go into the audio settings and disable the AC3 or DTS option for the duration that you want to watch a movie with a AC3 or DTS soundtrack through the TV.

I'm hoping to find a way of getting alsa to do a AC3 / DTS decode and down mix to stereo before piping out of the HDMI whilst still maintaining the bitstream for the SPDIF output.

Thanks,
Anand
Reply
#2
I followed your instructions, but these entries are missing:

nigma2k Wrote:Now in XBMC audio settings :

Audio Output Device : "ALSAConfusedtereo"
Passthrough Device : "ALSA:digital"

Is there something that has to be done prior to this?
Vero 4k+ | OSMC Kodi 19.1
Sony KD-65A1
Reply
#3
Bobby Blixberg Wrote:I followed your instructions, but these entries are missing:



Is there something that has to be done prior to this?

These entries won't appear. You need to set both options to custom, and type them in manually excluding the quotes and case sensitive.

Thanks,
Anand
Reply
#4
Thanks. Just did that, but it does not work on my Revo R3610 - I get the "failed to initialize audio device" error message.
Here's the relevant part of my xbmc.log:

Code:
11:57:52 T:3077539712 M:2991718400   ERROR: Initialize - snd_pcm_sw_params, alsa error: -22 - Invalid argument
11:57:52 T:3077539712 M:2991718400   ERROR: Creating a Null Audio Renderer, Check your audio settings as this should not happen
Vero 4k+ | OSMC Kodi 19.1
Sony KD-65A1
Reply
#5
Hmmm,

I have exactly the same platform, Two possibilities here :

1) I installed the latest nVidia driver (256.25) :

What version are you running ?

You can get it from :
http://www.nvidia.com/content/DriverDown...pe=GeForce


and then install using

sudo sh NVIDIA-Linux-x86-256.25.run

Apparently, this latest beta driver fixes HDMI audio issues.

2) You have an .asoundrc file in your home directory that is overriding the global /etc/asound.conf file. Remove the one in your home directory if present.

Cheers,
Anand
Reply
#6
Hi,
1) I'm also on 256.25 nVidia driver.

2) You mean asoundrc.conf file? There is one in /etc, but nothing similar in /home/xbmc

:confused2:
Vero 4k+ | OSMC Kodi 19.1
Sony KD-65A1
Reply
#7
The file in /etc should be called asound.conf

and only if you have an override file in /home/xbmxc it should be called .asoundrc. But in this case this file is not needed so should be deleted. Not sure how much you know about linux, but any files prefixed with '.' will be hidden by the default ls. Try "ls -a" in the home directory to see if .asoundrc is present.

So to clarify my confusing message above, the ONLY file you should have is /etc/asound.conf that contains the contents of the initial post.

If this fails, can you try a few things for me :
1) Play a movie with AC3 or DTS to see if you get output from the SPDIF
2) Play an MP3 and see if you get any sound

Thanks,
Anand
Reply
#8
My ftp client also displays hidden files, there is no file called .asoundrc in my home dir.

I did sudo nano /etc/asound.conf, copy & paste the code from your initial post into nano, saved it without errors, configured the audio settings in XBMC.

I still hear no sound, neither in movies, nor in MP3s, even after a restart, the error message stays the same (no wonder, as I did not change anything so far)
Vero 4k+ | OSMC Kodi 19.1
Sony KD-65A1
Reply
#9
Have you had audio working at all ?...

i.e. if you put "alsa: plug:iec958" in the audio output setting in xbmc, you should get audio output to your amplifier.
(remove the space after alsa: - the forum seems to replace this with a smiley face)

Another thing to check is to see what your device id's are for your audio outputs.. I'm asusming they are they same as mine 1 & 3 as we have the same revo. But you can checking by doing aplay -l from the command line and you should be able to see 3 devices analog, hdmi and optical with device ids.

Cheers,
Anand
Reply
#10
nigma2k Wrote:i.e. if you put "alsa: plug:iec958" in the audio output setting in xbmc, you should get audio output to your amplifier.

With this setting only every second of the MP3s in a playlist are with sound, but no error message window appears...very strange.

This is the output of aplay -l here:

Code:
root@Revo:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I am going to delete /etc/asound.conf and set audio output do "default". At least I can hear music and movie sound through my stereo amp then.
Would be nice to have HDMI, too, but it looks like my Revo has something against it.

nigma2k Wrote:(remove the space after alsa: - the forum seems to replace this with a smiley face)

Normally cou can avoid this by unchecking the "Automatically parse links in text" check box, but this doesn't work here...
Vero 4k+ | OSMC Kodi 19.1
Sony KD-65A1
Reply
#11
Hello,

This is how I want things set up too, so I followed your instructions and got it mostly working, but I'm having a problem with multi-channel audio through SPDIF. Here's what I've got:
  • Menu sounds through HDMI and SPDIF - WORKING
  • Stereo audio (e.g. MP3s) through HDMI and SPDIF - WORKING
  • 5.1 channel videos through HDMI - WORKING (although my TV can't downmix surround sound, so I'm just hearing front left and right)
  • 5.1 channel videos through SPDIF - NOT WORKING: I'm only getting the front left and right channels coming through, according to my receiver (and there's sound missing, so I don't think it's been downmixed).

Do you have any thoughts as to what the problem might be with that last one? I tried updating the nVidia drivers to 256.25, but it didn't help. The output of "aplay -l" is the same as Bobby's:

Quote:**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
Subdevices: 0/1
Subdevice #0: subdevice #0

I'd be grateful for any suggestions you might have!


Thanks,

Kevin
Reply
#12
So nigma2k,
Have you found a solution for downstreaming to HDMI and keeping raw sound through SPDIF?
Reply
#13
My way to get it working was:

XBMC set to digital 6 channels, no passtrough.

My alsa config does:
1) downmix to 2 channels for HDMI (tv).
2) downmix to 2 channels for analog (headphones).
3) uses alsa a52 plugin to convert on the fly upto 6 channels to ac3 for SPDIF.

Menu sounds work.

Once I get my new amp I just need to tweak the ttable and bindings to pass the full 6 channels to HDMI.

I based it on a multi output alsa config posted on the forum.
Reply
#14
chris80 Wrote:My alsa config does:
1) downmix to 2 channels for HDMI (tv).
2) downmix to 2 channels for analog (headphones).
3) uses alsa a52 plugin to convert on the fly upto 6 channels to ac3 for SPDIF.

Hey Chris,

sounds good!
Can you share your alsa config files as well as you xbmc settings?
What hardware are you on?
Reply
#15
I am also interested about config file.

Alda
Reply

Logout Mark Read Team Forum Stats Members Help
[How-To] Acer Aspire Revo/ION - Output to both HDMI and SPDIF1