Option to choose different audio output device for music and video
#31
(2012-08-03, 20:52)mediumdry Wrote: I managed to create a workaround, by using profiles. I set up one profile "Audio on Speakers" and another profile "Audio on TV" (which is the new name for the master profile). All I did was change the system settings for the Audio on Speakers profile. That still leaves something to be desired. Luckily, Quartz, the skin I use let's you rename the menus, so I named the XBMC menu into the profile name ("P: Speakers" and "P: TV" to make them not scroll).

That still left the switching. There is no easy way to switch a profile in XBMC, but you can add the switch to your favourites:
Code:
<favourite name="P: Speakers" thumb="/path/to/your/image.png">LoadProfile(Audio on Speakers)</favourite>
<favourite name="P: TV" thumb="/path/to/your/image.png">LoadProfile(Audio on TV)</favourite>

After that you simply add that favourite into your menus if your skin allows it, or you look it up in your favourites. Not as nice as automatic, but a workable solution until that time, I suppose.

I too need separate audio profiles and this sounded like a great work around, however I just found out that each profile has separate media libraries, so that means maintaining two libraries does it not? Also if I watch a TV episode on one profile, can I assume that it will only show as watched until the particular profile?

UPDATE:
Problem solved. Found I could change second profile to 'Share with default', so great workaround, thank you mediumdry! Just one question though, what do you mean with "P: TV to make them not scroll"? All I see now is a P: in front of my profile names.

Also does any one know if it's possible to have XBMC start next time with Master profile by default?

UPDATE
I found a problem where by after switching profiles, the favourites no longer worked for that particular profile. When I say no longer work, I mean when you try to bring up favourites, nothing appears, even though favourites.xml is present.

I found a solution here...
http://forum.xbmc.org/showthread.php?tid=129170

(2012-04-17, 17:32)phil65 Wrote: can be added easily to home menu in nox 3.0:
main menu item type = custom
choose item --> enter LoadProfile(profilename)

...so now able to switch profiles nice and quick, and favourites are working fine again for both profiles.

Also of interest Leechguy has created an add-on that has XBMC starting with a profile of your choice.
http://forum.xbmc.org/showthread.php?tid...pid1221004
Reply
#32
(2013-01-29, 21:33)jackhulk Wrote: Just one question though, what do you mean with "P: TV to make them not scroll"? All I see now is a P: in front of my profile names.

In the skin I use, there are only so many characters I can use for any name/shortcut before it starts scrolling/cuts of part of the name. So "Profile: foo" would be too long, but "P: foo" actually fits. That's all Smile

It seems like this is an issue at least shared by a good part of the community!
Reply
#33
Just jumping in to say +1. My case is a different one though. I'd like music to go only to my front speakers but stereo encoded video files to also use the center as this makes voices sound like they come from the screen instead of "floating in the room".

I think that it is a feature most users that have a center speaker would enjoy once they try it and not some esotheric feature for .0001% of users.
Reply
#34
I'd love to be able to specify a different audio output for music as well. It does not have to be in a prominent location since it's not likely something most users need, but it could be implemented like the current audio settings you can call up during movie playback.
Reply
#35
(2012-10-06, 04:59)DDDamian Wrote: Eeks. We can cater to 0.001% of setups or you can just get a real setup.

Sorry, don't mean to sound harsh, but it's really a matter of creating the most usable good experience for the greatest number of users without making it too hard to setup for the odd obscure setup. If we cater to everything it makes for a coding nightmare.

Dual audio is easy to achieve with a decent AVR, as are most of the other requests here. We strive to create a great multimedia experience, but meet us halfway Wink

Hi DDDamian, not everybody have a A/V receiver, and I think this feature could be very helpful to the people that want use xbmc as AIRPLAY for the music and with the tv for the movies. Please consider to add this feature in the future release. For the users that doesn't want go into deep setup feature is enought to put as default only the first audio device in the both settings...

Thank you for consider it
Surfparadise
Reply
#36
I'd also like to add a comment regarding DDDamians post, that this doesn't just effect those without a A/V, as I have an Denon 1906 A/V but still require XBMC separate profiles.

My PC running XBMC is in my office up stairs, where as my TV (connected to that same PC) is in the living room downstairs. My wireless headphones are upstairs (where they are used mainly), and occasionally I like to use them to watch movies in the living room. I plug them in to PC upstairs (sound card switches from digital to analog), but as XBMC is set to 5.1 WASAPI AC3 DTS, I had to keep changing the settings manually (before my workaround above) in order to obtain sound via headphones. However, even with my workaround I still ran in to a few problems, so had to give up on analog output and now output everything digitally.

A simple option for separate audio profiles would be very welcome.
Reply
#37
The add to the different cases:

I personally have a TV connected through HDMI and a stereo connection through analogue audio. I want to control XBMC remotely for playing music through my stereo because I don't want my TV on for just playing music. Movies, on the other hand, should go through HDMI.

A friend of mine wants music through airplay and movies through HDMI for the same reasons.
Reply
#38
patch reposted here http://forum.xbmc.org/showthread.php?tid=145660
Reply
#39
Would it be reasonable to reconsider not including more advanced audio control because most people don't use it now that XBMC has gotten different levels of settings?
Reply
#40
It's less about that and more our lack of audio developers, at this point.
Reply
#41
patch for gotham

Code:
diff --git a/language/English/strings.po b/language/English/strings.po
index faee37d..b172a42 100755
--- a/language/English/strings.po
+++ b/language/English/strings.po
@@ -2257,6 +2257,16 @@ msgid "Audio output device"
msgstr ""

