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.19k stars 2.64k forks source link

Wrong duration and stuttering sound when open WAV files on Linux (WAV files exported from MS4 have weird properties) #23606

Closed PEM-FR closed 2 months ago

PEM-FR commented 3 months ago

Issue type

File corruption

Description with steps to reproduce

I have no idea how to reproduce this. It seems I have a few files that will not upload on Musescore.com and after contacting them they only told me the files were corrupted and I should contact you instead... When I tried exporting my file to .wav I realized the player reports 17:05 when the file is about 8:23... I tried to select some bars and save them as a new score, then export the sub-selection... same result, the duration has been reported wrongly.

I am currently using Musescore nightly 2024-07-11 revision 1efba9e I can play the file, open it, modify it and close it, but the duration is exported wrongly (though the player in the app reports the proper time).

Supporting files, videos and screenshots

Here is one of the files The Ifrits Redemption.zip

What is the latest version of MuseScore Studio where this issue is present?

1efba9e

Regression

No.

Operating system

Ubuntu 22.04 LTS 64 bits

Additional context

I have no idea if this could be related but : I have used a Bass Drum Staff with Muse Sound Taikos. I have used a lot of grace notes

I have tried removing all measures after the first and the export still report wrong durations. I tried removing grace notes and export again, same problem.

Checklist

PEM-FR commented 3 months ago

@cbjeukendrup To add a little more information, I recently discovered that exporting the file to mp3 320bps 44.1Khz gives a duration of about 8:36 while exporting to wav gives a duration of about 17:05 Might have something to do with exporting wav files...

zacjansheski commented 3 months ago

Only reproducible on Linux. Export works as expected on Windows and Mac

cbjeukendrup commented 3 months ago

Hm... In that case I'm afraid I'm not the best person to solve this because I don't have Linux.

zacjansheski commented 3 months ago

@Eism I can reproduce this with any score. Notice how the .wav file has silent gaps in it when playing LinTestShort.zip

No change with different sample rates

zacjansheski commented 3 months ago

Same results in all versions of 4

PEM-FR commented 3 months ago

@zacjansheski I could not upload on musescore.com since about April. I think the last working version I still have on my computer would be a nightly build of 2024-03-23 I think (does not mean it is the last working one, but it was working). The 2nd of May's version was already not exporting properly anymore. I do not know if this can help.

This is a big problem for Linux users as they can no longer publish on musescore.com because of this bug.

I tried importing the mscz file to the website directly but does not work any better. Does the website also use linux to generate the wav files? IF not, then it probably means that some data in the xml makes the wav exporter go crazy and that the mp3 exporter does not seem to handle or care about this. I tried opening the xml file but I have no obvious error, the xml seems to be properly formatted (no missing end tags or no broken tags or so it seems).

In foobar2000, Export to wav: 17:05 Export to MP3: 8:33 Export to FLAC: 8:32 Export to ogg: 8:30

As a side-note: I tried importing the exported wav into foobar2000 (it can play the file, but the time reported is wrong and when the audio reach the unexisting range the player stops). I tried importing the exported wav into audacity (it works). Audacity seems to not "care" about the wrong time report, I could modify the file (for example fade-in and fade-out) and export to wav again without any problem.

PEM-FR commented 3 months ago

Changed the name to be more precise and dev friendly. As consequence of this problem :

zacjansheski commented 3 months ago

There's a few things to investigate here: I can upload to musescore.com on Linux with other scores. It is odd, I only can't upload that score only on linux, I can upload it from other OS's. musescore.com uses mp3s, for audio. When testing with earlier versions of MS4... https://github.com/musescore/MuseScore/releases I get the same results on Linux, so either wav export was broken for a long time (which seems suprising) or there is something more widespread happening.

PEM-FR commented 3 months ago

@zacjansheski I hope this will help (I am way behind publishing schedule because of this, unfortunately)

I have another score that cannot be uploaded on musescore.com Maybe it can help pinpoint the problem? (or maybe it is something entirely different altogether...) Requi-aime.zip

