flecs icon indicating copy to clipboard operation
flecs copied to clipboard

[Bug]: Windows Audio Channel Reset on Restart

Open cireCloud opened this issue 1 year ago • 12 comments

Preflight Checklist

  • [X] I use the latest version of YouTube Music (Application).
  • [X] I have searched the issue tracker for a bug report that matches the one I want to file, without success.
  • [X] I understand that th-ch/youtube-music has NO affiliation with Google or YouTube

YouTube Music (Application) Version

3.5.3

Checklists

What operating system are you using?

Windows

Operating System Version

Windows 10 22H2

What CPU architecture are you using?

x64

Last Known Working YouTube Music (Application) version

No response

Reproduction steps

  1. Start YouTube Music Player
  2. Change audio output in the Windows "App Volume and device preferences" to different audio device
  3. Restart application

Expected Behavior

After restart to continue play only on chosen device.

Actual Behavior

Plays music on default audio device.

Enabled plugins

Ad-blocker Shortcuts

Additional Information

No response

cireCloud avatar Sep 29 '24 13:09 cireCloud

This is not a bug since it has nothing to do with our code. Since we do not allow you to specify the device used for output...

(correct me if I am wrong)

So you are actually asking for a feature that allows choosing what device to use for output.

ArjixWasTaken avatar Sep 29 '24 20:09 ArjixWasTaken

I reckon it would be much more effort to implement it as a separate feature from scratch than figuring out the root cause of why it cant be used natively by Windows feature

My suspicion is that each time app starts, it might have different metadata or something and Windows thinks its something else and routes it through default output.. I have couple apps used like that and Windows sticks their settings.

Surely not functional code issue, but maybe the way it built. (theory)

As for use cases, it can be connected external speakers or video recordings to not include music, etc.

cireCloud avatar Sep 29 '24 21:09 cireCloud

  • [x] I use the portable version of the YouTube Music Application.

Could you reproduce this issue in the installable version?

JellyBrick avatar Sep 29 '24 22:09 JellyBrick

I have the installed version. i face the same issues. It always switches itself back to my main "windows default" Voicemeeter output device inside Windows sound settings. might be the same issue: https://github.com/th-ch/youtube-music/issues/2357

Gamersven avatar Sep 30 '24 08:09 Gamersven

I reckon it would be much more effort to implement it as a separate feature from scratch than figuring out the root cause of why it cant be used natively by Windows feature

My suspicion is that each time app starts, it might have different metadata or something and Windows thinks its something else and routes it through default output.. I have couple apps used like that and Windows sticks their settings.

Surely not functional code issue, but maybe the way it built. (theory)

As for use cases, it can be connected external speakers or video recordings to not include music, etc.

That makes much more sense, I fully understand why you reported this as a bug instead 👍

ArjixWasTaken avatar Sep 30 '24 13:09 ArjixWasTaken

I have the installed version. i face the same issues. It always switches itself back to my main "windows default" Voicemeeter output device inside Windows sound settings. might be the same issue: #2357

Thanks. Seems that its the way it is built, I wonder if developers of this app can influence them. If not, output option might be not be a bad idea.

cireCloud avatar Sep 30 '24 13:09 cireCloud

It looks like we can specify the audio device for the HTML Element responsible for the music.

Here is the Web API to achieve that. Maybe a plugin could be made that allows changing the output device used.

I really don't know why windows doesn't remember your preferences :(

ArjixWasTaken avatar Sep 30 '24 13:09 ArjixWasTaken

Just wanted to add a Screenshot of this.

In Windows Sound Settings it still is on "Voicemeeter AUX" which is the "Musik" inside Voicemeeter itself. But you can see inside Voicemeeter that the Processes Output is on my "Desktop" Input.

I always have to re-select it so it swapps over to my intended Audio Device.

voicemeeter8x64_mVmFZ6Tf2X

Gamersven avatar Oct 01 '24 19:10 Gamersven

Any update Gents? Not a Windows issue, could the bones it is being compiled with.

Summary: current behavior on each restart is to either change external speaker to default or change this apps audio output to default and back to desired (as shown per screenshot above).

cireCloud avatar Jan 14 '25 18:01 cireCloud

bump still have to change device on each startup for it to work on any other audio output than default

if someone will tell me what dependency it is built upon / causing it, I can create an issue in their github

cireCloud avatar Mar 04 '25 18:03 cireCloud

bump still have to change device on each startup for it to work on any other audio output than default

if someone will tell me what dependency it is built upon / causing it, I can create an issue in their github

I found a janky workaround https://github.com/th-ch/youtube-music/issues/3159#issuecomment-2764646306 if youre still annoyed by this

Bluscream avatar Mar 30 '25 17:03 Bluscream

@Bluscream Thanks for showing this, I made a powershell script that requires only SoundVolumeView.

  1. After downloading it, you drop it inside your Youtube Music folder, for me it's C:\Users\Matis\AppData\Local\Programs\youtube-music and you create an powershell script, I named mine pwrsh.ps1.
  2. Now you write and complete the following powershell script:
# The directory path of your youtube music where your `Youtube Music.exe` and `SoundVolumeView.exe` should be.
$root = "C:\Users\Matis\AppData\Local\Programs\youtube-music"
# This device is an random one or your default device output for force windows to update to the next device.
$deviceID1 = "Voicemeeter Input"
# This device will be used at the end.
$deviceID2 = "Voicemeeter AUX Input"

Start-Process "$root\YouTube Music.exe"
cls

echo "Starting YouTube Music..."
Start-Sleep -Seconds 5

echo "Setting audio output devices..."
& "$root\SoundVolumeView.exe" /SetAppDefault $deviceID1 all "YouTube Music.exe"
echo "Set audio output device to $deviceID1."
Start-Sleep -Seconds 1
& "$root\SoundVolumeView.exe" /SetAppDefault $deviceID2 all "YouTube Music.exe"
echo "Set audio output device to $deviceID2."
exit
  1. Now you copy the shortcut you got in C:\Users\Matis\AppData\Roaming\Microsoft\Windows\Start Menu\Programs and you modify the Target to powershell -WindowStyle Hidden -ExecutionPolicy Bypass -File "C:\Users\Matis\AppData\Local\Programs\youtube-music\pwrsh.ps1".
  2. Launch from the new shortcut, that should output the sound of Youtube Music on $deviceID2 after 6 seconds.

tismatis avatar Apr 14 '25 16:04 tismatis

fixed at #3789

JellyBrick avatar Sep 05 '25 17:09 JellyBrick