Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smplayer: cannot play video with mpv as backend on Arch #3596

Closed
bbhtt opened this issue Aug 20, 2020 · 16 comments
Closed

smplayer: cannot play video with mpv as backend on Arch #3596

bbhtt opened this issue Aug 20, 2020 · 16 comments

Comments

@bbhtt
Copy link
Contributor

bbhtt commented Aug 20, 2020

Bug and expected behavior

Open a video in SMPlayer with mpv as backend, /us/local/bin/mpv fails to launch, video does not play.

  • What did you expect to happen?

The process to run and to video to play.

No profile or disabling firejail

  • What changed calling firejail --noprofile PROGRAM in a shell?

Runs

  • What changed calling the program by path=without firejail (check whereis PROGRAM, firejail --list, stat $programpath)?

Runs.

Steps to reproduce the behavior:

  1. Run smplayer,mpv with the profile that comes with https://aur.archlinux.org/packages/firejail-git
  2. Options>Preferences>Multimedia Engine>Choose MPV
  3. Wait for Smplayer to reset.
  4. Close smplayer (essential) and run again for the path to mpv to change ,this time it will be Others /usr/local/bin/mpv provided it also has a symlink.
  5. Run a video
  6. See error: https://imgur.com/cWmgN0O (https://gist.github.com/kortewegdevries/b35bf974526f3ae9b6bffd53c3b638c0)

Environment

  • Linux distribution and version (ie output of lsb_release -a)
lsb_release -a

LSB Version:	1.4
Distributor ID:	Arch
Description:	Arch Linux
Release:	rolling
Codename:	n/a
  • Firejail version (output of firejail --version) exclusive or used git commit (git rev-parse HEAD)
# pacman -Q|grep "firejail"

firejail-git r6331.d3b58663-1

smplayer 20.6.0-1
mpv 1:0.32.0-4
mplayer 38157-3

  • What other programs interact with the affected program for the functionality?

mpv,smplayer,mplayer

Observations:

  1. Ubuntu firejail 0.9.62.4-2 with smplayer 20.6/mpv not affected, only on Arch I think.

  2. private-bin line causing the error in step 6.

  3. firejail --build and strace -e execve, readlink,access produces: pacmd,dbus-send,xset etc. adding them to private-bin along with shell doesn't help. If you are running strace feed smplayer a video on terminal to reduce verbosity a bit.

  4. mplayer as a backend works fine with no changes to profiles.

  5. The error is not about mpv or its profile: copy the command line arguments smplayer feeds to mpv with a few changes, run under firejail a video, works!

/usr/local/bin/mpv --no-config --no-quiet --terminal --no-msg-color --input-ipc-server=/tmp/smplayer-mpv-34 --msg-level=ffmpeg/demuxer=error --no-fs --hwdec=no --sub-auto=fuzzy --no-input-default-bindings --input-x11-keyboard=no --no-input-cursor --cursor-autohide=no --no-keepaspect --wid=75497517 --monitorpixelaspect=1 --osd-level=1 --osd-scale=1 --sub-ass --embeddedfonts --ass-line-spacing=0 --sub-scale=1 --sub-text-shadow-color=#ff000000 --sub-codepage=ISO-8859-1 --sub-pos=100 --volume=0 --cache=auto --screenshot-template=cap_%F_%p_%02n --screenshot-format=jpg --softvol=yes --softvol-max=110 --term-playing-msg=MPV_VERSION=${=mpv-version:}

The softvol and the last flag needs to be removed, then feed it a video.

  1. Changing to upstream profiles doesn't work.
@rusty-snake
Copy link
Collaborator

$ fjp diff smplayer.profile mpv.profile
The following commands are unique to smplayer.profile:
include smplayer.local
noblacklist ${HOME}/.config/smplayer
noblacklist ${HOME}/.mplayer
whitelist /usr/share/smplayer
private-bin env,mplayer,mpv,python*,smplayer,smtube,youtube-dl
private-tmp

The following commands are unique to mpv.profile:
quiet
include mpv.local
noblacklist ${HOME}/.config/mpv
noblacklist ${HOME}/.netrc
include allow-lua.inc
noblacklist ${PICTURES}
whitelist /usr/share/lua
whitelist /usr/share/lua*
whitelist /usr/share/vulkan
nogroups
tracelog
private-bin env,mpv,python*,youtube-dl
dbus-user none
dbus-system none

Can you try the lua stuff.

@bbhtt
Copy link
Contributor Author

bbhtt commented Aug 25, 2020

Can you try the lua stuff?

I already tried that, see my first edit on OP, the lua error was inconsistent, sometimes smplayer + mpv said liblua wasn't found, sometimes it didn't... I'll try again.

@bbhtt
Copy link
Contributor Author