Considering the website is generating mp3's it seems that the problem comes from the mscz package then. Could it be related to using images as covers? (but I already uploaded other scores with images in them without problems)

One thing I kind of realized on musescore.com when uploading : after submitting the form, if I go in My Scores menu and the parts are 0, pages are 0 and time is 00 then it means the upload failed. So there seem to be a parsing problem where some data does not match with expectations and we are met with some silent error. Screenshot from 2024-07-19 11-31-11

yukraya commented 2 months ago

Same problem on Windows 11. (latest nightly build and musescore 4.3.2)

WAV - 50s MP3 - 25s OGG - 24s FLAC - 25s

all files.zip (.mscz + all audio exports)

zacjansheski commented 2 months ago

@yukraya I am neither reproducing, nor seeing what you are reporting. the wav file you attached is 25s exporting the .mscz to .wav is 25s

Screenshot 2024-08-01 145053

yukraya commented 2 months ago

@zacjansheski I should have specified that I use VLC! (the bug does not appear with the Windows audio player) I'm here if you have any further questions.

Capture d'écran 2024-08-01 211331

zacjansheski commented 2 months ago

How strange!

When I play in VLC, the timer is going twice as fast, so the track is still around 25s, but the timer reads 50s

https://github.com/user-attachments/assets/d0c3a361-5da2-44ce-b54f-fb763ef46e35

zacjansheski commented 2 months ago

Also, still same results in all versions of 4

PEM-FR commented 2 months ago

So we may have two different problems in this Issue (both might be related to the same thing though):

  1. Upload to musescore.com does not work due to a corruption on the score provided in Issue description.
  2. Export to wav seems to be bugged, something related to timing / tempo / clock.

Problem 1 might be caused by problem 2, but they may also be two separate issues. I would say that the corruption that blocks upload on musescore.com is a major problem whereas the time report (if unrelated) can be fixed by loading in audacity, modifying the wav a bit then exporting to wav again.

DmitryArefiev commented 2 months ago

The bug here is something wrong with WAV files exported from MS4. You can export WAV files in MS4 from other OSs and get the same result when open on Linux (and VLC on Windows)

In MS3 or MS4 you can't select the bit depth

MS3 exports wav with these parameters: 16bit and 1411kbps Audacity exports wav (if you select 32bit float) with these parameters: 32bit float and 2822kbps but MS4 exports wav with these: 32bit float and 1411kbps (one of these is wrong)

Screenshot from 2024-08-02 19-06-28 Screenshot from 2024-08-02 19-10-38 Screenshot from 2024-08-02 19-07-01

FYI @mathesoncalum

PEM-FR commented 2 months ago

@DmitryArefiev Cool, seems you've found the export problem 👍🏻 Any idea regarding the corruption of the scores shared and why they cannot be uploaded in musescore.com? IF the wav export is due to a mismatch between bit depth and bit rate, I feels unlikely to be causing problems to musescore uploads

DmitryArefiev commented 2 months ago

@PEM-FR I was not able to reproduce it on my LinuxUbuntu with the attached score.. Can you try it again on latest master please? But keep in my mind we haven't updated the backend yet, so 4.4 scores will not be displayed on musescore.com

PEM-FR commented 2 months ago

@DmitryArefiev I have tried with latest nightlies 2024-08-06, 05, 04 have error messages cannot connect to MuseScore.com Tried with older 2024-07-11 can connect to musescore.com but score falls into infinite processing.... (the support team, after two month of trying to get an answer told me the score was corrupted with no further information and that I should contact you guys here).

Tried with nightly 2024-08-01 seems to upload. Infinite processing....

Both scores I shared gets into infinite processing on the website. This happened since April 😭 The Ifrit score was supposed to be released in May with a share on youtube and I am waaaaay behind schedule because of this. I have no information about how to fix the scores either nor why musescore.com thinks it is corrupted.

Man, I'm desperate 🥲 this is just a little part of my attempts.... Screenshot from 2024-08-06 17-12-39

DmitryArefiev commented 2 months ago

I have tried with latest nightlies 2024-08-06, 05, 04 have error messages cannot connect to MuseScore.com

