musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
11.87k stars 2.57k forks source link

[MU4 Issue] Playback high pitched when using Surround WASAPI Audio Output (Buffering issue) #17648

Open heisluft opened 1 year ago

heisluft commented 1 year ago

Issue type

General playback bug

Bug description

MuseScore 4 does not handle Surround WASAPI output correctly, the samples intended only for two channels gets split up into all channels (can be seen in my mixer software, see atached video), so when the remaining samples (in my case only 1/4 of all samples (7.1 configuration)) get played pack, it sounds hig pitched and sped up. I discovered this while testing builds for #15235 (Although the issue should persist scince MultiChannel Output was first introduced in #15698.

Steps to reproduce

  1. start a mu4 instance built with code from #15698.
  2. select a multi channel WASAPI output in settings
  3. Playback any note or song
  4. Sounds high-pitched and sped up. In mixing software of the audio device it can be seen that all channels of it receive input, not just the first two.

Screenshots/Screen recordings

https://user-images.githubusercontent.com/30872344/223803798-83b0316b-dd1f-4826-b072-44ac51783762.mp4

MuseScore Version

= 4.0.1

Regression

No.

Operating system

Windows 10

Additional context

No response

cbjeukendrup commented 1 year ago

I had a proof-of-concept fix in https://github.com/musescore/MuseScore/commit/47928a8ae072316b3df2634a2b598d5636a66db4, but it was deemed "not nice" (which I actually agree with. I don't quite see a better solution though.)

bkunda commented 1 year ago

@RomanPudashkin @cbjeukendrup perhaps we need to have a chat about this to discuss for which project we should prioritise it.

Jojo-1000 commented 1 year ago

@cbjeukendrup I already have a prettier fix for this, where I put the channel change in the mixer (so the sound generation still runs on two channels, then the mixer uses that to fill two of the surround channels). I think this is better than trying to make all of the instruments and effects surround-capable. There are still some device change glitches I wanted to fix and didn't get around to, but otherwise it runs fine. If that sounds good to you, I will create a pull request.

cbjeukendrup commented 1 year ago

@Jojo-1000 That certainly sounds good! Would be great if you could open a PR with what you have so far, and then we can look into the device change glitches later.

DmitryArefiev commented 1 year ago

@heisluft Can you check #17669 please if it fixes your issue? Thanks!

heisluft commented 1 year ago

Hey @DmitryArefiev I would like to, however the actions of the PR don't seem to have produced a downloadable artifact and I don't have the ability rn to get a QT installation up & runnning, so I am unable to compile MU myself. Would it be possible to link me an artifact generated by CI?

cbjeukendrup commented 1 year ago

@heisluft Here is the link to download the builds: https://github.com/musescore/MuseScore/actions/runs/5039329182 (To find it, on the pull request page, go to the "Checks" tab and click the Windows check, which should bring you to this download page.)

heisluft commented 1 year ago

Thanks alot! The PR indeed fixes the issue. Looking forward to the release ^^

Also, I find the theoretical Possibility of surround mixes very intriguing, combined with musesounds it'd make for an even better cinematic scoring experience!