Kodi Community Forum
[PATCH] Dual Audio Output support for XBMC (Eden Updated) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: [PATCH] Dual Audio Output support for XBMC (Eden Updated) (/showthread.php?tid=86038)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48


- nessus - 2011-05-17

xhbl... any plans for releasing new master binary file ?.

If i install the latest nightly master build and replace the exe with what you have in the first thread (master-20110331-acb1223) will work without problems;

Cheers
Nessus


Compiled version of Dharma 10.1 Linux/Ubuntu - dinosaurjr - 2011-05-18

Great work, you made my day!!

I replaced xbmc.bin version 10.1 with your 10.0 version, and dual audio works like a charm, but i lost my VDPAU capabilities.

Anyway, can someone post a compiled Linux "XBMC.bin" of XBMC Dharma 10.1 (Compiled Mar 9 2011) Dual Audio with VDPAU?

Pretty PleaseSad


- teeedubb - 2011-05-22

I managed to compile the patch into xbmc-live, I gave up trying to install xbmc-live on natty as there were too many issues.. Everthing seems to be working fine, though I havent done much testing as its too late here to test the receiver.

Thanks so much for this patch xhbl, Ive finally gotten my xbmc setup working as should. This feature needs to become standard in xbmc, its made setting up my audio needs much easier. My tv + ac3 audio + linux just does not work, not matter what Ive tried. Now I have analog audio going to my receiver and analog + digital going to my receiver and I just mute the tv when Im using the receiver.

Here is a copy of of my xbmc.bin file. It is compiled from 10.1 Dharma branch and has vdpau enabled and pulse audio disabled.

Thanks again xhbl!! Big GrinBig GrinBig Grin


xbmc.bin File? - dinosaurjr - 2011-05-22

teeedubb Wrote:I managed to compile the patch into xbmc-live, I gave up trying to install xbmc-live on natty as there were too many issues.. Everthing seems to be working fine, though I havent done much testing as its too late here to test the receiver.

Thanks so much for this patch xhbl, Ive finally gotten my xbmc setup working as should. This feature needs to become standard in xbmc, its made setting up my audio needs much easier. My tv + ac3 audio + linux just does not work, not matter what Ive tried. Now I have analog audio going to my receiver and analog + digital going to my receiver and I just mute the tv when Im using the receiver.

Here is a copy of of my xbmc.bin file. It has vdpau enabled and pulse audio disabled.

Thanks again xhbl!! Big GrinBig GrinBig Grin

Hey teeedubb,

First of all thanks for the effort, but if i click the link you posted i get a 4kb file, seems rather small.
Is this correct?:confused2:


- teeedubb - 2011-05-23

dinosaurjr Wrote:Hey teeedubb,

First of all thanks for the effort, but if i click the link you posted i get a 4kb file, seems rather small.
Is this correct?:confused2:

I'm not sure, it was really late when I uploaded the file and my first time using dropbox. Ill check again when I get home.


- dinosaurjr - 2011-05-24

teeedubb Wrote:I managed to compile the patch into xbmc-live, I gave up trying to install xbmc-live on natty as there were too many issues.. Everthing seems to be working fine, though I havent done much testing as its too late here to test the receiver.

Thanks so much for this patch xhbl, Ive finally gotten my xbmc setup working as should. This feature needs to become standard in xbmc, its made setting up my audio needs much easier. My tv + ac3 audio + linux just does not work, not matter what Ive tried. Now I have analog audio going to my receiver and analog + digital going to my receiver and I just mute the tv when Im using the receiver.

Here is a copy of of my xbmc.bin file. It is compiled from 10.1 Dharma branch and has vdpau enabled and pulse audio disabled.

Thanks again xhbl!! Big GrinBig GrinBig Grin

THANK YOU teeedubb!!!
The newly uploaded xbmc.bin file works like a charm!!
just replaced the "xbmc.bin" in the folder "/usr/lib/xbmc" and everything is working perfectly, you made my day!!

For my Setup i use a my Mac Mini, which has a combined Digital/Analog Output, connected through spdif to my (non HDMI) Home Cinema Set.
Secondly i have a USB soundcard attached, which is connected by analog stereo cable to my TV.

Because of this I can now enjoy AC3/DTS audio through my receiver and at the same time Downmixed analog 2.0 audio on my TV without constantly switching audio settings in xbmc when the receiver is turned off.