#: system/settings/settings.xml
+msgctxt "#995"
+msgid "Stereo output device"
+msgstr ""
+
+#: system/settings/settings.xml
+msgctxt "#996"
+msgid "Music output device"
+msgstr ""
+
+#: system/settings/settings.xml
msgctxt "#546"
msgid "Passthrough output device"
msgstr ""
diff --git a/system/settings/settings.xml b/system/settings/settings.xml
index c035774..730e3cc 100644
--- a/system/settings/settings.xml
+++ b/system/settings/settings.xml
@@ -2105,6 +2105,22 @@
           </constraints>
           <control type="spinner" format="string" />
         </setting>
+        <setting id="audiooutput.audiodevicestereo" type="string" label="995" help="36371">
+          <level>2</level>
+          <default>Default</default> <!-- will be properly set on startup -->
+          <constraints>
+            <options>audiodevices</options>
+          </constraints>
+          <control type="spinner" format="string" />
+        </setting>
+    <setting id="audiooutput.audiodevicemusic" type="string" label="996" help="36371">
+          <level>2</level>
+          <default>Default</default> <!-- will be properly set on startup -->
+          <constraints>
+            <options>audiodevices</options>
+          </constraints>
+          <control type="spinner" format="string" />
+        </setting>
         <setting id="audiooutput.passthroughdevice" type="string" label="546" help="36372">
           <level>2</level>
           <default>Default</default> <!-- will be properly set on startup -->
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
index 9f01105..1d5b9e3 100644
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
@@ -23,6 +23,7 @@
#include <iterator>

#include "system.h"
+#include "Application.h"
#include "utils/log.h"
#include "utils/TimeUtils.h"
#include "utils/MathUtils.h"
@@ -114,7 +115,7 @@ CSoftAE::~CSoftAE()

IAESink *CSoftAE::GetSink(AEAudioFormat &newFormat, bool passthrough, std::string &device)
{
-  device = passthrough ? m_passthroughDevice : m_device;
+  device = passthrough ? m_passthroughDevice : device;

   /* if we are raw, force the sample rate */
   if (AE_IS_RAW(newFormat.m_dataFormat))
@@ -198,6 +199,8 @@ void CSoftAE::InternalOpenSink()
   bool wasRawPassthrough      = m_rawPassthrough;
   bool reInit                 = false;

+  int m_channels = 0;
+
   LoadSettings();

   /* initialize for analog output */
@@ -247,6 +250,8 @@ void CSoftAE::InternalOpenSink()
       }
     }

+    m_channels = newFormat.m_channelLayout.Count();
+
     /* if the stream is paused we cant use it for anything else */
     if (m_masterStream->m_paused)
       m_masterStream = NULL;
@@ -263,7 +268,23 @@ void CSoftAE::InternalOpenSink()
   if (m_transcode || m_rawPassthrough)
     device = m_passthroughDevice;
   else
+    {
+    if (g_application.m_pPlayer->IsPlayingAudio())
+    {
+    device = m_devicemusic;
+    CLog::Log(LOGINFO, "CSoftAE::device changed to m_devicemusic");
+    }
+    else if (!g_application.m_pPlayer->IsPlayingAudio() && m_channels == 2)
+    {
+    device = m_devicestereo;
+    CLog::Log(LOGINFO, "CSoftAE::device changed to m_devicestereo");
+    }
+    else
+    {
     device = m_device;
+    CLog::Log(LOGINFO, "CSoftAE::device changed to m_device");
+    }
+    }

   CAESinkFactory::ParseDevice(device, driver);
   if (driver.empty() && m_sink)
@@ -523,6 +544,8 @@ void CSoftAE::OnSettingsChange(const std::string& setting)
{
   if (setting == "audiooutput.passthroughdevice" ||
       setting == "audiooutput.audiodevice"       ||
+      setting == "audiooutput.audiodevicestereo" ||
+      setting == "audiooutput.audiodevicemusic"  ||
       setting == "audiooutput.mode"              ||
       setting == "audiooutput.ac3passthrough"    ||
       setting == "audiooutput.dtspassthrough"    ||
@@ -579,8 +602,12 @@ void CSoftAE::LoadSettings()

   /* get the output devices and ensure they exist */
   m_device            = CSettings::Get().GetString("audiooutput.audiodevice");
+  m_devicemusic       = CSettings::Get().GetString("audiooutput.audiodevicemusic");
+  m_devicestereo      = CSettings::Get().GetString("audiooutput.audiodevicestereo");
   m_passthroughDevice = CSettings::Get().GetString("audiooutput.passthroughdevice");
   VerifySoundDevice(m_device           , false);
+  VerifySoundDevice(m_devicemusic      , false);
+  VerifySoundDevice(m_devicestereo     , false);
   VerifySoundDevice(m_passthroughDevice, true );

   m_transcode = (
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
index 5da4c94..92d2bb9 100644
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h
@@ -130,6 +130,8 @@ private:

   enum AEStdChLayout m_stdChLayout;
   std::string m_device;
+  std::string m_devicestereo;
+  std::string m_devicemusic;
   std::string m_passthroughDevice;
   std::string m_deviceFriendlyName;
   bool m_audiophile;

make sure xbmc is using SoftAE, add AE_ENGINE=SOFT in /etc/environment

add your audio devices in ~/.asoundrc and xbmc will list them in your advanced audio settings
Reply
#42
Great to see an update on this one!

Did anyone have a chance to compile and test it? Would this also be applicable on Frodo or does Gotham have specific changes making this easier to implement?
Reply
#43
And it will be useless because softAE will be removed
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#44
"When does the hurting stop?"
Reply
#45
At the same day when the crying stops ...
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply

Logout Mark Read Team Forum Stats Members Help
Option to choose different audio output device for music and video4