Kodi Community Forum

Full Version: AUTOMATIC (and/or manual) AUDIO SWITCHER for different Audio Output
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9
Hello! It's me again...

I was just "playing" a little bit with the new version and I have noticed the following (the numbers are just examples):

- I set music audio volume to 100 in the settings
- I started to play a video an adjusted the audio to 25
- I started to play an album: the audio device is correctly changed as well as the volume (set to 100 according to the settings)
- During the first song I set the volume to 75
- When the second song starts...the volume is set back to 100... Huh

It would be nice it the volume wil change only when passing "from video to music" or "from music to video" and not every time "from file to file" (if I set the volume of the album to X, it is desired to have such volume for all the album).

I think that the same applies for the audio device configuration...right? This could be an improvement.

Sorry, I don't want to be boring, but your addon is foundamental for me and it would be nice to have it as much as better is possible! Nod

- - - Edit - - -

I have made the following tentative but without success (the script fails as soon as XBMC starts): https://copy.com/0ANBrf8onJA3

Just search for the two global variables playing_audio and playing_video...may be some sintax error?
sorry, haven't got much time the last days, but i will try to solve it tomorrow.
yes, the volume will be set everytime you start a file. i will change that (which totally makes sense Tongue)

display the audio device name in the settings is not so easy. first of all i don't know how to grab the device name as displayed in the xbmc/kodi settings. what i can retrieve is the internal device name, which you find in the audiodevice.cfg file. i don't know if this would help you?
the other thing is i don't know how to write the value into the settings.
the only solution i tried on one of my first versions (which weren't released) was to write value for the audio device directly into the settings.xml. it actually worked, but is an ugly hack.
maybe there is a way using "fileenum"....

more to come tomorrow!
Hi marv_el!

Thanks for your usual kind attention!

I think that between the two, the most important modification is related to the volume change (I still tried to implement it but without success...maybe you can give a look to my tentative posted above...).

You can actually forget about the other modification related to the name of the audio device...was just a minor point that popped-up into my mind...don't worry!

Waiting for the new version! I will pass the weekend listening good music thanks to you!

P.S.: Can you implement also to stop the videoplayback at the end of the configuration (as done for the music one)?
Hi axlt,

i added the playback stop after configuration and the volume handling, so the volume will only be set if you change from music to videoplayback or vice versa.
please download and test the new version:
https://www.dropbox.com/s/u951lug2kk30mp...2.zip?dl=0

thanks!
Thanks to you marv_el!!!!

I'm really curious to see which modifications you made to the code... Wink

Keep in touch even if I don't think I will ask you more features in the near future! Angel
feel free to ask ;-)
this addon is kind of a learning project to me.
Sorry for delay in responding:
I reset it up, using the music and a library movie, it now works on both library and non library video & audio.
No idea why when I setup using a non library video it wouldn't switch when viewing a library one.

But many thanks for this add on, makes my move to Gotham much easier.
Great guys.
Working fine now.

Thx
I've been looking for a simple way to toggle "audio/passthrough" on and off.
any ideas please?
(2014-10-28, 14:48)thewarm Wrote: [ -> ]I've been looking for a simple way to toggle "audio/passthrough" on and off.
any ideas please?

automatically for Music and Video? that's possible with my addon.

at least (afaik) you can bind a key to switch it manually.
Hello,
Thanks you for this service plugin. I was actually waiting for something like this to pop up for a long time.

However using Kodi 14 RC1 on a rpi running Openelec this plugin does not work reliably.
I use Airplay from a Mac running OS X Yosemite or a iPad Air with iOS 8.1.1 during configuration of the device for audio.
However after setup is completed the switching to Analoge when playing a Song via Airplay does not work.
If I set if manually it works, so I assume it is not solely related to airplay but it seems to play a role.
Auto switching back to HDMI when I play a Video also works.
Can you confirm it works when using Airplay?

Regards!
Hi, thankx for great addon,this is exactly what I neet. But is there any chance to add switch for PVR (Live TV) not only for video/film and music/audio. When I switch from music to Live TV the output does not change to HDMI e.g.
(2014-12-02, 23:40)realbrian85 Wrote: [ -> ]Hello,
Thanks you for this service plugin. I was actually waiting for something like this to pop up for a long time.

However using Kodi 14 RC1 on a rpi running Openelec this plugin does not work reliably.
I use Airplay from a Mac running OS X Yosemite or a iPad Air with iOS 8.1.1 during configuration of the device for audio.
However after setup is completed the switching to Analoge when playing a Song via Airplay does not work.
If I set if manually it works, so I assume it is not solely related to airplay but it seems to play a role
Auto switching back to HDMI when I play a Video also works.
Can you confirm it works when using Airplay?

Regards!

does it work when you play music without using airplay?
i tried airplay with my ipad 8.1.1 and the switch works. i first didn't hear any music before i realise that xbmc sets the volume level from my ipad (was about 10%).

(2014-12-14, 14:06)slainemcr Wrote: [ -> ]Hi, thankx for great addon,this is exactly what I neet. But is there any chance to add switch for PVR (Live TV) not only for video/film and music/audio. When I switch from music to Live TV the output does not change to HDMI e.g.

xbmc/kodi shouldn't make any difference between live tv or any other video source. can you provide a debug log?
http://pastebin.com/7sza1CZM

(2014-12-14, 21:16)marv_el Wrote: [ -> ]
(2014-12-14, 14:06)slainemcr Wrote: [ -> ]Hi, thankx for great addon,this is exactly what I neet. But is there any chance to add switch for PVR (Live TV) not only for video/film and music/audio. When I switch from music to Live TV the output does not change to HDMI e.g.

xbmc/kodi shouldn't make any difference between live tv or any other video source. can you provide a debug log?
I just tried this addon on Kodi RC3 on a RPi with HifiBerry Digi and it works, but here are a some bugs/feature requests:
1. switching from video to audio does not enable the audio-settings the first time. You have to stop and restart the audio to get the right audio-output device
2. Please add a Message on the screen "Audio Device changed to : xxxxxx (Music)" or "Video" so that the user knows, whats going on.
I'm using the Amber skin, tried with confluence: the same
3. maybe add a audioconfig.xml and videoconfig.xml to userdata, so that the user can see, what settings he applied.

Heres the Log for Nr. 1: http://sprunge.us/WeVV
Pages: 1 2 3 4 5 6 7 8 9