xenolightning / AudioSwitcher_v1

Version 1 of Audio Switcher
Microsoft Public License
894 stars 90 forks source link

Quick switch for reconnected devices #2132

Closed StefanLuthardt closed 6 years ago

StefanLuthardt commented 8 years ago

Hi xenolighting! I really like AudioSwitcher, it is a great helper! Sadly I does not really support so nicely my setup: I use Audioswitcher to switch between the laptop speakers, the sound system (connected via bluetooth) and my TV-Audio (connected via Display-Port). So here comes the issue: When AudioSwitcher starts up, the later two audio-devices are usally not available (have to reconnect them first) which affects their favorite-status and makes it impossible to use the quick switch feature for them. Even though they were are marked as favorite before, they are now no favorites anymore. But they seem to keep there id (see AudioSwitcher.json.txt, hotkey section; for the hotkey-switching the reconnection works)

I see two solutions for this issue:

  1. add a option to use quick-switch for all devices (favorite or not)
  2. recognize the reconnected devices and keep there favorite status

I would be very happy, if you could fix that in a future version!

RickDB commented 8 years ago

Noticed this issue in my Mediaportal plugin for it as well, had to add this workaround for now:

https://github.com/RickDB/MP1-AudioSwitcher/commit/a9d22e5928a3e1b1621ede5636d234e41fb3c2f0

Seems that you have to re-create the CoreAudioController in some cases (AVR reconnects as well) as it will not return the proper device names but indeed retain their ID, other option was to store the ID not the name but either way not perfect. Hopefully this can get fixed in the library :)

xenolightning commented 8 years ago

I think there's two issues here. One that's known about.

I believe @StefanLuthardt is experiencing an issue where Windows thinks all new/reconnected devices should get new Id's. It happens outside of AudioSwitcher, and at the operating system level. Sadly there is no "good" way around this problem, you could favourite "Device Names", but then devices can have the same name too.

@RickDB The bug you found is a lot more interesting! Can you raise an issue in the Api repo? https://github.com/xenolightning/AudioSwitcher

Please attach the version you are using. I know there was some issues in earlier versions with not updating the properties correctly when triggered by the system. This should be resolved in the v4.0 of the api.

RickDB commented 8 years ago

@xenolightning

Issue added :)

https://github.com/xenolightning/AudioSwitcher/issues/27

andrewpros commented 8 years ago

So when it will be fixed, i have the same problem, second hdmi screen i snot connected the whole time, but when it reconnect it is no longer fav device, so quick switch won't work.

Regardless of the issue fix i think that the software should also have an option to just use quick switch for all devices, most people have just like 2, 3, so it would make sense for most to just use that.

andrewpros commented 7 years ago

@xenolightning

Any progress on this?

cybersteel8 commented 7 years ago

Hi, is there any progress on this? I have the issue with my USB headset. I have speakers plugged in all the time, but my USB headset often plugs in and out whenever I use it, but the favourite status always resets. In addition to this, I find I have to restart Audio Switcher every time I plug my USB headset in, as it appears as Unknown instead of the correct device.

xenolightning commented 7 years ago

The unknown bug will be fixed with the next version.

I'm exploring the option of enabling quick switch for all playback devices when no favourites are selected. It seems like a fairly reasonable solution to the underlying ID problem.

andrewpros commented 7 years ago

@StefanLuthardt @xenolightning

Well, looks like this project is dead, almost year and this is still not resolved, i've been forced to install other software.

cybersteel8 commented 7 years ago

@andrewpros Hi, what other software are you using? This problem indeed still remains, so if you found the solution elsewhere I'd love to use that too.

andrewpros commented 7 years ago

@cybersteel8 Well i changed to https://github.com/sirWest/AudioSwitch

Not ideal, but when i constantly enable/disable speakers output devices it finds them automatically and i can quickly change it.

Funny thing is that windows 10 has now the ability to quick switch output device from audio tray icon, its almost fine, but you need expand it every time... so there is 1 vs 3 clicks.. i'm soooo damn lazy...

xenolightning commented 7 years ago

@andrewpros The project isn't dead. This project is entirely funded by donations, which is totals about USD$10 per month, and in my SPARE time.

Expecting functionality to be added to a mostly unfunded, open source project is naive at best.

The great thing about open source, is that anyone can fix this issue. Maybe even you.

You don't have to use it, I'm not forcing you.

andrewpros commented 7 years ago

@xenolightning

Well i get it but the problem remains the same, i can't fix this, it doesn't work, you can't hope everyone is a great programmer who know everything and will fix what you can't.

So the issue is there, no update in almost year, dead for me.

As for now i have a code snipped in c# to monitor the device IDs and if they changing when reconnecting, i run this now and then and i just wait for some confirmation to happen.

Other thing is i know how to make it without bothered by the ids even if they change, but if i made a PR i have no guarantee that you will accept that code as it could not be the way you like it to see and how the code would work.

xenolightning commented 7 years ago

Monitoring the device id's would be awesome 👍 Might get a little more context around the devices, and why they get assigned new Id's.

I'm not too bothered about the "quality" of the code, the code in this project is a little wacky anyway. As long as it makes sense and isn't entirely unreadable then that' should be ok for me.

I might have time on my Saturday (NZT) to have a look and help you out.

andrewpros commented 7 years ago

@xenolightning

Well my idea is simple, if we can't relay on device IDs then there is a need for an all active output devices quick switch.

It at least gives us the possibility to iterate over available devices.

It should just get all current devices list and activate the next one, regardless what ID it was or is now, doesn't matter, as it work in a "current situation" mode, means, it doesn't relay on any saved ids.

If the reconnection change ID issue is true, then this is the only way.

And as of now i can confirm that my monitor script had detected a device ID change, this is real. It was due to installing new NV driver with HDMI audio output, this changed the ID.

But this happens randomly, even when you do nothing, so if there is no other ID we can use...

andrewpros commented 7 years ago

@xenolightning

I can also confirm that https://github.com/sirWest/AudioSwitch has the same issue after all, there is no way to prevent device id change and there are no other device ids on windows that can be used, but hence it just iterates over available devices on click, it works without reconfiguration.

xenolightning commented 7 years ago

Not closed, but fixed in the next version

andrewpros commented 7 years ago

Thx, i see this will cycle thru available audio devices. There is nothing we can do more.

bondt commented 7 years ago

Would it be helpful to be able to manipulate the list of active, so we can "hide" certain devices. That way, when cycling through reconnected devices will be a clean list. I have the same issue as described by @cybersteel8 and added to that some devices I don't need to manually switch to.

Example: Active devices list: 1. headset jack on monitor, 2. some speakers option I never use, 3. some other installed device I've never heard of, 4. a USB headset I use once a week and 5. desktop jack. My active devices are actually only 1, 4 and 5. 4 is often disconnected, but I'd still like to have it in the list. So by excluding 2 and 3, my active devices will always be as I expect them to be.

How about that? :-)

xenolightning commented 7 years ago

I don't know about an active list as such. Seems like a hard thing to manage when there a new devices being added.

You can always disable audio devices you don't use either in the standard sound menu, or via device manager. Audio Switcher respects these.

andrewpros commented 7 years ago

@bondt

As stated, windows do not provide unique audio device ids, this option is possible, but it will work only till windows don't change the ids again.

So basically it is the same as disabling 2, 3 in windows options and you will have the same result.

bondt commented 7 years ago

Sounds fine by me!

@xenolightning, when is this next release with the cycling? :-)

xenolightning commented 6 years ago

Released! 1.8.0.142

xD

😺