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.32k stars 2.66k forks source link

Every time you launch MuseScore, macOS Sonoma asks about allowing MuseScore to access data from other apps; caused by MuseSampler #19905

Open cbjeukendrup opened 1 year ago

cbjeukendrup commented 1 year ago

Every time you launch MuseScore on macOS Sonoma, the system asks about "allowing MuseScore to access data from other apps". The dialog looks like this: (I only have the Dutch version at hand, sorry)

Scherm­afbeelding 2023-11-01 om 21 10 20

Apparently, more people are experiencing this: https://musescore.org/en/node/356030

My current hypothesis about why this happens is the following: Context: On macOS, apps can be sandboxed. Sandboxed apps cannot read/write files on the user's disk directly; instead, they can only interact with a special folder called ~/Library/Containers. These apps won't notice that though; they just try to interact with normal paths, and macOS routes that to subfolders of ~/Library/Containers. If an app wants to access the user's Desktop folder, then macOS shows a popup asking for permission; if the user allows it, an alias to the Desktop folder is created in ~/Library/Containers, so that the app can read it. If the user disallows, the app cannot see the Desktop folder. FWIW, MuseScore is not sandboxed, so the rules about permissions work a bit differently, but Muse Hub is sandboxed. Anyway, this new macOS Sonoma warning means that MuseScore is trying to read data from another app's sandbox. Which app? The answer turns out to be Muse Hub. Muse Hub downloads all Muse Sounds data to its sandbox folder, and MuseScore reads it from there, albeit via the MuseSampler library (but macOS considers that library as a part of MuseScore if it has been loaded by MuseScore). Evidence: this is a snapshot of MuseScore's main thread at the moment that macOS shows the permission dialog:

Scherm­afbeelding 2023-11-01 om 21 28 09