bbhtt commented Aug 25, 2020

Didn't work added allow-lua.inc, whitelist /usr/share/lua,whitelist /usr/share/lua*,whitelist /usr/share/vulkan to smplayer. It's weird.

@rusty-snake
Copy link
Collaborator

Have you tried /usr/share/vulkan?

@bbhtt
Copy link
Contributor Author

bbhtt commented Aug 25, 2020

Have you tried /usr/share/vulkan?

Where?

@rusty-snake
Copy link
Collaborator

In smplayer.local/profile.

@bbhtt
Copy link
Contributor Author

bbhtt commented Aug 25, 2020

Yes I tried all three lua+vulkan. I don't use locals.

@rusty-snake
Copy link
Collaborator

Works firejail --profile=smplayer mpv --no-config --…?

@bbhtt
Copy link
Contributor Author

bbhtt commented Aug 25, 2020

You mean use smplayer profile to run mpv? Yeah after including include allow-lua.inc, whitelist /usr/share/lua, whitelist /usr/share/lua*to smplayer.profile

@rusty-snake
Copy link
Collaborator

You mean use smplayer profile to run mpv?

Yes, I want to know if the smplayer-profile breaks mpv (with the smplayer args) or if it is the interaction between smplayer and mpv.

@bbhtt
Copy link
Contributor Author

bbhtt commented Aug 25, 2020

Ohh okay, the last command line argument has to be dropped and the softvol ones second last I think:

firejail --profile=smplayer mpv --no-config --no-quiet --terminal --no-msg-color --input-ipc-server=/tmp/smplayer-mpv-34 --msg-level=ffmpeg/demuxer=error --no-fs --hwdec=no --sub-auto=fuzzy --no-input-default-bindings --input-x11-keyboard=no --no-input-cursor --cursor-autohide=no --no-keepaspect --wid=75497517 --monitorpixelaspect=1 --osd-level=1 --osd-scale=1 --sub-ass --embeddedfonts --ass-line-spacing=0 --sub-scale=1 --sub-text-shadow-color=#ff000000 --sub-codepage=ISO-8859-1 --sub-pos=100 --volume=0 --cache=auto --screenshot-template=cap_%F_%p_%02n --screenshot-format=jpg /home/korte/Downloads/sample-mp4-file.mp4
Reading profile /etc/firejail/smplayer.profile
Reading profile /etc/firejail/allow-lua.inc
Reading profile /etc/firejail/allow-python2.inc
Reading profile /etc/firejail/allow-python3.inc
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-exec.inc
Reading profile /etc/firejail/disable-interpreters.inc
Reading profile /etc/firejail/disable-passwdmgr.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/disable-shell.inc
Reading profile /etc/firejail/disable-xdg.inc
Reading profile /etc/firejail/whitelist-usr-share-common.inc
Reading profile /etc/firejail/whitelist-var-common.inc
Parent pid 3375, child pid 3376
49 programs installed in 90.34 ms
Warning: /sbin directory link was not blacklisted
Warning: /usr/sbin directory link was not blacklisted
Warning: not remounting /run/user/1000/gvfs
Child process initialized in 245.93 ms
Warning: option --input-x11-keyboard was replaced with --input-vo-keyboard and might be removed in the future.
Warning: option --ass-line-spacing was replaced with --sub-ass-line-spacing and might be removed in the future.
Warning: option --sub-text-shadow-color was replaced with --sub-shadow-color and might be removed in the future.
 (+) Video --vid=1 (*) (h264 320x240 15.000fps)
 (+) Audio --aid=1 (*) (aac 6ch 48000Hz)
