Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

User Image
Parallax Abstraction
34 discussion posts
Hi everyone. Apologies if this was discussed elsewhere but I couldn't find anything about it.

Been a happy DisplayFusion user for a while now. I have a gaming PC that is also hooked up to a home theatre receiver/TV about 50 feet from my desk. I use DisplayFusion to switch between profiles where both my monitors are active for when I'm at my desk and another which has my monitors and the TV active and duplicates monitor 1 to the TV, for when I'm gaming on the couch.

However, I've been dealing with an infuriating problem for a while that I recently discovered to be the fault of Windows 10. DisplayFusion also used to switch the audio device when I would change monitor profiles. So it would output via my sound card to my headset when I was at my desk and switch to my GPU's HDMI audio when I was on the couch. However, for no apparent reason, in Windows 10, Microsoft introduced something that cycles the HDMI device name every time it's reconnected, adding a character to the end of it. So for example, my HDMI device is called DENON-AVAMP. But every time I reboot or power cycle the receiver, it changes between DENON-AVAMP-C, DENON-AVAMP-8, DENON-AVAMP-4 etc. No one knows why it does this and you can't disable it. This confuses DisplayFusion because it's looking for a specific device name and when it can't find it, it won't switch to it. I use the excellent VoiceMeeter Banana to manage my mic mix for YouTube stuff and it also has the ability to redirect your output to multiple devices at once. However, it also relies on the full device name. I've looked into other command line utilities like AudioSwitch but they rely on device ID numbers and you guessed it, those also change every time the device is cycled.

What I was wondering is, would there be a way to add wildcard string support for audio devices to DisplayFusion? My thought is that since only the end of the string changes, this is a problem I could solve by telling it "When I go to HDMI, switch to the first available device with DENON-AVAMP in the name."

This is a weird request I know and I'm no programmer so I have no idea how difficult the implementation would be but this is an issue for basically any user who switches in and out to a TV and uses Windows 10 and if I could solve it, it would be so awesome. Thanks for the great product, keep up the good work!
Jul 31, 2016 (modified Jul 31, 2016)  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
There's actually a scripted function that can do this!
https://www.displayfusion.com/ScriptedFunctions/View/?ID=82012fbb-0c89-42bf-81eb-642d4d1a314f

You can download it by clicking "Download Scripted" on the DisplayFusion Settings > Functions tab. You'll need to modify the "if (device.Contains("SAMSUNG"))" line, to change it to "if (device.Contains("DENON-AVAMP"))"

Hope that helps!

Edit: To make it run automatically for the Monitor Profile, you can use the Triggers feature in the latest DisplayFusion beta. You'd create a Trigger for "Monitor Profile Changed," select the Monitor Profile in the Match Conditions, and then run that function in the actions pane.

Please let me know if you run into any trouble at all.
Aug 3, 2016 (modified Aug 3, 2016)  • #2
User Image
Parallax Abstraction
34 discussion posts
As usual, you guys are way ahead of me. :)

I actually found a command-line utility from NirSoft that does a very similar function but being able to consolidate all this under DisplayFusion would be ideal. I'm definitely going to try this method out and I'll report the result. Thanks so much guys, keep up the great work!
Aug 3, 2016  • #3
User Image
Parallax Abstraction
34 discussion posts
So, this looks like it will work but there's one problem. I downloaded the script and altered it's default string value of SAMSUNG to DENON. I then created a trigger to run the script when I switch profiles to With TV, which is the one I need.

Unfortunately, it appears the script isn't triggering. If I switch to my TV profile, the receiver becomes available but it doesn't get switched to. I know the script works because if after switching, I manually execute the script from the menu, it switches. But it doesn't when I set it to trigger with the profile change. I've attached a screenshot of the trigger I created and as far as I can tell, it's right.

I'm probably missing something obvious. Any ideas?
• Attachment: Audio Trigger.png [28,654 bytes]
Audio Trigger.png
Audio Trigger.png
Aug 4, 2016  • #4
User Image
Parallax Abstraction
34 discussion posts
And problem solved! It turns out it takes my GPU a couple of seconds to recognise the presence of the receiver so the script was triggering too quickly. I added a 3000ms Wait command in front of the script in the trigger list and voila, it works like a charm!

Thanks so much for your help. It's fantastic to have this whole mess that should be simple but isn't thanks to Windows 10, consolidated down to DisplayFusion with Unified Remote to trigger it from my phone. I'm probably going to do a post on my blog with a video on my YouTube channel, explaining this process for people and I'll be recommending they purchase DisplayFusion to accomplish it. Well done all!
Aug 4, 2016  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Awesome, glad to hear it! If you link to your post when you're done, we can add it to https://www.displayfusion.com/Customers too :)
Aug 5, 2016  • #6
User Image
Parallax Abstraction
34 discussion posts
Absolutely will! Thanks again!
Aug 5, 2016  • #7
User Image
Parallax Abstraction
34 discussion posts
So I hate to be a downer here but for reasons I cannot explain, after updating to 8.0 final, the audio switching script no longer works properly. It now switches the Default Communication Device instead of the Default Playback Device. So if I switch to my TV, the output no longer takes over but I can see the green phone icon. I've literally not changed a single thing other than installing the final release of 8.0 and the script is still as follows:

Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
string[] audioDevices = BFS.Audio.GetPlaybackDevices();
foreach (string device in audioDevices)
{
if (device.Contains("DENON"))
BFS.Audio.SetDefaultPlaybackSounds(device);
}
}
}