Thank you teeedub for compiling the xbmc-live, VDPAU + Dual Audio bin file.Big Grin
Thank you xhbl for thinking up and creating the DUAL Audio Patch!!Big Grin


- teeedubb - 2011-05-25

Glad it worked for you. Ill leave the link for anyone else that wants it.

Ive finally gotten some free time to test the setup and the only issue I ran across was mp3's cutting in and out when played through the receiver (optical), while they would play fine through the tv (hdmi) and dts audio from a movie played fine on either (I didnt get around to testing mp3 or ac3 audio in a video file).

Adding the following code to the advancedsettings.xml file solved the problem for me:

Code:
<audio>
<resample>48000</resample>
</audio>

This could help the other folk who were having problems with their audio skipping.

Thanks once again xhbl!


- erhnam - 2011-05-25

dinosaurjr Wrote:THANK YOU teeedubb!!!
For my Setup i use a my Mac Mini, which has a combined Digital/Analog Output, connected through spdif to my (non HDMI) Home Cinema Set.
Secondly i have a USB soundcard attached, which is connected by analog stereo cable to my TV.

Do you combine your Mac Mini with XBMC Live?


- dinosaurjr - 2011-05-25

erhnam Wrote:Do you combine your Mac Mini with XBMC Live?

Yes, I Do!
I fully installed the XBMC-Live CD (No Linux GUI) to the HDD on my Mac Mini C2D -NVidia 9400, No BootCamp!
This because i only use my Mac Mini as my living room Media Center.

Whenever i need to do something Linux/XBMC related, i use Putty (SSH) in combination with WinSCP (for file Transfers).

In the past i have tried OSX with "VDAdecoder", but High-Def content was never as smooth as Linux with VDPAU.

Thanks to xhbl and teeedubb, i can now also enjoy HD Content with Dolby/DTS in the daytime and the same content with downmixed Audio at night without waking the house.
Big Grin


- erhnam - 2011-05-25

dinosaurjr Wrote:Yes, I Do!
I fully installed the XBMC-Live CD (No Linux GUI) to the HDD on my Mac Mini C2D -NVidia 9400, No BootCamp!
This because i only use my Mac Mini as my living room Media Center.

Did you install XBMC Live side by side OSX or just XBMC Live? How do you install without having Bootcamp installed? Do you have a manual or howto for this?


Install XBMC-Live on Intel Mac Mini - dinosaurjr - 2011-05-25

erhnam Wrote:Did you install XBMC Live side by side OSX or just XBMC Live? How do you install without having Bootcamp installed? Do you have a manual or howto for this?

Don't remember exactly, but if i recall correctly, i just booted the mini from the "XBMC-Live CD" and choose "Install..." and then selected "Use entire Disk...."
Or
I physically removed the HDD, connected it to my windows pc, formatted it, put it back in the Mac Mini, selected "Install...." from XBMC-Live CD menu and selected "Use Entire Disk".

Afterwards, open command by pressing "CTRL+ALT+F6"

get the Apple Drivers for Intel based Mac

[HTML]
"sudo add the repository to /etc/apt/sources.list"
"sudo deb http://ppa.launchpad.net/mactel-support/ppa/ubuntu jaunty main"
"sudo install the ppa key"
[/HTML]

Update the system:
[HTML]
"sudo apt-get update"
[/HTML]

Install the files for the apple computer:
[HTML]
"sudo apt-get install pommed applesmc-dkms bcm5974-dkms"
[/HTML]

• Install Linux ALSA Modules
see: https://wiki.ubuntu.com/Audio/InstallingLinuxAlsaDriverModules

Enable sound in Ubuntu 9.04 for nv9400 based mini
Added the following line to the end of "/etc/modprobe.d/alsa-base.conf":
[HTML]
options snd-hda-intel model=imac24
[/HTML]

Here's Mine:
[HTML]
# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7

# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-ioctl32 ; /sbin/modprobe --quiet --use-blacklist snd-seq ; }
#
# Workaround at bug #499695 (reverted in Ubuntu see LP #319505)
install snd-pcm /sbin/modprobe --ignore-install snd-pcm $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-pcm-oss ; : ; }
install snd-mixer /sbin/modprobe --ignore-install snd-mixer $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-mixer-oss ; : ; }
install snd-seq /sbin/modprobe --ignore-install snd-seq $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; /sbin/modprobe --quiet --use-blacklist snd-seq-oss ; : ; }
#
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; : ; }
# Cause optional modules to be loaded above sound card driver modules
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-emu10k1-synth ; }
install snd-via82xx /sbin/modprobe --ignore-install snd-via82xx $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq ; }