@PEM-FR I still can't reproduce it on my LinuxUbuntu 22.04.4 LTS.. But please log it as a separate issue

Tried with older 2024-07-11 can connect to musescore.com but score falls into infinite processing....

As I mentioned already, unfortunately musescore.com backend is not updated to 4.4 yet, and scores created in 4.4 will not be published (rendered) properly on musescore.com. Please wait until the beta release (it's planned in 1-2weeks)

DmitryArefiev commented 2 months ago

The Ifrit score was supposed to be released in May with a share on youtube and I am waaaaay behind schedule because of this.

@PEM-FR If you don't want to wait until beta.. You can sent to me the urgent scores, I'll make 4.3.2 versions of them and you will be able to publish them from 4.3.2. But please be aware that some elements (or playback) will not be the same as in 4.4.

PEM-FR commented 2 months ago

@DmitryArefiev

I have tried with latest nightlies 2024-08-06, 05, 04 have error messages cannot connect to MuseScore.com

@PEM-FR I still can't reproduce it on my LinuxUbuntu 22.04.4 LTS.. But please log it as a separate issue

Tried with older 2024-07-11 can connect to musescore.com but score falls into infinite processing....

As I mentioned already, unfortunately musescore.com backend is not updated to 4.4 yet, and scores created in 4.4 will not be published (rendered) properly on musescore.com. Please wait until the beta release (it's planned in 1-2weeks)

I also use Ubuntu, same version, with X11 though (would that make a difference?).

Also, I can wait for beta if it is around the corner? Because, on linux at least, 4.3 versions had glitches in the playback that 4.4 improved so if possible, I'd rather wait a bit more and export a "better sounding" version if it's within a few weeks. If beta is for December though, I'd gladly accept your offer (or if you have directions to give to do so, I probably would be able to follow them so you can save the hassle of doing so yourself).

I still have no idea about what musescore.com does not like about my scores and why they end up processing indefinitely... I wish they could give some error message that would at least give us a hint about what's happening (like oboe measure 47 is corrupted, cannot process score).

DmitryArefiev commented 2 months ago

I also use Ubuntu, same version, with X11 though (would that make a difference?).

@PEM-FR I'm using Ubuntu with Wayland. Yes, it could be the reason (the bug can be on Ubuntu side or on MuseScore integration with Ubuntu side)

Please try the latest master and if you still have cannot connect to MuseScore.com (but the old builds worked fine) then log a bug for that

DmitryArefiev commented 2 months ago

Also, I can wait for beta if it is around the corner? Because, on linux at least, 4.3 versions had glitches in the playback that 4.4 improved so if possible, I'd rather wait a bit more and export a "better sounding" version if it's within a few weeks.

@PEM-FR Yes, don't worry. It should be soon!

PEM-FR commented 2 months ago

I also use Ubuntu, same version, with X11 though (would that make a difference?).

@PEM-FR I'm using Ubuntu with Wayland. Yes, it could be the reason (the bug can be on Ubuntu side or on MuseScore integration with Ubuntu side)

Please try the latest master and if you still have cannot connect to MuseScore.com (but the old builds worked fine) then log a bug for that

@DmitryArefiev

I tried with 2024-08-09 nightly and it can connect to MuseScore.com this time (the connection problem is resolved apparently). The "corruption" bug with score processing eternally is still there though.

DmitryArefiev commented 2 months ago

I tried with 2024-08-09 nightly and it can connect to MuseScore.com this time (the connection problem is resolved apparently).

@PEM-FR Cool! Then no need for bug

The "corruption" bug with score processing eternally is still there though.

OK. Let's wait for beta and then re-check

DmitryArefiev commented 2 months ago

@PEM-FR Hi! The beta is ready and the backend is updated! Please try to Publish your scores

https://musescore.org/en/node/367021

PEM-FR commented 2 months ago

@DmitryArefiev it worked :) https://musescore.com/user/28188455/scores/17053372

Thank you! Now i just have to wait for the send to youtube to be fixed 🥲