SamDel / ChromeCast-Desktop-Audio-Streamer

Stream the sound of your desktop to your Chromecast Audio device
MIT License
411 stars 30 forks source link

Can't set default audio source #101

Closed BrentEubanks closed 2 years ago

BrentEubanks commented 3 years ago

The computer with DAS has two audio outputs, one of them the HDMI to the stereo amp and the other is the Oculus headphone driver.

Whenever I go to start DAS, I find that it has defaulted to the headphones as the output. I've set the amp as the default in Windows, but DAS doesn't seem to recognize it.

So far, the only way I can consistently have the amp as the audio source is to disable the Oculus headphone driver.

Is there some way to explicitly set the order of priority for audio sources, or to force DAS to recognize the windows audio default device settings?

Thanks

SamDel commented 3 years ago

The behaviour should be:

It looks like saving and/or loading the settings goes wrong on your system.

Can you check if the config file exists? It should be here: C:\Users\<username>\AppData\Local\ChromeCast\ChromeCast.Desktop.AudioS_<random>\<version you use>\user.config

If so, can you check if the field 'RecordingDeviceID' has a value? And check if this value changes when you start the application, select another recording device, and close the application?

BrentEubanks commented 3 years ago

Thanks for the reply!

I can confirm that the file exists, and the value in question does change when the audio source for DAS changes.

Based on your description, I think I know what is happening. I think the program is acting as intended, but I have a weird use-case. Maybe you can help me come up with a workaround.

The computer in question is my media/music server. Normally ("at rest") it connects to a monitor via an HDMI output. When in use for media, I turn on the amplifier/receiver and the video automatically re-routes through the other HDMI output which is connected to the receiver.

Based on your description, it doesn't see the second HDMI output to the amp as the default audio device because that device is usually not present on startup.

When I use DAS, I will want to use the amp as the source 99% of the time. So: is there a way to hard-code the sound source in the config file, so that it doesn't change but just looks always to HDMI#2 (even when the connected amp is turned off)?

The more general fix seems like it would be to make DAS re-evaluate what is the "default" audio device each time that windows changes the audio device, rather than just once at startup. I don't know how feasible that is.

On Mon, Apr 19, 2021 at 12:33 AM SamDel @.***> wrote:

The behaviour should be:

  • At first launch the application lists all audio devices, and selects the default (from the sound control panel) rendering device.
  • All next launches the application should select the previous selected audio device (if it still exests).

It looks like saving and/or loading the settings goes wrong in your setup.

Can you check if the config file exists on your system? It should be here: C:\Users\\AppData\Local\ChromeCast\ChromeCast.Desktop.AudioS_\<version you use>

If so, can you check if the field 'RecordingDeviceID' has a value? And check if this value changes when you start the application, select another recording device, and close the application?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SamDel/ChromeCast-Desktop-Audio-Streamer/issues/101#issuecomment-822242835, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGBH5UGB2CPRPUACLRASFVTTJPMDBANCNFSM43EX67FA .

SamDel commented 3 years ago

Thanks!

The more general fix seems like it would be to make DAS re-evaluate what is the "default" audio device each time that windows changes the audio device, rather than just once at startup.

The application polls for new audio devices every 15 seconds. In Setup 3.5.1.zip I changed: When the recording device that was selected in the previous run becomes available after you launch the application the application selects that device.

Hope it works for you!?

BrentEubanks commented 3 years ago

Thanks. I tried it but the app still seemed to prefer the headphones, unless I disabled them. The app was running when it switched - I usually keep it in the tray - so maybe that was the issue?

SamDel commented 3 years ago

Thank you. In Setup 3.5.2.zip DAS really re-evaluates the default recording device when the default device in Windows changes. DAS selects the new default device in the recording device dropdown automatically (maybe an option should be added?) within 15 seconds. Does it work for you?

BrentEubanks commented 3 years ago

Thanks for this. It does appear to be working as intended. Sorry for the delay but I wasn't using the software for a few days.

Brent Eubanks Eubanks Engineering Research Research and Development Consulting for the Built Environment @.***, ‪(510) 463-4348‬

“It’s too late now to save wild nature. What we can do, if we’re lucky, is give it room to save us.” - J.D. Alt, The Architect Who Couldn't Sing

On Sat, Apr 24, 2021 at 3:49 AM SamDel @.***> wrote:

In Setup 3.5.2.zip https://github.com/SamDel/ChromeCast-Desktop-Audio-Streamer/files/6369421/Setup.3.5.2.zip DAS really re-evaluates the default recording device when the default device in Windows changes. DAS selects the new default device in the recording device dropdown automatically (maybe an option should be added?) within 15 seconds. Does it work for you?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SamDel/ChromeCast-Desktop-Audio-Streamer/issues/101#issuecomment-826073899, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGBH5UEKO5YREI64AVLB7DDTKKO4VANCNFSM43EX67FA .

SamDel commented 3 years ago

Nice, thank you! It will also be in version 3.6 (when released).

SamDel commented 3 years ago

Version 3.6

BrentEubanks commented 2 years ago

Not sure if commenting here will re-open the issue, but I guess we'll see..

The issue described in the original thread has recurred, though in a slightly different form. The app now seems to prefer to connect to my webcam microphone as an input source, but I want it to use my computer's audio output as its input.

I change it to the preferred setting, but it keeps changing back, every time I switch inputs via my amp.

This was working fine for quite a while after v3.6. I'm not sure but I think the behavior changed with v3.9.

SamDel commented 2 years ago

There haven't been any changes in this part as far as I can see.

Does the recording device revert right away when you change it? If so, is there a line in the log? (like 'Error initializing the recording device: ...')

BrentEubanks commented 2 years ago

Sorry for the delay.

For context, there are four audio sources. See image. Desktop Audio Streamer sources 1

  1. Webcam microphone
  2. Headphones ("HyperX Cloud Flight")
  3. Monitor speakers ("Acer T232HL")
  4. Surround sound amplifier ("Denon AVR")

However, only three of those should be available at any given time. When the amp is on, the Denon source should be active and the Acer source should be unavailable; when the amp is off, it should be the opposite.

What I've observed is that all four sources appear regardless of the system state. What I suspect is happening is that, upon switching the amp, the app is trying to reattach to a source that is no longer actually available, and winds up grabbing onto the webcam as a source instead.

Also worth noting: This is a different physical computer, though it is configured the same way as previously (I upgraded). However, I did not notice this happening upon the hardware switch; only later did it become apparent.

Does that provide any useful clues?

SamDel commented 2 years ago

I think I understand. An item that was added to the recording devices list once, isn't removed when it becomes unavailable.

In 3.9.1 a recording device is removed from the list when it becomes unavailable. Does that solve your issue?

BrentEubanks commented 2 years ago

Sorry for the delayed response. I tried the new version and so far it is behaving as hoped. I'll let you know if that changes but I think you've got it fixed.

SamDel commented 2 years ago

Thanks, I've created a new release: 4.0. I'm closing this one, feel free to reopen!