mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.28k stars 2.9k forks source link

App bundle on macOS Sonoma won't open on start and immediately quits (code signing) #12116

Closed NathanielH-snek closed 11 months ago

NathanielH-snek commented 1 year ago

mpv version and platform versions

Macos Sonoma 14 Public Beta MPV 0.36 If you're not using git master or the latest release, update. Releases are listed here: https://github.com/mpv-player/mpv/releases

Reproduction steps

Describe the reproduction steps as precise as possible. It's very likely that the bug you experience wasn't reproduced by the developer because the workflow differs from your own.

Follow the steps detailed here for a static build:
'https://gist.github.com/dbrookman/74b8bcfb37a23452f7137b83bca9580f

Expected behavior

Results in a build that is apple silicon native and opens normally

Actual behavior

App bundle will not open at all. Seems there is either some versioning issue or it is failing to fetch the correct api.

Log file

meson-log.txt

Upload meson-logs/meson-log.txt or meson setup build output to https://0x0.st/ or attach it to the github issue, and replace this text with a link to it.

The issue will be closed for ignoring the issue template.

Akemi commented 1 year ago

try without homebrew.

mike-hearn commented 1 year ago

Piggybacking on this issue. Previous x86 builds on Mac worked fine running through Rosetta (e.g. builds from https://laboratory.stolendata.net/~djinn/mpv_osx/), but I also installed the Sonoma beta and these builds now have the same behavior that OP described where it closes instantly upon open.

I can run the mpv binary from inside the app bundle without any problem.

Here are the mpv logs from the MacOS console:

default 16:30:00.633377-0400    mpv [0x7fbf3a0105c0] activating connection: mach=true listener=false peer=false name=com.apple.cfprefsd.daemon
default 16:30:00.633443-0400    mpv [0x7fbf39708820] activating connection: mach=true listener=false peer=false name=com.apple.cfprefsd.agent
default 16:30:00.638887-0400    mpv [0x7fbf3970aeb0] activating connection: mach=true listener=false peer=false name=com.apple.distributed_notifications@Uv3
default 16:30:00.644304-0400    mpv [0x7fbf3a010a20] activating connection: mach=true listener=false peer=false name=com.apple.tccd.system
default 16:30:00.805488-0400    mpv [0x7fbf3a010a20] invalidated after the last release of the connection object
default 16:30:00.805779-0400    mpv server port 0x00003c07, session port 0x00003c07
default 16:30:00.821177-0400    mpv [0x7fbf3a0132d0] activating connection: mach=true listener=false peer=false name=com.apple.coreservices.launchservicesd
default 16:30:00.822616-0400    mpv [0x7fbf3a106fb0] activating connection: mach=true listener=false peer=false name=com.apple.analyticsd
default 16:30:00.823528-0400    mpv Received configuration update from daemon (initial)
default 16:30:00.825963-0400    mpv New connection 0x2db503 main
default 16:30:00.831231-0400    mpv CHECKIN: pid=36248
default 16:30:00.838488-0400    mpv CHECKEDIN: pid=36248 asn=0x0-0xe39e39 foreground=1
default 16:30:00.839140-0400    mpv [0x7fbf3a1179f0] activating connection: mach=true listener=false peer=false name=com.apple.lsd.modifydb
default 16:30:00.839493-0400    mpv [0x7fbf3a014440] activating connection: mach=false listener=true peer=false name=(anonymous)
default 16:30:00.840492-0400    mpv [0x7fbf3a10c550] activating connection: mach=false listener=false peer=true name=com.apple.xpc.anonymous.0x7fbf3a014440.peer.0x7fbf3a10c550
default 16:30:00.843350-0400    mpv FRONTLOGGING: version 1
default 16:30:00.843399-0400    mpv Registered, pid=36248 ASN=0x0,0xe39e39
default 16:30:00.844041-0400    mpv [0x7fbf3a10fae0] activating connection: mach=true listener=false peer=false name=com.apple.lsd.mapdb
default 16:30:00.848021-0400    mpv BringForward: pid=36248 asn=0x0-0xe39e39 bringForward=1 foreground=1 uiElement=0 launchedByLS=1 modifiersCount=1 allDisabled=0
default 16:30:00.848212-0400    mpv BringFrontModifier: pid=36248 asn=0x0-0xe39e39 Modifier 0 hideAfter=0 hideOthers=0 dontMakeFrontmost=0 mouseDown=0/0 seed=0/0
default 16:30:00.848402-0400    mpv BringForward: pid=36248 asn=0x0-0xe39e39
default 16:30:00.848520-0400    mpv SetFrontProcess: asn=0x0-0xe39e39 options=0
default 16:30:00.861219-0400    mpv Current system appearance, (HLTB: 1), (SLS: 0)
default 16:30:00.865076-0400    mpv No persisted cache on this platform.
default 16:30:00.868257-0400    mpv Current system appearance, (HLTB: 1), (SLS: 0)
default 16:30:00.869313-0400    mpv Post-registration system appearance: (HLTB: 1)
default 16:30:01.022985-0400    mpv SetFrontProcess: asn=0x0-0xe39e39 options=0
default 16:30:01.036566-0400    mpv Registering for test daemon availability notify post.
default 16:30:01.036865-0400    mpv notify_get_state check indicated test daemon not ready.
default 16:30:01.037028-0400    mpv notify_get_state check indicated test daemon not ready.
default 16:30:01.037168-0400    mpv notify_get_state check indicated test daemon not ready.
default 16:30:01.045448-0400    mpv Set: origin-Mac-1280262988/client-io.mpv-36248/player-MediaRemote-DefaultPlayer setting ActivePlayerPath to <<private>>
default 16:30:01.045674-0400    mpv Request: setNowPlayingPlayer<532B3403-5B4D-4B6D-8F6F-86483CEAE2C1> for origin-Mac-1280262988/client-io.mpv-36248/player-MediaRemote-DefaultPlayer because New player origin-Mac-1280262988/client-io.mpv-36248/player-MediaRemote-DefaultPlayer was added
default 16:30:01.046432-0400    mpv [0x7fbf39755490] activating connection: mach=true listener=false peer=false name=com.apple.mediaremoted.xpc
default 16:30:01.046860-0400    mpv MediaRemote server initializing
default 16:30:01.050028-0400    mpv [0x7fbf39765ad0] activating connection: mach=true listener=false peer=false name=com.apple.coreservices.appleevents
default 16:30:01.053262-0400    mpv SignalReady: pid=36248 asn=0x0-0xe39e39
default 16:30:01.054847-0400    mpv SIGNAL: pid=36248 asn=0x0x-0xe39e39
default 16:30:01.058975-0400    mpv [0x7fbf3a12c6f0] activating connection: mach=true listener=false peer=false name=com.apple.pasteboard.1
default 16:30:01.071070-0400    mpv Initializing connection
default 16:30:01.071244-0400    mpv Removing all cached process handles
default 16:30:01.071429-0400    mpv Sending handshake request attempt #1 to server
default 16:30:01.071576-0400    mpv Creating connection to com.apple.runningboard
default 16:30:01.071799-0400    mpv [0x7fbf397783a0] activating connection: mach=true listener=false peer=false name=com.apple.runningboard
default 16:30:01.073261-0400    mpv Handshake succeeded
default 16:30:01.073285-0400    mpv Identity resolved as app<application.io.mpv.122471391.122471401(501)>
default 16:30:01.067768-0400    mpv NSApp cache appearance:
-NSRequiresAquaSystemAppearance: 0
-appearance: (null)
-effectiveAppearance: <NSCompositeAppearance: 0x7fbf3a007100
 (
    "<NSAquaAppearance: 0x7fbf3a2072c0>",
    "<NSSystemAppearance: 0x7fbf3972a0a0>"
)>
default 16:30:01.082778-0400    mpv [0x7fbf3a15a1c0] activating connection: mach=true listener=false peer=false name=com.apple.window_proxies
default 16:30:01.082907-0400    mpv [0x7fbf3a15a1c0] invalidated on xpc_connection_cancel()
default 16:30:01.083162-0400    mpv Entering exit handler.
default 16:30:01.083175-0400    mpv Queueing exit procedure onto XPC queue. Any further messages sent will be discarded. activeSendTransactions=0
default 16:30:01.087033-0400    mpv Response: setNowPlayingPlayer<532B3403-5B4D-4B6D-8F6F-86483CEAE2C1> returned for origin-Mac-1280262988/client-io.mpv-36248/player-MediaRemote-DefaultPlayer in 0.0414 seconds
default 16:30:01.087558-0400    mpv [0x7fbf3a10bc40] activating connection: mach=true listener=false peer=false name=com.apple.windowmanager.server
default 16:30:01.090878-0400    mpv [RCC] _updateCanBeNowPlayingApplicationIfNeeded: canBeNowPlayingApplication=YES playerPath=origin-Mac-1280262988/client-io.mpv-36248/player-MediaRemote-DefaultPlayer commands=(
    "<MPRemoteCommand: 0x7fbf397580a0 type=DisableLanguageOption (28) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf39757f60 type=EnableLanguageOption (27) enabled=NO handlers=[]>",
    "<MPChangeShuffleModeCommand: 0x7fbf39757270 type=SetShuffleMode (26) enabled=NO handlers=[]>",
    "<MPChangeRepeatModeCommand: 0x7fbf39756fa0 type=SetRepeatMode (25) enabled=NO handlers=[]>",
    "<MPChangePlaybackPositionCommand: 0x7fbf39757cb0 type=SeekToPlaybackPosition (24) enabled=NO handlers=[]>",
    "<MPFeedbackCommand: 0x7fbf39758a30 type=BookmarkTrack (23) enabled=NO handlers=[]>",
    "<MPFeedbackCommand: 0x7fbf397588a0 type=DislikeTrack (22) enabled=NO handlers=[]>",
    "<MPFeedbackCommand: 0x7fbf39758660 type=LikeTrack (21) enabled=NO handlers=[]>",
    "<MPRatingCommand: 0x7fbf397582f0 type=RateTrack (20) enabled=NO handlers=[]>",
    "<MPChangePlaybackRateCommand: 0x7fbf39756850 type=ChangePlaybackRateCommand (19) enabled=NO handlers=[]>",
    "<MPSkipIntervalCommand: 0x7fbf39757890 type=SkipBackward (18) enabled=NO handlers=[]>",
    "<MPSkipIntervalCommand: 0x7fbf397575b0 type=SkipForward (17) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf3a23dee0 type=BeginRewind (10) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf3a23d9c0 type=BeginFastForward (8) enabled=NO handlers=[]>",
    "<MPSkipTrackCommand: 0x7fbf3a23d570 type=PreviousTrack (5) enabled=NO handlers=[]>",
    "<MPSkipTrackCommand: 0x7fbf3a23cf00 type=NextTrack (4) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf3a204540 type=Stop (3) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf3a23d710 type=TogglePlayPause (2) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf3a127b00 type=Pause (1) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf3a22e8b0 type=Play (0) enabled=NO handlers=[]>"
)
default 16:30:01.091486-0400    mpv [MRNowPlaying] MRMediaRemoteSetCanBeNowPlayingForPlayer <private> set to YES
default 16:30:01.091730-0400    mpv <MPRemoteCommandCenter: 0x7fbf1970a570 (<private>)> [MPRemoteCommandCenter] setSupportedCommands (
)
default 16:30:01.091967-0400    mpv [MRNowPlayingPlayerClient] Setting identical supportedCommands for origin-Mac-1280262988/client-io.mpv-36248/player-MediaRemote-DefaultPlayer. Skipping update
default 16:30:01.092746-0400    mpv [0x7fbf39761180] activating connection: mach=false listener=false peer=false name=com.apple.ViewBridgeAuxiliary
default 16:30:01.095434-0400    mpv [0x7fbf3a144b20] activating connection: mach=false listener=false peer=false name=(anonymous)
default 16:30:01.096301-0400    mpv [0x7fbf39785eb0] activating connection: mach=false listener=true peer=false name=(anonymous)
default 16:30:01.096661-0400    mpv [0x7fbf39761180] invalidated after the last release of the connection object
default 16:30:01.096832-0400    mpv [RCC] _updateCanBeNowPlayingApplicationIfNeeded: canBeNowPlayingApplication=NO playerPath=origin-Mac-1280262988/client-io.mpv-36248/player-MediaRemote-DefaultPlayer commands=(
    "<MPRemoteCommand: 0x7fbf397580a0 type=DisableLanguageOption (28) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf39757f60 type=EnableLanguageOption (27) enabled=NO handlers=[]>",
    "<MPChangeShuffleModeCommand: 0x7fbf39757270 type=SetShuffleMode (26) enabled=NO handlers=[]>",
    "<MPChangeRepeatModeCommand: 0x7fbf39756fa0 type=SetRepeatMode (25) enabled=NO handlers=[]>",
    "<MPChangePlaybackPositionCommand: 0x7fbf39757cb0 type=SeekToPlaybackPosition (24) enabled=NO handlers=[]>",
    "<MPFeedbackCommand: 0x7fbf39758a30 type=BookmarkTrack (23) enabled=NO handlers=[]>",
    "<MPFeedbackCommand: 0x7fbf397588a0 type=DislikeTrack (22) enabled=NO handlers=[]>",
    "<MPFeedbackCommand: 0x7fbf39758660 type=LikeTrack (21) enabled=NO handlers=[]>",
    "<MPRatingCommand: 0x7fbf397582f0 type=RateTrack (20) enabled=NO handlers=[]>",
    "<MPChangePlaybackRateCommand: 0x7fbf39756850 type=ChangePlaybackRateCommand (19) enabled=NO handlers=[]>",
    "<MPSkipIntervalCommand: 0x7fbf39757890 type=SkipBackward (18) enabled=NO handlers=[]>",
    "<MPSkipIntervalCommand: 0x7fbf397575b0 type=SkipForward (17) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf3a23dee0 type=BeginRewind (10) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf3a23d9c0 type=BeginFastForward (8) enabled=NO handlers=[]>",
    "<MPSkipTrackCommand: 0x7fbf3a23d570 type=PreviousTrack (5) enabled=NO handlers=[]>",
    "<MPSkipTrackCommand: 0x7fbf3a23cf00 type=NextTrack (4) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf3a204540 type=Stop (3) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf3a23d710 type=TogglePlayPause (2) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf3a127b00 type=Pause (1) enabled=NO handlers=[]>",
    "<MPRemoteCommand: 0x7fbf3a22e8b0 type=Play (0) enabled=NO handlers=[]>"
)
default 16:30:01.097939-0400    mpv [MRNowPlaying] MRMediaRemoteSetCanBeNowPlayingForPlayer <private> set to NO
default 16:30:01.098491-0400    mpv terminate:
default 16:30:01.098697-0400    mpv Attempting sudden termination (1st attempt)
default 16:30:01.098741-0400    mpv Checking whether app should terminate
default 16:30:01.098793-0400    mpv Asking app delegate whether applicationShouldTerminate:
default 16:30:01.098848-0400    mpv replyToApplicationShouldTerminate:YES
default 16:30:01.098908-0400    mpv App termination approved
default 16:30:01.098956-0400    mpv Termination commencing
default 16:30:01.099004-0400    mpv Attempting sudden termination (2nd attempt)
default 16:30:01.099471-0400    mpv Termination complete. Exiting without sudden termination.
default 16:30:01.276197-0400    mpv [0x600002c5d860] invalidated after the last release of the connection object
KyLeggiero commented 1 year ago

I have this same issue. I downloaded the pre-built bundle from https://laboratory.stolendata.net/~djinn/mpv_osx/

When I open the bundle, it immediately quits (no crash log, seems exit code 0). When I run the executable itself and pass it a video file, it seems to play just fine.

A screenshot of the console output below

And here's that same console output as plaintext:

Last login: Tue Sep 19 08:07:57 on ttys004
/usr/local/opt/ruby/bin:/usr/local/opt/openjdk/bin:/Users/kyleggiero/bin:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:.

2023-09-19  08:13:22
% mpv.app/Contents/MacOS/mpv ~/Downloads/TearsOfSteel.mp4 
 (+) Video --vid=1 (*) (h264 1280x534 24.000fps)
 (+) Audio --aid=1 (*) (aac 2ch 44100Hz)
AO: [coreaudio] 44100Hz stereo 2ch floatp
VO: [libmpv] 1280x534 yuv420p
AV: 00:00:01 / 00:12:14 (0%) A-V:  0.000

Exiting... (Quit)

2023-09-19  08:13:36
% open mpv.app                                           

2023-09-19  08:13:43
%

This is all with the latest build, obviously: 0.36.0

Akemi commented 1 year ago

that's not a crash. it's just exiting.

KyLeggiero commented 1 year ago

@Akemi define it how you will, I cannot open the bundle because it always quits immediately. Most users would call that a crash even if there's no log output and the exit code is 0, because they never see those anyway

Akemi commented 1 year ago

then please provide a log. you can find instruction in the issue template for macOS.

mike-hearn commented 1 year ago

I think the issue on Sonoma is the same with all older bundles and newly built app bundles (i.e. with https://gist.github.com/dbrookman/74b8bcfb37a23452f7137b83bca9580f).

This PR fixes the issue when building from scratch (but of course retroactive builds are still affected), so it seems to just be a code signing issue.

Akemi commented 1 year ago

might this be related to code signing? https://github.com/mpv-player/mpv/pull/12141

codesign --force --deep -s - mpv.app

[edit] the instruction at the bottom of https://github.com/mpv-player/mpv/wiki/Compiling-distro-releases-for-macOS

KyLeggiero commented 1 year ago

Good point! I looked in Console (~/Library/Logs/mpv.log remains blank and the bundle doesn't accept -v nor --log-output) while launching and found this:

error   09:56:49.481755-0600    tccd    IDENTITY_ATTRIBUTION: Failed to copy signing info for 56386, responsible for /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app/Contents/MacOS/mpv: #-67062: Error Domain=NSOSStatusErrorDomain Code=-67062 "(null)"
KyLeggiero commented 1 year ago

Here's the full console filtering for mpv:

default 09:56:46.691298-0600    lsd io.mpv/Unknown Persona:5:5:1:1:Building bundle record for app
default 09:56:46.691534-0600    lsd io.mpv/Unknown Persona:5:5:2:1:Built bundle record for app
default 09:56:46.764662-0600    lsd io.mpv/Unknown Persona:5:4:2:1:_LSServerRegisterItemInfo result = 0
default 09:56:46.787050-0600    dmd Received xpc stream event (distributed notification matching) with name: com.apple.LaunchServices.applicationRegistered user info: {
    bundleIDs =     (
        "io.mpv"
    );
    isForcedUpdate = 1;
    isPlaceholder = 0;
}
default 09:56:46.795543-0600    lsd SecTranslocateCreateSecureDirectoryForURL: created /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app
default 09:56:47.026195-0600    runningboardd   Launch request for app<application.io.mpv.73841216.73841226(501)>[0] is using uid 501 (divined from auid 501 euid 501)
default 09:56:47.026818-0600    runningboardd   Acquiring assertion targeting app<application.io.mpv.73841216.73841226(501)> from originator [anon<open>(501):56383] with description <RBSAssertionDescriptor| "LS launch io.mpv" ID:227-56383-62900 target:app<application.io.mpv.73841216.73841226(501)> attributes:[
    <RBSDomainAttribute| domain:"com.apple.launchservicesd" name:"LaunchRoleUserInteractive" sourceEnvironment:"(null)">
    ]>
default 09:56:47.027436-0600    runningboardd   Assertion 227-56383-62900 (target:app<application.io.mpv.73841216.73841226(501)>) will be created as active
default 09:56:47.028714-0600    runningboardd   Executing launch request for app<application.io.mpv.73841216.73841226(501)> (LS launch io.mpv)
default 09:56:47.029222-0600    runningboardd   Checking PreventLaunch: global:0 exPath:/private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app/Contents/MacOS/mpv predicates:(null) allow:(null)
default 09:56:47.029834-0600    runningboardd   Creating and launching job for: app<application.io.mpv.73841216.73841226(501)>
default 09:56:47.030150-0600    runningboardd   _mutateContextIfNeeded called for io.mpv
default 09:56:47.031909-0600    runningboardd   app<application.io.mpv.73841216.73841226(501)>: -[RBPersonaManager personaForIdentity:context:personaUID:personaUniqueString:] required 0.000954 ms (wallclock); resolved to {4294967295, (null)}
default 09:56:47.090816-0600    runningboardd   Calculated state for app<application.io.mpv.73841216.73841226(501)>: running-active (role: UserInteractive)
default 09:56:47.090805-0600    runningboardd   [app<application.io.mpv.73841216.73841226(501)>:56386] Ignoring jetsam update because this process is not memory-managed
default 09:56:47.092438-0600    runningboardd   [app<application.io.mpv.73841216.73841226(501)>:56386] Ignoring suspend because this process is not lifecycle managed
default 09:56:47.092993-0600    runningboardd   [app<application.io.mpv.73841216.73841226(501)>:56386] Ignoring GPU update because this process is not GPU managed
default 09:56:47.094254-0600    runningboardd   [app<application.io.mpv.73841216.73841226(501)>:56386] Ignoring memory limit update because this process is not memory-managed
default 09:56:47.353393-0600    mpv [0x7f9ddf204150] activating connection: mach=true listener=false peer=false name=com.apple.distributed_notifications@Uv3
default 09:56:47.367913-0600    tccd    AUTHREQ_ATTRIBUTION: msgID=56386.1, attribution={requesting={TCCDProcess: identifier=<ID of InvalidCode>, pid=56386, auid=501, euid=501, binary_path=/private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app/Contents/MacOS/mpv}, },
default 09:56:47.923146-0600    tccd    AUTHREQ_SUBJECT: msgID=56386.1, subject=io.mpv,
default 09:56:47.933463-0600    tccd    -[TCCDAccessIdentity staticCode]: static code for: identifier io.mpv, type: 0: 0x7fda98078630 at /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app
default 09:56:49.999849-0600    mpv server port 0x00003c07, session port 0x00003c07
default 09:56:49.001686-0600    tccd    AUTHREQ_ATTRIBUTION: msgID=187.1163, attribution={accessing={TCCDProcess: identifier=<ID of InvalidCode>, pid=56386, auid=501, euid=501, binary_path=/private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app/Contents/MacOS/mpv}, requesting={TCCDProcess: identifier=com.apple.WindowServer, pid=187, auid=88, euid=88, binary_path=/System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/Resources/WindowServer}, },
default 09:56:49.001852-0600    tccd    requestor: TCCDProcess: identifier=com.apple.WindowServer, pid=187, auid=88, euid=88, binary_path=/System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/Resources/WindowServer is checking access for accessor TCCDProcess: identifier=<ID of InvalidCode>, pid=56386, auid=501, euid=501, binary_path=/private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app/Contents/MacOS/mpv
default 09:56:49.017929-0600    tccd    -[TCCDAccessIdentity staticCode]: static code for: identifier io.mpv, type: 0: 0x7fda98078630 at /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app
default 09:56:49.056238-0600    mpv [0x7f9ddb708200] activating connection: mach=true listener=false peer=false name=com.apple.coreservices.launchservicesd
default 09:56:49.057616-0600    mpv [0x7f9ddf3064b0] activating connection: mach=true listener=false peer=false name=com.apple.analyticsd
default 09:56:49.070879-0600    mpv New connection 0x23ce57 main
default 09:56:49.085623-0600    mpv CHECKIN: pid=56386
default 09:56:49.113390-0600    runningboardd   Acquiring assertion targeting [app<application.io.mpv.73841216.73841226(501)>:56386] from originator [osservice<com.apple.coreservices.launchservicesd>:159] with description <RBSAssertionDescriptor| "foregroundApp:56386" ID:227-159-62913 target:56386 attributes:[
    <RBSDomainAttribute| domain:"com.apple.launchservicesd" name:"RoleUserInteractiveNonFocal" sourceEnvironment:"(null)">
    ]>
default 09:56:49.113595-0600    runningboardd   Assertion 227-159-62913 (target:[app<application.io.mpv.73841216.73841226(501)>:56386]) will be created as active
default 09:56:49.115247-0600    runningboardd   Invalidating assertion 227-159-62903 (target:[app<application.io.mpv.73841216.73841226(501)>:56386]) from originator [osservice<com.apple.coreservices.launchservicesd>:159]
default 09:56:49.113909-0600    launchservicesd CHECKIN:0x0-0x373373 56386 io.mpv
default 09:56:49.114952-0600    mpv CHECKEDIN: pid=56386 asn=0x0-0x373373 foreground=1
default 09:56:49.116588-0600    loginwindow -[ApplicationManager checkInAppContext:eventData:] | ApplicationManager: Checked in app : mpv
default 09:56:49.116940-0600    mpv [0x7f9ddc410040] activating connection: mach=true listener=false peer=false name=com.apple.lsd.modifydb
default 09:56:49.163836-0600    mpv Failed to copy the SysCfgDict MG key with error: 0
default 09:56:49.168936-0600    mpv Current system appearance, (HLTB: 2), (SLS: 1)
default 09:56:49.171950-0600    mpv Post-registration system appearance: (HLTB: 2)
default 09:56:49.224082-0600    lsd io.mpv/Unknown Persona:5:5:1:1:Building bundle record for app
default 09:56:49.224328-0600    lsd io.mpv/Unknown Persona:5:5:2:1:Built bundle record for app
default 09:56:49.371400-0600    distnoted   register name: com.apple.xctest.FakeForceTouchDevice object: io.mpv token: 1c00000023 pid: 56386
default 09:56:49.422208-0600    runningboardd   Acquiring assertion targeting [app<application.io.mpv.73841216.73841226(501)>:56386] from originator [osservice<com.apple.coreservices.launchservicesd>:159] with description <RBSAssertionDescriptor| "uielement:56386" ID:227-159-62914 target:56386 attributes:[
    <RBSDomainAttribute| domain:"com.apple.launchservicesd" name:"RoleUserInteractive" sourceEnvironment:"(null)">
    ]>
default 09:56:49.422492-0600    runningboardd   Assertion 227-159-62914 (target:[app<application.io.mpv.73841216.73841226(501)>:56386]) will be created as active
default 09:56:49.424387-0600    runningboardd   Invalidating assertion 227-159-62913 (target:[app<application.io.mpv.73841216.73841226(501)>:56386]) from originator [osservice<com.apple.coreservices.launchservicesd>:159]
default 09:56:49.424511-0600    runningboardd   [app<application.io.mpv.73841216.73841226(501)>:56386] Ignoring jetsam update because this process is not memory-managed
default 09:56:49.424722-0600    runningboardd   [app<application.io.mpv.73841216.73841226(501)>:56386] Ignoring suspend because this process is not lifecycle managed
default 09:56:49.424846-0600    runningboardd   Calculated state for app<application.io.mpv.73841216.73841226(501)>: running-active (role: UserInteractive)
default 09:56:49.424992-0600    runningboardd   [app<application.io.mpv.73841216.73841226(501)>:56386] Set darwin role to: UserInteractive
default 09:56:49.425360-0600    runningboardd   [app<application.io.mpv.73841216.73841226(501)>:56386] Ignoring GPU update because this process is not GPU managed
default 09:56:49.425851-0600    runningboardd   [app<application.io.mpv.73841216.73841226(501)>:56386] Ignoring memory limit update because this process is not memory-managed
default 09:56:49.427962-0600    mpv Registering for test daemon availability notify post.
default 09:56:49.428438-0600    mpv notify_get_state check indicated test daemon not ready.
default 09:56:49.428776-0600    mpv notify_get_state check indicated test daemon not ready.
default 09:56:49.429151-0600    mpv notify_get_state check indicated test daemon not ready.
default 09:56:49.445564-0600    mpv Set: origin-Mac-1280262988/client-io.mpv-56386/player-MediaRemote-DefaultPlayer setting ActivePlayerPath to <<private>>
default 09:56:49.445697-0600    mpv Request: setNowPlayingPlayer<5541C2C5-F3AF-4B5C-B4C6-89EB40F3F011> for origin-Mac-1280262988/client-io.mpv-56386/player-MediaRemote-DefaultPlayer because New player origin-Mac-1280262988/client-io.mpv-56386/player-MediaRemote-DefaultPlayer was added
default 09:56:49.446168-0600    mpv [0x7f9ddc719960] activating connection: mach=true listener=false peer=false name=com.apple.mediaremoted.xpc
default 09:56:49.446938-0600    mpv Received DFR status change 0. status = 0x1
default 09:56:49.446388-0600    mpv MediaRemote server initializing
default 09:56:49.448409-0600    mpv Received DFR status change 1. status = 0x1
default 09:56:49.449506-0600    mpv [0x7f9ddc7288e0] activating connection: mach=true listener=false peer=false name=com.apple.coreservices.appleevents
default 09:56:49.451122-0600    kernel  Sandbox: mediaremoted(123) allow process-info-pidinfo others [mpv(56386)]
default 09:56:49.451265-0600    kernel  Sandbox: mediaremoted(123) allow file-read-data /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app
default 09:56:49.451369-0600    kernel  Sandbox: mediaremoted(123) allow file-read-data /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app/Contents
default 09:56:49.451493-0600    kernel  Sandbox: mediaremoted(123) allow file-read-data /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app/Contents/Info.plist
default 09:56:49.451868-0600    mpv SignalReady: pid=56386 asn=0x0-0x373373
default 09:56:49.452610-0600    kernel  Sandbox: mediaremoted(123) allow file-read-data /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app/Contents/MacOS/mpv
default 09:56:49.454580-0600    mpv SIGNAL: pid=56386 asn=0x0x-0x373373
default 09:56:49.456573-0600    kernel  Sandbox: mediaremoted(123) allow process-info-pidinfo others [mpv(56386)]
default 09:56:49.456756-0600    kernel  Sandbox: mediaremoted(123) allow file-read-data /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app
default 09:56:49.456882-0600    kernel  Sandbox: mediaremoted(123) allow file-read-data /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app/Contents
default 09:56:49.457051-0600    kernel  Sandbox: mediaremoted(123) allow file-read-data /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app/Contents/Info.plist
default 09:56:49.458223-0600    kernel  Sandbox: mediaremoted(123) allow file-read-data /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app/Contents/MacOS/mpv
default 09:56:49.465394-0600    mpv [0x7f9ddf1080b0] activating connection: mach=true listener=false peer=false name=com.apple.pasteboard.1
error   09:56:49.481755-0600    tccd    IDENTITY_ATTRIBUTION: Failed to copy signing info for 56386, responsible for /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app/Contents/MacOS/mpv: #-67062: Error Domain=NSOSStatusErrorDomain Code=-67062 "(null)"
default 09:56:49.490237-0600    mpv Response: setNowPlayingPlayer<5541C2C5-F3AF-4B5C-B4C6-89EB40F3F011> returned for origin-Mac-1280262988/client-io.mpv-56386/player-MediaRemote-DefaultPlayer in 0.0445 seconds
default 09:56:49.493293-0600    mpv NSApp cache appearance:
-NSRequiresAquaSystemAppearance: 0
-appearance: (null)
-effectiveAppearance: <NSCompositeAppearance: 0x7f9ddc01db90
 (
    "<NSDarkAquaAppearance: 0x7f9ddc01fa40>",
    "<NSSystemAppearance: 0x7f9ddf0044e0>"
)>
default 09:56:49.499648-0600    mpv Entering exit handler.
default 09:56:49.508656-0600    mpv Queueing exit procedure onto XPC queue. Any further messages sent will be discarded. activeSendTransactions=0
default 09:56:49.556598-0600    tccd    -[TCCDAccessIdentity staticCode]: static code for: identifier io.mpv, type: 0: 0x7fda9081ca60 at /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app
default 09:56:49.539891-0600    mpv Exiting exit handler.
default 09:56:49.606631-0600    runningboardd   [app<application.io.mpv.73841216.73841226(501)>:56386] termination reported by launchd (0, 0, 0)
default 09:56:49.612348-0600    runningboardd   Removing process: [app<application.io.mpv.73841216.73841226(501)>:56386]
default 09:56:49.613867-0600    runningboardd   Removing launch job for: [app<application.io.mpv.73841216.73841226(501)>:56386]
default 09:56:49.652072-0600    runningboardd   Calculated state for app<application.io.mpv.73841216.73841226(501)>: none (role: None)
default 09:56:49.653232-0600    runningboardd   Calculated state for app<application.io.mpv.73841216.73841226(501)>: none (role: None)
default 09:56:49.657783-0600    launchservicesd Hit the server for a process handle 8f521490000dc42 that resolved to: [app<application.io.mpv.73841216.73841226(501)>:56386]
default 09:56:49.667746-0600    loginwindow -[PersistentAppsSupport applicationQuit:] | for app:mpv, _appTrackingState = 2
error   09:56:49.670312-0600    tccd    failed to get text offset for /private/var/folders/kf/mhpg8jrn4411qdbrf42gqk9m0000gn/T/AppTranslocation/714154F6-8FD1-4B06-992B-B024F3A5A78D/d/mpv.app/Contents/MacOS/mpv[56386]: (#3) No such process
Akemi commented 1 year ago

@Akemi define it how you will, I cannot open the bundle because it always quits immediately. Most users would call that a crash even if there's no log output and the exit code is 0, because they never see those anyway

btw that was my bad. i only read the issue title and crash, and thought your issue might be unrelated. i will change it so it's less misleading for everyone.

KyLeggiero commented 1 year ago

Thank you, @Akemi !

Kagami commented 1 year ago

This patch to the brew's formula works:

diff --git a/Formula/m/mpv.rb b/Formula/m/mpv.rb
index 12a642dd107..23c32e250b0 100644
--- a/Formula/m/mpv.rb
+++ b/Formula/m/mpv.rb
@@ -62,6 +62,12 @@ class Mpv < Formula
     system "meson", "setup", "build", *args, *std_meson_args
     system "meson", "compile", "-C", "build", "--verbose"
     system "meson", "install", "-C", "build"
+    system "python3", "TOOLS/osxbundle.py", "-s", "build/mpv"
+    system "rm", "build/mpv.app/Contents/MacOS/mpv-bundle"
+    system "mv", "build/mpv.app/Contents/MacOS/mpv", "build/mpv.app/Contents/MacOS/mpv-bundle"
+    system "ln", "-s", "mpv-bundle", "build/mpv.app/Contents/MacOS/mpv"
+    system "codesign", "--force", "--deep", "-s", "-", "build/mpv.app"
+    prefix.install "build/mpv.app"

     if OS.mac?
       # `pkg-config --libs mpv` includes libarchive, but that package is

And to compile latest commit & update application:

brew reinstall -s mpv && rsync -av --delete /opt/homebrew/opt/mpv/mpv.app/ /Applications/mpv.app/

Although mpv binary inside application is unnecessary in this case because we get mpv binary in /opt/homebrew/bin/mpv anyway.

georgjaehnig commented 11 months ago

With ChatGPT, I've found this alternative solution which also works for me (MacOS 14.1.1):

Create an Automator Application:

  1. Open Automator (found in your Applications folder).
  2. Choose to create a new "Application".
  3. In the search pane, type "Run Shell Script" and drag this action to the workflow on the right.
  4. In the script field, enter /opt/homebrew/bin/mpv "$@" (this script tells Automator to use MPV to open any files passed to this application).
  5. Set Pass input to "as arguments"
  6. Save this Automator Application in a convenient location (like your Applications folder) and give it a recognizable name, like "MPV Player".

Set the Automator Application as Default:

  1. Right-click on a media file and choose "Get Info".
  2. Under "Open with:", click the dropdown, choose "Other...", and navigate to where you saved your Automator Application.
  3. Select this Automator Application and then click "Add".
  4. Click "Change All..." to set it as the default for all files of this type.
Kagami commented 11 months ago

I'm using this solution now: https://github.com/mpv-player/mpv/issues/1377#issuecomment-1751510069 It doesn't require any changes to the formula and can open multiple videos simultaneously.