[Project] Dual Audio Output support (Krypton/Jarvis/Isengard/Helix/Gotham/Frodo)

  Thread Rating:
  • 9 Vote(s) - 4.56 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
xhbl Offline
Junior Member
Posts: 49
Joined: Nov 2010
Reputation: 26
Location: CA
Post: #1
Update History:
--------------------
[03/13/2017] Added support for Krypton 17.0 and LibreELEC 8.0.0
[02/24/2017] Added support for Jarvis 16.1 and OpenELEC 7.0.1 / LibreELEC 7.0.3
[10/20/2015] Added support for Isengard 15.2 and OpenELEC 6.0.3
[04/19/2015] Added support for Helix 14.2 and OpenELEC 5.0.8
[10/18/2014] Updated to OpenELEC 4.2.1
[08/24/2014] Updated to Gotham 13.2
[06/06/2014] Added support for Gotham 13.1 and OpenELEC 4.0.4
[05/10/2014] Added support for OpenELEC 3.2.4
[04/17/2014] Initial support for Frodo 12.3 with new AudioEngine

Hi, for those who need 2-Zone simultaneous audio output might still remember this thread I posted years ago:
http://forum.kodi.tv/showthread.php?tid=86038

Now I'm back to bring a new supporting feature for Frodo(and later) which is the first version to use the powerful AudioEngine audio subsystem. I created this new thread also because of the totally different AudioEngine which makes the old patch inapplicable and this is a newly developed feature that is adapted to the AudioEngine.

The initial development of this project was under the support of lallhands in this forum. Thanks to him for encouraging me to start this project.

Currently Krypton/Jarvis/Isengard/Helix/Gotham/Frodo are supported, Different code are developed for them respectively. Be aware to pull the proper branch if you do your own build.

[Image: XBMC-DA-8.jpg?raw=1]
A screenshot of setting in Krypton

[Image: XBMC-DA-7.jpg?raw=1]
A screenshot of setting in Jarvis - Gotham

The dual audio output support Kodi built-in video player (videoplayer/dvdplayer) and music player (paplayer) as well as the GUI sounds. I've tested with the Windows and OpenELEC build and seems to be working well. as I mentioned above, in Gotham and later version, AudioEngine has been refactored to ActiveAE, so for Frodo, I only focused on the SoftAE which would support Windows WASAPI/Directsound and Linux ALSA/OSS. Although I implemented code for PulseAE/CoreAudioAE, it's mainly for passing the compiling. for Gotham, since AudioEngine had been refactored to a unified ActiveAE, all platforms should work.

Quite a few core source files needed to be modified to make this feature work which is a bit hacky, it's not considered to be a 'clean and decent' solution, thus there is the necessity to create a project to keep updating with the Kodi main project. Projects were created on github.

Repositories:
-----------------
Kodi: https://github.com/xhbl/Kodi_dualaudio
OpenELEC: https://github.com/xhbl/OpenELEC_dualaudio
LibreELEC: https://github.com/xhbl/LibreELEC_dualaudio

Branches with name suffix '-DA' are the Dual Audio branches, e.g., Krypton-DA, openelec-8.0-DA, etc. You can simply clone these repositories and pull the proper branch to make your own build.

Binaries:
-----------
For those who want to have a instant try, I build windows(only Kodi.exe[XBMC.exe before Helix], you need to install the original and replace exe file with this, for versions after Frodo, addtional xml setting files need to be replaced) and OpenELEC Generic 64bit version for your convenience:

[Windows]
12.3-Frodo (Windows DirectX): XBMC-12.3-dx-DualAudio-r019.zip
13.2-Gotham (Windows DirectX): XBMC-13.2-dx-DualAudio-r019.zip
14.2-Helix (Windows DirectX): Kodi-14.2-dx-DualAudio-r017.zip
15.2-Isengard (Windows DirectX): Kodi-15.2-dx-DualAudio-r020.zip
16.1-Jarvis (Windows DirectX): Kodi-16.1-dx-DualAudio-r015.zip
17.0-Krypton (Windows DirectX): Kodi-17.0-dx-DualAudio-r015.zip

[OpenELEC]
3.2.4-OpenELEC(Generic_x86_64): OpenELEC-Generic.x86_64-3.2.4-DualAudio-r019.tar
4.2.1-OpenELEC(Generic_x86_64): OpenELEC-Generic.x86_64-4.2.1-DualAudio-r019.tar
5.0.8-OpenELEC(Generic_x86_64): OpenELEC-Generic.x86_64-5.0.8-DualAudio-r017.tar
6.0.3-OpenELEC(Generic_x86_64): OpenELEC-Generic.x86_64-6.0.3-DualAudio-r020.tar
7.0.1-OpenELEC(Generic_x86_64): OpenELEC-Generic.x86_64-7.0.1-DualAudio-r015.tar
OpenELEC(builds by DarkAngel2401): OpenELEC-DualAudio-builds-by-DarkAngel2401

[LibreELEC]
7.0.3-LibreELEC(Generic_x86_64): LibreELEC-Generic.x86_64-7.0.3-DualAudio-r015.img.gz
8.0.0-LibreELEC(Generic_x86_64): LibreELEC-Generic.x86_64-8.0.0-DualAudio-r015.img.gz
LibreELEC(builds by DarkAngel2401): LibreELEC-DualAudio-builds-by-DarkAngel2401

Any suggestions for the future of this project, you are welcome to PM or email me. Enjoy!

DONATE to this project [Image: btn_donateCC_LG.gif]
(This post was last modified: 2017-03-13 18:45 by xhbl.)
find quote
quartermain Offline
Junior Member
Posts: 17
Joined: Mar 2014
Reputation: 0
Post: #2
It would be very interesting if you did decide to develop this for Gotham.

