home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
General Support
[MP1-4838] Volume control no longer functions properly when changing audio device
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Rick164" data-source="post: 1207693" data-attributes="member: 17766"><p>Looked at that and seems we can create a new volume instance but does only help with OSD display but not for the actual volume, think we need a way to re-init it in DirectShowUtil or some event that will trigger if audio device changes (no longer primary).</p><p></p><p>Ideally the volume control should always change it's default Windows audio device if set to "Default direct sound device" but not sure if that can be done easily.</p><p></p><p>[code] private void SetPlaybackDevice(CoreAudioDevice device)</p><p> {</p><p> try</p><p> {</p><p> Log.Debug($"Audio Switcher - setting default playback device to: {device.FullName}");</p><p> device.SetAsDefault();</p><p> Log.Debug($"Device audio connected: {GUIGraphicsContext.DeviceAudioConnected}");</p><p></p><p> if (Settings.LAVbitstreamPerDevice)</p><p> {</p><p> SetLavBitstreamSettings(device.FullName);</p><p> }</p><p></p><p> Log.Debug("Resetting volume control");</p><p> Thread.Sleep(1000);</p><p> VolumeHandler.Dispose();</p><p> Thread.Sleep(1000);</p><p> VolumeHandler.CreateInstance();</p><p> Log.Debug("Volume control reset");</p><p> }</p><p> catch (Exception ex)</p><p> {</p><p> Log.Error("Error occured during SetPlaybackDevice()");</p><p> Log.Error(ex.Message);</p><p> }</p><p> }[/code]</p></blockquote><p></p>
[QUOTE="Rick164, post: 1207693, member: 17766"] Looked at that and seems we can create a new volume instance but does only help with OSD display but not for the actual volume, think we need a way to re-init it in DirectShowUtil or some event that will trigger if audio device changes (no longer primary). Ideally the volume control should always change it's default Windows audio device if set to "Default direct sound device" but not sure if that can be done easily. [code] private void SetPlaybackDevice(CoreAudioDevice device) { try { Log.Debug($"Audio Switcher - setting default playback device to: {device.FullName}"); device.SetAsDefault(); Log.Debug($"Device audio connected: {GUIGraphicsContext.DeviceAudioConnected}"); if (Settings.LAVbitstreamPerDevice) { SetLavBitstreamSettings(device.FullName); } Log.Debug("Resetting volume control"); Thread.Sleep(1000); VolumeHandler.Dispose(); Thread.Sleep(1000); VolumeHandler.CreateInstance(); Log.Debug("Volume control reset"); } catch (Exception ex) { Log.Error("Error occured during SetPlaybackDevice()"); Log.Error(ex.Message); } }[/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
General Support
[MP1-4838] Volume control no longer functions properly when changing audio device
Contact us
RSS
Top
Bottom