Solution: Muse Hub should put sounds in a different location. (Also, Muse Hub's container is not the best place for sounds anyway, since containers are user-specific instead of system wide. So if multiple users on one Mac use Muse Sounds, each user will need to install a separate copy of the sounds.)

miostreams commented 10 months ago

Thank you for the tip! I fixed this issue by opening the MuseHub app and moving the libary to my user directory:

  1. Create a folder in your user directory, e.g., /Users//MuseHub
  2. From the MuseHub app, select the gear icon
  3. Under Settings > Sounds install location, select Choose Location... from the drop-down menu
  4. Locate folder you created in step 1
csbubbles commented 1 month ago

Any chance this is going to be fixed on the MuseScore end any time soon? I installed MuseHub a couple days ago, and that permission dialog started showing up every time I open MuseScore. I had no idea what to do, and eventually discovered this via https://musescore.org/en/node/356030. While the workaround provided in this bug works, it doesn't seem right that users have to look for it and do all that stuff manually.

cbjeukendrup commented 1 month ago

I'm not getting this dialog anymore with MuseScore Studio 4.4 and the latest Muse Hub and MuseSampler. What does MuseScore report when you click Diagnotic > MuseSampler > Check MuseSampler?

csbubbles commented 1 month ago

My MuseScore version is: 4.4.2-242570931. The dialog you mentioned shows me: Muse Sampler library is detected, version 0.6.3.

cbjeukendrup commented 1 month ago

Ah, that's the version from Muse Hub v1. If you download Muse Hub v2 from https://www.musehub.com, it should update MuseSampler to version 0.100.3 or so, which does not suffer from this issue.

csbubbles commented 1 month ago

I have the latest Muse Hub (just downloaded and reinstalled it again).

It's still Muse Sampler 0.6.3.

That permission dialog still shows up every time when I open MuseScore.

Now I have got another issue. Every time I open Muse Hub now, it installed Muse Score 4.4.0, so I need install an update (4.4.2) every time I open MuseScore after that. It appears to be another issue apparently, but the main point is that that annoying dialog still persists.

MarcSabatella commented 1 month ago

Most likely you simply have both 4.4.0 and 4.4.2 installed at this point, and you are starting the wrong version. Might be simplest to uninstall both, as well as Muse Hub and at least one of the Muse Sounds, then reinstall. That should clean up whatever weird old stuff is still hanging around. Worst case, manually uninstall Muse Sampler 0.6.3 if it still won't update automatically when redownloading Muse Sounds.

csbubbles commented 1 month ago

It's only one version of the application installed on macOS, as far as I can tell, as every time it's being pushed to the "Applications" folder as "MuseScore 4", and you are even explicitly asked to "replace" the previous one. I am not sure what you mean by saying that two versions might be installed.

Screenshot 2024-09-28 at 11 42 43 AM
csbubbles commented 1 month ago

FYI, I uninstalled Muse Hub completely, and I still keep seeing this every time I launch MuseScore now:

Screenshot 2024-09-28 at 11 44 53 AM
MarcSabatella commented 1 month ago

Presumably you didn't uninstall the sounds, just the installer app. As long as the sounds (and sampler) are still installed, MuseScore Studio will attempt to access them.

As for having two versions installed, I don't have a Mac so I can't speak to specifics, I just know that a handful of other Mac users have reported similar issues and that turned out to be the problem, and the solution I described worked for them. Your screenshot shows you do in fact have 4.4.2 installed, so if you're saying you only have one version then that is correct - that is the most recent. So you probably don't need to do anything else as far as that goes - 4.4.0 is apparently no longer on your system.

csbubbles commented 1 month ago

Presumably you didn't uninstall the sounds, just the installer app. As long as the sounds (and sampler) are still installed, MuseScore Studio will attempt to access them.

I have no idea how to uninstall the sounds, where they are located, and whether there is a dedicated tool for that or if I need to do that manually? Is there some doc/resource that could clarify how to handle that?

So you probably don't need to do anything else as far as that goes - 4.4.0 is apparently no longer on your system.

I am not sure what you mean. I keep seeing the permission dialog every time when MuseScore launches. I still need to figure out how to get rid of the old sound library and install the new one, so hopefully the main issue would go away, right?

csbubbles commented 1 month ago

I'm not getting this dialog anymore with MuseScore Studio 4.4 and the latest Muse Hub and MuseSampler. What does MuseScore report when you click Diagnotic > MuseSampler > Check MuseSampler?

@cbjeukendrup Thanks a lot for filing this bug in the first place, providing a workaround, and also for this comment and your continuous support! The latest version of Muse Hub indeed fixes the issue. It just turned out that there is some kind of a mess with all that installation stuff of all those pieces of the product. Just in case, here is what eventually worked:

  1. Uninstall the older version of Muse Hub
    • If you skip this step and try to install a newer version on top of it, it doesn't work; at least it didn't work for me (the older version was still launching, even after I was quitting it and restarting again)
  2. Install the latest version
    • Nothing changes after this step, and MuseScore will keep showing that annoying dialog every time it launches
  3. Install Muse Sounds in Muse Hub
    • It doesn't seem to be aware of the previously installed versions of Muse Sounds at all, and you need to explicitly request their installation; it's not being fixed on its own

After that, MuseScore starts launching without that permission dialog.

PS I still have no idea where the sound libraries are, and whether the old one is still there, and if I still need to clean it up, though.

MarcSabatella commented 1 month ago

Sounds are uninstalled via the same tool they are installed by - Muse Hub. If Muse Sampler is still reporting 0.6.3 instead of 0.100 or better then yes, you still need to force it to update, and as far as I know removing and reinstalling some sounds is the best way to do that. You could also try manually removing the Muse Sampler file itself, but I'm not sure where it might be located on macOS.

cbjeukendrup commented 1 month ago

I have no explanation for the fact that Muse Hub would seem to install MuseScore 4.4.0... but maybe that was just a temporary weirdness.

On macOS, there are some difficulties with migrating from Muse Hub v1 to v2. This may be hard to believe, but this turns out to be a very complicated task. Under "normal" circumstances, you'd just tell the OS to move the sounds folder from the Hub1 location to the Hub2 location, but because of all those security measures of macOS that get more aggressive with every update, and because of the fact that Hub 1 and 2 work completely differently so are handled completely differently by those security measures, Hub2 can't even see, let alone touch, the files generated by Hub1. (I don't know any details, but it's something like that.)

Therefore, for the time being, you have to manually delete some Muse Hub v1 stuff. See https://support.musehub.com/hc/en-gb/articles/20164564171421-Updating-from-Muse-Hub-v1. And additionally you may want to delete libMuseSamplerCoreLib.dylib from /usr/local/lib. Probably wise to do this after quitting MuseScore and Muse Hub. Then, re-launch Muse Hub, install the sound libraries you want if they are not installed yet, and wait until there are no more active downloads (i.e. no more progress bar at the bottom of the Muse Hub window). Then, you can open MuseScore (hopefully you have received 4.4.2 now!) and everything should be fine again.

Hope this helps! (Edit: I see now your latest comment, that it got already solved, but then it will hopefully help for someone else, or make the situation a bit clearer.)