[Bug]: Windows Audio Channel Reset on Restart
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
- [X] I use the portable version of the YouTube Music Application.
- [ ] I can reproduce this issue in the official version of (WEB) YTM.
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
- Start YouTube Music Player
- Change audio output in the Windows "App Volume and device preferences" to different audio device
- 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
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.
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.
- [x] I use the portable version of the YouTube Music Application.
Could you reproduce this issue in the installable version?
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
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 👍
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.
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 :(
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.
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).
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
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 Thanks for showing this, I made a powershell script that requires only SoundVolumeView.
- After downloading it, you drop it inside your
Youtube Musicfolder, for me it'sC:\Users\Matis\AppData\Local\Programs\youtube-musicand you create an powershell script, I named minepwrsh.ps1. - 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
- Now you copy the shortcut you got in
C:\Users\Matis\AppData\Roaming\Microsoft\Windows\Start Menu\Programsand you modify the Target topowershell -WindowStyle Hidden -ExecutionPolicy Bypass -File "C:\Users\Matis\AppData\Local\Programs\youtube-music\pwrsh.ps1". - Launch from the new shortcut, that should output the sound of
Youtube Musicon$deviceID2after 6 seconds.
fixed at #3789