I have been looking for a dual-audio solution for some time. I need it so I can listen via the 5.1 speaker system while my wife who is hard of hearing can listen using cordless headphones.

I finally decided to use an Atlona AT-HD-M2C fed by a HDMI splitter. This solution isn't cheap and with the splitter means more boxes, more cables and more power supplies. Dual audio from XBMC would be a much neater solution.
find quote
Andycots Offline
Junior Member
Posts: 4
Joined: Apr 2014
Reputation: 0
Post: #3
Great stuff, been looking and following the old Eden post for a while now hoping for this to come to Frodo, well done on your hard work.

Cheers
find quote
quartermain Offline
Junior Member
Posts: 17
Joined: Mar 2014
Reputation: 0
Post: #4
OK I tried the Windows version first. I set the first audio output to HDMI and 5.1, with the audio output device WASAPI. Second audio ouput to Analogue and 2.0, audio output device WASAPI - I had to scroll through these until I heard a sound in the headphones I had plugged in.

I played a 5.1 speaker setup test. The headphone output was perfect, all 6 channels audible and in the right place. However there was a problem with the 5.1 output - front and LFE were OK but I could hear the surround channels through the front right and left speakers as well as the rear right and left.

I will try the OE version later today.
find quote
quartermain Offline
Junior Member
Posts: 17
Joined: Mar 2014
Reputation: 0
Post: #5
OE fared better than Windows - I could get 5.1 to the speakers and a downmix to the headphones from lots of my test files, and all the channel placement was correct.

Unfortunately Frodo has problems that have been fixed in Gotham. If I bitstream the sound, Dolby TrueHD and DTS MA samples play at extremely low volumes (this may be an interaction between XBMC and my A/V receiver). If I send LPCM then most test files are OK but one I have which uses Dolby TrueHD has stuttering video and audio. And an irritation of OE 3.2 is that it doesn't work with my Logitech K400r cordless keyboard/trackpad. All these problems go away if I use a dev build of OE/Gotham.

I also noticed that the sound through the headphones was slightly ahead of that through the speakers. Watching actors lips suggest that the headphones are spot on and the speakers slightly behind, but it's so close that it wouldn't be noticeable in normal use unless you could hear both headphones and speakers at the same time.

So this is *almost* enough for me to forget about buying the Atlona box, but not quite. If the same patches were applied to Gotham it would be a different story - then I would definitely go for it.
find quote
Juno Offline
Member
Posts: 55
Joined: Dec 2010
Reputation: 0
Post: #6
How to install this patch:
3.2.4-OpenELEC: xbmc-122-DualAudio-OE324-r019.patch
?

Regards.

EDIT.
Didnt noticed already compiled vweriosn of OE.
Thx.
(This post was last modified: 2014-04-19 19:03 by Juno.)
find quote
wsnipex Offline
Team-Kodi
Posts: 6,433
Joined: Jun 2011
Reputation: 166
Post: #7
gotham on linux doesn't need an dual audio patch, you can do the same and more with the new pulse audio support.
find quote
Juno Offline
Member
Posts: 55
Joined: Dec 2010
Reputation: 0
Post: #8
Thank You wsnipex but i cant.
I installed gotham based openelec and with my stereo analog amplifier connected via optical and tv connected via hdmi i cant have two audio in same time. As i want to listen to music i have to change settings everytime after i watched tv. And vice versa. Thats highly unconvenient.
Regards
find quote
wsnipex Offline
Team-Kodi
Posts: 6,433
Joined: Jun 2011
Reputation: 166
Post: #9
OE doesn't include pulse afaik. If dual audio on gotham is important to you, you might be better off with ubuntu or another normal linux dist.
find quote
dhead Offline
Donor
Posts: 696
Joined: May 2010
Reputation: 3
Post: #10
@wsnipex

It's there, it just not enabled in the build process (I didn't tested its usability)

https://github.com/OpenELEC/OpenELEC.tv/...pulseaudio
https://github.com/OpenELEC/OpenELEC.tv/...package.mk
https://github.com/OpenELEC/OpenELEC.tv/...ic/options
find quote
wsnipex Offline
Team-Kodi
Posts: 6,433
Joined: Jun 2011
Reputation: 166
Post: #11
nice, so its all there, but must be enabled during build.
find quote
botez Offline
Junior Member
Posts: 15
Joined: Dec 2011
Reputation: 0
Post: #12
Awesome work, xhbl. I've been annoyed at the extra hardware and various hacks I've had to use to get this functionality, so it's exciting to see this (and in Openelec as well, which is what I use!). Great stuff.
find quote
mrdally204 Offline
Fan
Posts: 503
Joined: Nov 2010
Reputation: 9
Location: Ohio
Post: #13
Adding my thank you as well. This feature is one of those must haves that I have missed since the Frodo release. I have since upgraded to Gotham for testing purposes so I am unable to take advantage of your work at present. Hopefully a Gotham release is in the not too distant future. Welcome back to the community!
find quote
taxigps Offline
Team-XBMC Python Developer
Posts: 484
Joined: Jan 2009
Reputation: 2
Post: #14
welcome back xhbl.
find quote
marco.weinkauf Offline
Junior Member
Posts: 8
Joined: Dec 2012
Reputation: 0
Post: #15
Hi,

sounds very promising to finally implement the desired solution for my htpc.

I have a question for this patch.

Is it possible to have on audio1 TrueHD or DTS-MA HDMI passthrough and on audio2 analog stereo at the same time?

Regards,
Marco
find quote
Post Reply