Any idea if there's something I need to change now? It was all working so well! :(
Aug 8, 2016  • #8
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Strange! When I use that script it works correctly for me. If you run the script manually after switching to the TV, does it work?
Aug 10, 2016  • #9
User Image
Parallax Abstraction
34 discussion posts
So even weirder. If I switch profiles, then manually execute the script, it does switch properly. But whether I have the delay present or not, the same script fails to execute properly when done through the trigger. Kind of at a loss as to why that would be.
Aug 11, 2016  • #10
User Image
Parallax Abstraction
34 discussion posts
I tried deleting the trigger and recreating it. Still no dice. It will work if I run the script manually but through the trigger, it doesn't work. I'm going to try adding other functions and see if they work but yeah, no idea what's up here. This started when 8.0 went final release.
Aug 13, 2016  • #11
User Image
Parallax Abstraction
34 discussion posts
So I've narrowed down the problem. It's nothing to do with the scripted function to switch the audio, it's that the triggers on Monitor Profile Changed just don't work. I tried to create a completely new trigger that just displays a notification when the profile changes to Monitors + TV and it doesn't work either. No matter the triggers, they just aren't triggering. Again, 8.0 final is when this started. Any ideas or am I missing something obvious? Thanks!
Aug 13, 2016  • #12
Keith Lammers (BFS)'s profile on WallpaperFusion.com
I've been able to confirm the same thing here, yep! We've added this to our list to fix for 8.0.1 :)
Aug 19, 2016  • #13
User Image
Parallax Abstraction
34 discussion posts
I feel much better knowing it's not just me. :)

Not a huge deal for now, I can just change the setting manually but I shall wait for 8.0.1 with baited breath. :)
Aug 19, 2016  • #14
User Image
Parallax Abstraction
34 discussion posts
Hey guys. I was just wondering if there was any status on the update that was going to fix that glitch? Still managing but yeah, it'd be nice to have everything automated again. :) Thanks!
Oct 1, 2016  • #15
Keith Lammers (BFS)'s profile on WallpaperFusion.com
We actually just released 8.1 Beta 1 on Friday, and this should be fixed. I hadn't had a chance to follow-up on the resolved tickets yet, sorry :)
Oct 3, 2016  • #16
User Image
Parallax Abstraction
34 discussion posts
Awesome! No worries, was just curious. ☺ I'll grab the beta update tonight and give it a shot.
Oct 3, 2016  • #17
User Image
Parallax Abstraction
34 discussion posts
Hey again! I hate to be the bearer of bad news but the issue persists. However, it took me a while to notice it again and I've narrowed down the cause. I don't power off my gaming PC at night, I just put it into sleep mode. The audio switches reliably in the first session of a new reboot of Windows but after resuming from sleep, only the Default Communication Device changes with the trigger, not Default Audio Device. I'm at a loss to explain why this is how things are working but I hope it can maybe help narrow down the cause of this issue. Thanks again!
Nov 21, 2016  • #18
Keith Lammers (BFS)'s profile on WallpaperFusion.com
That's really strange. Do you have the Communications device assigned to the Monitor Profile in Monitor Configuration > Manage Monitor Profiles?
Nov 24, 2016  • #19
User Image
Parallax Abstraction
34 discussion posts
So I have a bit more information and am happy to say I'm no longer affected by this problem but it's for a real weird reason.

So before, my monitor profiles consisted of one where it was both monitors on my desk and the TV profile left those monitors on but also duplicated the primary display to my TV. When being used that way, the 5.1 switch was not processing after I put my PC to sleep. However, I've since changed things where the TV profile just makes the TV the only display and turns off the PC displays (you also answered my other thread on windows going on the wrong screen when I switch back, thanks!) and with this setup, it switches to 5.1 every time.

I can't explain why this would be the case but there we have it. It doesn't necessarily solve the core problem I was writing about but at the same time, the situation's no longer an issue for me so, good I guess. :)
Nov 25, 2016  • #20
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, thanks for the update! Glad to hear it's at least working for you now. If you run into the original issue again, definitely let me know :)
Nov 25, 2016  • #21
User Image
Josh Harwood
9 discussion posts
So this script is fantastic as my audio devices change their names. However how do I make it so I can switch between 2 wildcard devices instead of one? I am familiar with VBS but not C#. Thanks in advance!
Feb 13, 2017  • #22
User Image
Josh Harwood
9 discussion posts
bump
Feb 14, 2017  • #23
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(1)  Login to Vote(-)