# Load saa7134-alsa instead of saa7134 (which gets dragged in by it anyway)
install saa7134 /sbin/modprobe --ignore-install saa7134 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist saa7134-alsa ; : ; }
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options saa7134-alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
options snd-usb-audio index=-2
options snd-usb-us122l index=-2
options snd-usb-usx2y index=-2
options snd-usb-caiaq index=-2
# Ubuntu #62691, enable MPU for snd-cmipci
options snd-cmipci mpu_port=0x330 fm_port=0x388
# Keep snd-pcsp from being loaded as first soundcard
options snd-pcsp index=-2
options snd-hda-intel model=imac24[/HTML]


create the file "/etc/asound.conf" and add this:
[HTML]
pcm.!default {

type hw
card 1
device 0
}
[/HTML]

NOTE: Card 1 is my additional USB audio card, default onboard should be card 0.
You can check this with "sudo aplay -l".

Here's my "aplay -l" output:
[HTML]
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC889A Analog [ALC889A Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 1: ALC889A Digital [ALC889A Digital]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: default [USB Audio CODEC ], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
[/HTML]

Enable the Apple Remote

Edit LIRC file: "/etc/lirc/hardware.conf"

Here's Mine:
[HTML]
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Apple Mac mini USB IR Receiver"
REMOTE_MODULES=""
REMOTE_DRIVER="macmini"
REMOTE_DEVICE=""
REMOTE_LIRCD_CONF="apple/lircd.conf.macmini"
REMOTE_LIRCD_ARGS=""

#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

#Enable lircd
START_LIRCD="true"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"

#Try to load appropriate kernel modules
LOAD_MODULES="true"

# Default configuration files for your hardware if any
LIRCMD_CONF=""

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""
REMOTE_SOCKET=""
TRANSMITTER_SOCKET=""
[/HTML]

Edit/Create file: "/etc/lirc/lircd.conf"

Here's Mine:
[HTML]
#This configuration has been automatically generated via
#the Ubuntu LIRC package maintainer scripts.
#
#It includes the default configuration for the remote and/or
#transmitter that you have selected during package installation.
#
#Feel free to add any custom remotes to the configuration
#via additional include directives or below the existing
#Ubuntu include directives from your selected remote and/or
#transmitter.

#Configuration for the Apple Mac mini USB IR Receiver remote:
include "/usr/share/lirc/remotes/apple/lircd.conf.macmini"
[/HTML]

Edit/Create file: "/usr/share/lirc/remotes/apple/lircd.conf.macmini"

Here's Mine:
[HTML]
#
# this config file was automatically generated
# using lirc-0.8.2(macmini) on Tue Dec 11 11:35:26 2007
#
# contributed by Sebastian Schaetzel
#
# brand: Apple
# model no. of remote control: A1156
# devices being controlled by this remote: Mac mini, MacBookPro 15"
# SantaRosa (3.1), MacBook2
#

begin remote

name Apple_A1156
bits 8
eps 30
aeps 100

one 0 0
zero 0 0
pre_data_bits 24
pre_data 0x87EE81
gap 211982
toggle_bit_mask 0x0
ignore_mask 0x0000ff01

begin codes
VOLUP 0x0B
VOLDOWN 0x0D
BACKWARD 0x08
FORWARD 0x07
PLAY 0x04
MENU 0x02
end codes

end remote

[/HTML]

Restart the lirc service and test the remote
Check this for more info on the remote: [url]"http://forum.xbmc.org/showthread.php?tid=57158&page=2[/url][HTML]"irw"[/HTML]

I hardly use a remote anymore because of my iTrivia Palmkey , but it's always fun to have everything working.

Reboot Mac Mini, start xbmc:
[HTML]"sudo reboot"[/HTML]
See if your remote is working.

Exit XBMC and go to Command by pressing "CTRL+ALT+F6"

Run the below commands to update the latest version of XBMC.
[HTML]
"sudo add-apt-repository ppa:team-xbmc-svn/ppa"
"sudo apt-get clean"
"sudo apt-get update"
"sudo apt-get install xbmc"
"sudo reboot"
[/HTML]

Exit XBMC and go to Command by pressing "CTRL+ALT+F6"


Apply DUAL AUDIO PATCH

Rename "/etc/lib/xbmc/xbmc.bin" (just in case)
[HTML]
"sudo cp /etc/lib/xbmc/xbmc.bin /etc/lib/xbmc/ORG_xbmc.bin"
[/HTML]

Stop XBMC
[HTML]"sudo service xbmc-live stop"[/HTML]

Replace "/etc/lib/xbmc/xbmc.bin" with the one "teeedubb" posted.
[HTML]
"sudo wget https://dl.dropbox.com/u/22410524/xbmc.bin.tar.gz"

"sudo tar -xvwzf xbmc.bin.tar.gz"

"sudo mv xbmc.bin /etc/lib.xbmc/xbmc.bin"
[/HTML]

Start XBMC
[HTML]"sudo service xbmc-live start"[/HTML]

I think that's about it, check if everything is working in xbmc and continue pimping your XBMC!

Hope the this will get you on you way, Good Luck and just remember: "Google knows all!"


- dinosaurjr - 2011-05-25

Yo Erhnam, I forgot this:

Create a keymap.xml file in "/home/yourusername/.xbmc/userdata" for you apple remote to work correctly in XBMC.

Here's mine:

[HTML]
<GUICalibration>
<joystick name="Apple_A1156">
<button id="5">NextCalibration</button> <!--- Play --->
</joystick>
</GUICalibration>

<VideoMenu>
<joystick name="Apple_A1156">
<button id="6">OSD</button> <!--- Left --->
<button id="3">Left</button> <!--- Left --->
<button id="4">Right</button> <!--- Left --->
<button id="1">Up</button> <!--- Left --->
<button id="2">Down</button> <!--- Left --->
<button id="11">Stop</button> <!--- Left --->
<button id="6">PreviousMenu</button> <!--- Left --->
</joystick>
</VideoMenu>

<MyVideoLibrary>
<joystick name="Apple_A1156">
<button id="6">ParentDir</button> <!--- Menu --->
</joystick>
</MyVideoLibrary>

<MyVideoFiles>
<joystick name="Apple_A1156">
<button id="6">ParentDir</button> <!--- Menu --->
<button id="10">Queue</button> <!--- Hold Right --->
</joystick>
</MyVideoFiles>

<MyVideoPlaylist>
<joystick name="Apple_A1156">
<button id="6">Playlist</button> <!--- Menu -->
<button id="9">MoveItemUp</button> <!--- Hold Left --->
<button id="10">MoveItemDown</button> <!--- Hold Right --->
<button id="11">Delete</button> <!--- Hold Menu --->
</joystick>
</MyVideoPlaylist>

<MyPictures>
<joystick name="Apple_A1156">
<button id="6">ParentDir</button> <!--- Menu --->
</joystick>
</MyPictures>
</keymap>[/HTML]

Also: Create a lircmap.xml file in "/home/yourusername/.xbmc/userdata".

Here's mine:
[HTML]<lircmap>
<remote device="Apple_A1156">
<select>PLAY</select>
<left>BACKWARD</left>
<right>FORWARD</right>
<up>VOLUP</up>
<down>VOLDOWN</down>
<menu>MENU</menu>
</remote>
</lircmap>[/HTML]


Volume - anthony.selby - 2011-05-26

Is there any way to make the volume only work for one of the outputs ?

When I hit the volume keys (in my case on a PS3 bluetooth remote) it changes the volume on both of the audio outputs, it would be great if I could keep the 2nd audio output at 100% and then just control the video on the tv in the other room and just the volume for the primary room

Huh

Thanks


- dd_macle - 2011-05-28

anthony.selby Wrote:Is there any way to make the volume only work for one of the outputs ?

When I hit the volume keys (in my case on a PS3 bluetooth remote) it changes the volume on both of the audio outputs, it would be great if I could keep the 2nd audio output at 100% and then just control the video on the tv in the other room and just the volume for the primary room

Huh

Thanks


I think that needs more work of coding....


- LesMcQueen - 2011-06-02

Just weighing in to say thanks for this patched version.
I chose to build a Windows7 based XBMC machine and was gutted to find that I couldn't output to Analog and Digital at the same the. The prospect of teaching the Missus to manually select outputs in XBMC and Win7 was daunting.

Keep up the great work. :-)