poxu / runmpv

Runner, which allows to have only one mpv instance on Windows and Linux
6 stars 0 forks source link

runmpv causes SVP to not "kick in" #22

Open NintendoManiac64 opened 2 years ago

NintendoManiac64 commented 2 years ago

As I mentioned in my previous thread, I compiled mpv using the following instructions so that I can use it in conjunction with SVP:

However, it would seem that runmpv causes SVP to not actually "kick in" even if SVP "kicks in" without issue if you launch the exact same video file through mpv without runmpv.

That being said, if one is fine with videos not being focused then one work-around is to instead associate video files with SVP itself as, when you then open video files that way, it basically seems to behave the same as runmpv except that newly-opened videos do not take focus.

poxu commented 2 years ago

I, sadly, have no experience with SVP, but I looked through the documentation and noticed, that SVP uses mpv socket to communicate to mpv. SVP manual says that user should add --input-ipc-server=/tmp/mpvsocke to mpv arguments.

runmpv uses socket too. And, to distinguish mpv instances, created by runmpv from ones, launched without runmpv, runmpv passes a different socket name to mpv. That name is taken from runmpv.properties default value is pipeName=runmpv-mpv-pipe. Don't let setting name confuse you. It's pipeName, because mpv uses pipes under windows. Under linux mpv uses sockets and so runmpv uses sockets too.

But pipeName setting contains socket's name, not full path. Full path is constructed in runtime, according to the following logic. runmpv tries to be compliant with xdg, so it first looks at XDG_RUNTIME_DIR environment variable. If it's defined, then runmpv creates runmpv directory there and then creates socket in that new directory. For example, on my machine XDG_RUNTIME_DIR is /run/user/1000 . So, if pipeName is runmpv-mpv-pipe, then full socket path will be /run/user/1000/runmpv/runmpv-mpv-pipe .

If XDG_RUNTIME_DIR is not defined, then runmpv will use /tmp instead of it . If you can pass full path to mpv socket to SVP, please try doing that. If you can't, then it's a problem, because runmpv doesn't support absolute paths in pipeName setting.

I'll fix that today, but right now I'm afraid specifying socket path for SVP is the only option.

poxu commented 2 years ago

You know, runmpv already supports absolute path in pipeName. If wasn't a deliberate effort on my part, so I should make the code for that more explicit, but you definitely can try using absolute path to fix your issue with SVP