MuseScore
MuseScore copied to clipboard
[MU4 Issue] Switching PC audio devices does not affect MuseScore's output audio device
Describe the bug If the output audio device is changed after MuseScore is launched, MuseScore does not honor the change and continues playing out of the device that was selected when MuseScore was launched.
To Reproduce Steps to reproduce the behavior:
- Set your PC's audio output to the default internal speakers
- Launch MuseScore
- Open a score and play something, then stop playback.
- Switch audio devices. For example, connect to a Bluetooth speaker, connect to an HDMI display with a speaker, or plug in a pair of wired headphones (the latter may not work on some laptops)
- Play the score again and the audio plays from the speakers that were active when MuseScore was launched, or doesn't play at all (freezes until play is pressed again). MuseScore must be closed then reopened for the new device to take effect.
Expected behavior Changing the audio device should cause MuseScore to play out of the new device just like other programs do.
Platform information
- OS: Windows 11
Additional context This issue was also present in MuseScore 3; however, it could be fixed without closing and reopening the program by going to Edit>Preferences, then selecting the I/O tab and clicking "Restart Audio Engine." However, this option is not present in MuseScore 4's preferences.
Also, note that in some laptops, the internal speakers are treated as the same device as the headphone jack, in which case this issue may not be apparent when plugging in/unplugging wired headphones.
Works fine on Mac, but not on Windows (Win10). Would be nice to bring back Audio preferences with Restart Audio Engine option (if switching between audio outputs doesn't work in real time)
Thanks for logging!
@DmitryArefiev - is this issue still a problem on Windows? I'm wondering if it can be closed.
@Tantacrul Yes, still occurs in master
And I guess this is hard to fix because we are using WASAPI and not Direct Sound.. but I'm not 100% sure.
I think this probably has to be reprioritised as a P1 if it's not possible to get MuseScore to recognise a new audio-out device.
Even if it could detect it after a restart, it would be something. If not, we'd need a 'detect new audio output' button or something that does the same thing as MS3. Definitely not ideal but better than nothing.
Although one question: can a user at least select the new audio device in Preferences and then it would work?
Or is this simply about automatic updating?
FWIW, the situation in MU3 was never good either.
MU3 pretty much always detects your current default device upon startup and uses that. But if you change devices while MU3 is running, it's a bit of a crapshoot as to whether it would take effect. On my own Linux systems, it works more or less always, instantly, no manual intervention. On Windows systems, it happens automatically "sometimes", but not other times, with no obvious rhyme or reason that anyone has been able to identify. On macOS, what I understand from forum postings over the years is that physically connected devices often work automatically (I think?), but Bluetooth or "virtual" devices (eg, the Zoom audio driver) tend not to.
In any of these cases where it doesn't work automatically, it almost always works to go to Edit / Preferences / I/O and hit the "Restart Audio and MIDI Devices" button. Sometimes you need to explicitly select the desired device in the dropdown, but that varies.
Eventually, sometimes discovered that toggling the "Enable MIDI Input" button on the main toolbar off and then back on had the side effect of forcing a restart of the audio drivers too, and that's now the go-to recommendation any time someone says their system isn't recognizing a new audio device.
Although one question: can a user at least select the new audio device in Preferences and then it would work?
Or is this simply about automatic updating?
@Tantacrul @vpereverzev 1. Yes, user can select new audio device in Preferences and it works (tried on Windows10 with BT Headphones and Audient sound card)
- At the time when bug was created we didn't have an option to select an output audio device in MU (so priority can be changed I guess)
Even after restarting musescore, the audio output device does not change to the system default on my system. I have to select the device in musescore preferences for anything to change. Does musescore store the device it thinks is default between restarts instead of re-reading the system setting?
No, it reads whatever the system reports every time it starts. But as mentioned, some systems do a better job of reporting changes than others. Some only report it for "dumb" programs that use only minimal audio features, others do a more complete job of it, also reporting in a way that "pro" audio applications expect.
@GabeS573 Could you please retest this in 4.0.2? I think it has been fixed by https://github.com/musescore/MuseScore/pull/16438.
I just had a crash connecting Bluetooth Headphones during a session Added a separate issue https://github.com/musescore/MuseScore/issues/17836
OS: Windows 11, Arch.: x86_64, MuseScore version (64-bit): 4.1.0-231510309, revision: github-musescore-musescore-cf13ccc
Closing as stale / possibly fixed by https://github.com/musescore/MuseScore/pull/16438