[vo/gpu/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 480002d, serial: 13
[vo/gpu/x11] Error code: 9, request code: e, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 480002d, serial: 14
[vo/gpu/x11] Error code: 3, request code: 28, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 480002d, serial: 1a
[vo/gpu/x11] Error code: 3, request code: 2, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 480002d, serial: 1c
[vo/gpu/x11] Error code: 3, request code: 1, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 5200002, serial: 1f
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 5200002, serial: 21
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 5200002, serial: 22
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
[vo/gpu/opengl] Could not create EGL surface!
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fbb480042f0, resourceid: 5200002, serial: 24
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  10 (X_UnmapWindow)
  Resource id in failed request:  0x5200002
  Serial number of failed request:  40
  Current serial number in output stream:  44

Parent is shutting down, bye...

Doesn't work, mpv itself doesn't show above warnings when launched with its profile. So something in the args I think.
Profile:
https://termbin.com/i6eb

@rusty-snake
Copy link
Collaborator

Can you try to find the problematic line.

@bbhtt
Copy link
Contributor Author

bbhtt commented Aug 25, 2020

Doesn't work with the full smplayer.profile commented:

 firejail --profile=smplayer mpv --no-config --no-quiet --terminal --no-msg-color --input-ipc-server=/tmp/smplayer-mpv-34 --msg-level=ffmpeg/demuxer=error --no-fs --hwdec=no --sub-auto=fuzzy --no-input-default-bindings --input-x11-keyboard=no --no-input-cursor --cursor-autohide=no --no-keepaspect --wid=75497517 --monitorpixelaspect=1 --osd-level=1 --osd-scale=1 --sub-ass --embeddedfonts --ass-line-spacing=0 --sub-scale=1 --sub-text-shadow-color=#ff000000 --sub-codepage=ISO-8859-1 --sub-pos=100 --volume=0 --cache=auto --screenshot-template=cap_%F_%p_%02n --screenshot-format=jpg /home/korte/Downloads/sample-mp4-file.mp4
Reading profile /etc/firejail/smplayer.profile
Parent pid 6545, child pid 6546
Child process initialized in 8.41 ms
Warning: an existing sandbox was detected. /usr/bin/mpv will run without any additional sandboxing features
....
....

Profile: https://termbin.com/anb7

Even noprofile fails,weird, mpv works on its own though, under firejail without the args.

@bbhtt
Copy link
Contributor Author

bbhtt commented Aug 25, 2020

So when I made Obsevation 5, it was working that way, now it doesn't, the only changes in this period were updating the kernel/system and installing multilib mesa,vulkan etc., the latter could be related to the change in observation now.

@rusty-snake
Copy link
Collaborator

#3596 (comment) this command works for me (other video path). I'm out of ideas.

@bbhtt
Copy link
Contributor Author

bbhtt commented Aug 25, 2020

The faulty arg for the case in #3596 (comment) was --wid=75497517 removing that and using the uncommented smplayer.profile under firejail, works for me. Even if I ignore that for the moment since it worked previously, and the softvol+last one, there's something to be added in private-bin of smplayer+lua in smplayer to make it work with mpv as backend on Arch.

firejail --profile=smplayer mpv --no-config --no-quiet --terminal --no-msg-color --input-ipc-server=/tmp/smplayer-mpv-34 --msg-level=ffmpeg/demuxer=error --no-fs --hwdec=no --sub-auto=fuzzy --no-input-default-bindings --input-x11-keyboard=no --no-input-cursor --cursor-autohide=no --no-keepaspect --monitorpixelaspect=1 --osd-level=1 --osd-scale=1 --sub-ass --embeddedfonts --ass-line-spacing=0 --sub-scale=1 --sub-text-shadow-color=#ff000000 --sub-codepage=ISO-8859-1 --sub-pos=100 --volume=0 --cache=auto --screenshot-template=cap_%F_%p_%02n --screenshot-format=jpg /home/korte/Downloads/sample-mp4-file.mp4

Reading profile /etc/firejail/smplayer.profile
Reading profile /etc/firejail/allow-lua.inc
Reading profile /etc/firejail/allow-python2.inc
Reading profile /etc/firejail/allow-python3.inc
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-exec.inc
Reading profile /etc/firejail/disable-interpreters.inc
Reading profile /etc/firejail/disable-passwdmgr.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/disable-shell.inc
Reading profile /etc/firejail/disable-xdg.inc
Reading profile /etc/firejail/whitelist-usr-share-common.inc
Reading profile /etc/firejail/whitelist-var-common.inc
Parent pid 9674, child pid 9675
49 programs installed in 101.64 ms
Warning: /sbin directory link was not blacklisted
Warning: /usr/sbin directory link was not blacklisted
Warning: not remounting /run/user/1000/gvfs
Child process initialized in 246.13 ms
Warning: option --input-x11-keyboard was replaced with --input-vo-keyboard and might be removed in the future.
Warning: option --ass-line-spacing was replaced with --sub-ass-line-spacing and might be removed in the future.
Warning: option --sub-text-shadow-color was replaced with --sub-shadow-color and might be removed in the future.
 (+) Video --vid=1 (*) (h264 320x240 15.000fps)
 (+) Audio --aid=1 (*) (aac 6ch 48000Hz)
AO: [pulse] 48000Hz 5.1 6ch float
VO: [gpu] 320x240 yuv420p
AV: 00:00:02 / 00:02:05 (1%) A-V:  0.000
Parent received signal 2, shutting down the child process...
Exiting... (Quit)
Child received signal 2, shutting down the sandbox...
^C
Parent is shutting down, bye...

@bbhtt bbhtt closed this as completed Sep 1, 2020
rusty-snake pushed a commit that referenced this issue Sep 2, 2020
@kmk3 kmk3 changed the title SMPlayer fails to play video with mpv as backend on Arch smplayer: cannot play video with mpv as backend on Arch Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants