Jump to content

mpv does not respond to keyboard


jock

Recommended Posts

Hello, I'm testing mpv with RKMPP hardware acceleration on legacy 4.4 rockchip kernel.

This is what I put in /etc/mpv/mpv.conf:

vo=gpu
hwdec=rkmpp
gpu-api=opengl
gpu-context=drm
opengl-es=yes

If works perfectly fine with low cpu usage BUT only if I launch it from command line either from a virtual terminal or an X11 emulated terminal.

 

In case I launch it double clicking on a video from X11 xfce, mpv starts playing video but then completely forgets of the keyboard. No matter what key I hit, it does not respond, I can't even close and I'm forced to kill the process from a ssh session.

Using CTRL + ALT + n combinations, I can see the various virtual terminals flashing in the middle of the running video, and if I hit keys the keystrokes then goes to the background virtual terminals instead of mpv.

 

I tried force-window and input-terminal configuration options, but neither worked. Any ideas?

 

Link to comment
Share on other sites

When you launch it from any terminal, the terminal you used must be active for the keyboard shortcuts to work. So, for example, if you launch it from an emulated terminal in a X11 session, keybuard shortcuts will work, unless you for example hit Alt+Tab, and therefore change the focus to another window. In that case, you would need to use Alt+Tab again, to bring the focus back to the terminal you used to launch mpv.

 

So, if you want to use a desktop launcher to open video files with GBM mpv, then you must set that desktop launcher to open a virtual terminal for the process. Otherwise, you will have no way to control the player. That is the reason why in my media script mpv-gbm uses a different launcher. You can have a look at the launcher, by uncompressing the mpv-rockchip deb package.

Link to comment
Share on other sites

Thanks @JMCC for the answer, now the situation is much more clear, but I even tried to edit the .desktop file and turn "Terminal=" entry to true. It opens up a terminal but mpv still is not executed in the terminal itself, which sounds a bit strange.

 

Also I'm running X11 + armsoc + libmali X11/GB and mpv runs fine without the need to link to libmali-gbm, so it is run as an X11 application and I thought it would have its own window to capture input events, but it seems not the case.

 

Need to make more experiments and wait for mainline goodness that will make all this mess obsolete.

 

BTW, I happily compiled Kodi with full acceleration on my platform (rk322x), unfortunately rkmpp/drmprime is available only with the GBM version. Compiling against X11 + OpenGL ES provides a much smoother interface but no hardware acceleration :(

 

 

 

Link to comment
Share on other sites

hello I have the same scenario  Im not able to use the keyboard when I launch mpv with hw acc and gpu-context=drm, (until I Press ALT+TAB)

is there any way to be able to play video and read the keyboard at the same time ? it to be able to control mpv from a external alication.

Regards!

Saludos

Link to comment
Share on other sites

1 hour ago, Memo said:

hello I have the same scenario  Im not able to use the keyboard when I launch mpv with hw acc and gpu-context=drm, (until I Press ALT+TAB)

is there any way to be able to play video and read the keyboard at the same time ? it to be able to control mpv from a external alication.

Regards!

Saludos

It will depend on the window manager and/or terminal program you are using. If the terminal loses the focus, then you need to give it back with Alt+Tab. I have not used this program for several months, but in early 2021 the default Armbian XFCE desktop worked fine with the default terminal it shipped.

 

Another option is to launch the program directly from a console session (no X server running)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines