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
12.08k stars 2.61k forks source link

[MU4 Issue] Playback is sped up/faster: tempo and pitch are doubled for two-channel playback independent of sample rate #23769

Open ageneric opened 1 month ago

ageneric commented 1 month ago

Issue type

General playback bug

Description with steps to reproduce

  1. Set audio drivers to any sample rate (e.g. 44.1 kHz or 48 kHz)
  2. Start MuseScore Studio
  3. Open any score in MuseScore Studio
  4. Play the score and listen to the beautiful sounds

Actual behaviour vs. expected: Playback is twice as fast, so the tempo is twice as fast and pitch is doubled. Perhaps someone with working playback can check if the sounds decay twice as fast (see supporting videos).

Supporting files, videos and screenshots

44.1 kHz:

RomanPudashkin commented 1 month ago

@ageneric could you please attach your diagnostic files? Diagnostic -> Save diagnostic files

RomanPudashkin commented 1 month ago

Also, please try this build: https://github.com/musescore/MuseScore/actions/runs/9969308796/artifacts/1709471472

Is it better or worse?

zacjansheski commented 3 weeks ago

Closing, no response

ageneric commented 3 weeks ago

Apologies for the late response. My diagnostic files are attached.

Diagnostic files: MuseScore-4.3.2 diagnostics_MU4_4.3.2_23769.zip

Diagnostic files: MuseScore-4.4.0.241990630 build as linked diagnostics_MU4_23769.zip

If it's still relevant, I reproduced the issue on the linked build. It's worse - it seems to have identical playback behaviour when in "Play" mode, but additionally has severe stuttering on note input playback.

ageneric commented 3 weeks ago

I can confirm I still experience the same playback behaviour as described in the original issue in 4.4 Release Candidate (obtained from https://musescore.org/en/node/367322).

May I request for this issue to be re-opened? Or, please let me know if a new issue should be created.

rienheuver commented 2 weeks ago

I'm running into this as well. It happens when I use MuseScore with my headset (Logitech G533) and it's fine when I switch the audio to the speakers of my display monitor (iiyama PL3467WQ). I also tried setting the bitrate to 44.1kHz but that didn't help.

Not sure if relevant: when I change the bitrate of my headset in Windows (11), Musescore won't play back at all anymore until I restart it. Please let me know if I need to add diagnostic info or whatever, I'm willing to help (and have a background in computer science, so am fine with running terminals for example).

RomanPudashkin commented 2 weeks ago

@rienheuver could you please try 4.4 RC? Is it happening there? If so, please attach your diagnostic files (Diagnostic -> Save diagnostic files)

RomanPudashkin commented 2 weeks ago

If it's still relevant, I reproduced the issue on the linked build. It's worse - it seems to have identical playback behaviour when in "Play" mode, but additionally has severe stuttering on note input playback.

@ageneric please try to manually increase the buffer size in Preferences / Audio & MIDI

RomanPudashkin commented 2 weeks ago

@ageneric after looking at your logs, I can confidently say that your issue is another case of this one, but less obvious:

  1. we're trying to run on 2 channels
  2. but your system refuses and starts using 4 channels instead
  3. MuseScore only supports 2 channels, so you get a high-pitched sound

Unfortunately, fixing this problem is not easy. But maybe we should just try to use this workaround (@cbjeukendrup FYI) until we refactor the audio engine properly

rienheuver commented 2 weeks ago

@rienheuver could you please try 4.4 RC? Is it happening there? If so, please attach your diagnostic files (Diagnostic -> Save diagnostic files)

I just tried 4.4 RC and the sound it produces is indeed worse than 4.3, it sort of sounds like it's crashing so bad. I tried buffer sizes of 2048 and 4096 as well. Both seemed to give a very slight improvement over the previous one (so 1024 < 2048 < 4096), but at 4096 it was still far away from workable. My diagnostics are below. Please let me know if there's anything else I can do!

musescore-diagnostics.zip

rienheuver commented 1 week ago

I just downloaded MuseScore 4.2, removed the old versions and installed 4.2 because I need to get on with a project and I can't really with this bug. But as it appears it's broken there too. Any suggestions on what to do @RomanPudashkin ?