You are not logged in.

#1 2010-07-19 17:34:06

From: Brussels
Registered: 2009-01-15
Posts: 63

using joystick with mplayer


I'm trying to use my joystick with mplayer but I can't figure out how to do it.

Here's my /etc/mplayer/input.conf :

## MPlayer input control file
## You are able to redefine default keyboard/joystick/mouse/LIRC bindings, or
## add new ones here.
## See DOCS/tech/slave.txt for possible commands that can be bound.
## Also see mplayer -input cmdlist for other possible options.
## The file should be placed in the $HOME/.mplayer directory.
## If you wish to unbind a key, use key ignore.
## e.g. ENTER ignore

RIGHT seek +10
LEFT seek -10
DOWN seek -60
UP seek +60
PGUP seek 600
PGDWN seek -600
m mute
SPACE pause
- volume -1
+ volume 1
f vo_fullscreen
s sub_select
S sub_select -1

## Joystick section
## WARNING: joystick support has to be explicitly enabled at
##          compiletime with --enable-joystick

JOY_UP osd_show_property_text "JOY_UP"
JOY_DOWN osd_show_property_text "JOY_DOWN"
JOY_LEFT osd_show_property_text "JOY_LEFT"
JOY_RIGHT osd_show_property_text "JOY_RIGHT"
JOY_AXIS0_PLUS osd_show_property_text "JOY_AXIS0_PLUS"
JOY_AXIS0_MINUS osd_show_property_text "JOY_AXIS0_MINUS"
JOY_AXIS1_PLUS osd_show_property_text "JOY_AXIS1_PLUS"
JOY_AXIS1_MINUS osd_show_property_text "JOY_AXIS1_MINUS"
JOY_AXIS2_PLUS osd_show_property_text "JOY_AXIS2_PLUS"
JOY_AXIS2_MINUS osd_show_property_text "JOY_AXIS2_MINUS"
JOY_AXIS3_PLUS osd_show_property_text "JOY_AXIS3_PLUS"
JOY_AXIS3_MINUS osd_show_property_text "JOY_AXIS3_MINUS"
JOY_AXIS4_PLUS osd_show_property_text "JOY_AXIS4_PLUS"
JOY_AXIS4_MINUS osd_show_property_text "JOY_AXIS4_MINUS"
JOY_AXIS5_PLUS osd_show_property_text "JOY_AXIS5_PLUS"
JOY_AXIS5_MINUS osd_show_property_text "JOY_AXIS5_MINUS"
JOY_AXIS6_PLUS osd_show_property_text "JOY_AXIS6_PLUS"
JOY_AXIS6_MINUS osd_show_property_text "JOY_AXIS6_MINUS"
JOY_AXIS7_PLUS osd_show_property_text "JOY_AXIS7_PLUS"
JOY_AXIS7_MINUS osd_show_property_text "JOY_AXIS7_MINUS"
JOY_AXIS8_PLUS osd_show_property_text "JOY_AXIS8_PLUS"
JOY_AXIS8_MINUS osd_show_property_text "JOY_AXIS8_MINUS"
JOY_AXIS9_PLUS osd_show_property_text "JOY_AXIS9_PLUS"
JOY_AXIS9_MINUS osd_show_property_text "JOY_AXIS9_MINUS"
JOY_BTN0 osd_show_property_text "JOY_BTN0"
JOY_BTN1 osd_show_property_text "JOY_BTN1"
JOY_BTN2 osd_show_property_text "JOY_BTN2"
JOY_BTN3 osd_show_property_text "JOY_BTN3"
JOY_BTN4 osd_show_property_text "JOY_BTN4"
JOY_BTN5 osd_show_property_text "JOY_BTN5"
JOY_BTN6 osd_show_property_text "JOY_BTN6"
JOY_BTN7 osd_show_property_text "JOY_BTN7"
JOY_BTN8 osd_show_property_text "JOY_BTN8"
JOY_BTN9 osd_show_property_text "JOY_BTN9"

So as for now this configuration is just for testing, if I press a joystick button I should see the name of this button appears.
I got the joystick buttons names using "mplayer -input keylist | grep JOY". Since these names are present I guess joystick support is enabled. Also, it seems enabled according to the "mplayer -list-options" output. And I know my joystick works : it works in zsnes, and also when using the cat /dev/input/js0 trick.

But it doesn't work! I also tried "mplayer -input js-dev=/dev/input/js0" without any change. I don't have any joystick-related error even when increasing mplayer's verbosity.

Another thing which annoy me : does someone know how to turn off default mplayer keybindings ?
If no definition is present for a key in the input.conf file it reverts back to the internal mplayer default. I can manually unbind a key using "KEYNAME ignore" but there doesn't seem to be a way to unbind all default keys.

Any help is appreciated. Thanks.

Last edited by pokraka (2010-07-19 17:40:21)


#2 2010-07-23 10:15:16

From: Brussels
Registered: 2009-01-15
Posts: 63

Re: using joystick with mplayer

nobody knows?


#3 2010-08-16 20:20:03

Registered: 2010-08-16
Posts: 1

Re: using joystick with mplayer

> Since these names are present I guess joystick support is enabled.

The distributed version of mplayer lists the JOY inputs but doesn't do anything. Only a self-compiled version using hints of gives osd messages using your input.conf. So it seems mplayer lies about its inputs and you really need to compile.

Though early buttons come through ok, there are two more hurdles:

1) Joystick: warning init event, we have lost sync with driver. is all over the screen a lot. It is quickly resolved however might be a nuisance once the buttons are configured for actual use.
2) It somehow seems the controller can report multiple events at once, and mplayer gets confused and into a state where no single button triggers the configured action anymore, instead logged on stdout are messages like:

No bind found for key 'JOY_AXIS3_PLUS'.-JOY_AXIS4_MINUS


#4 2013-03-05 02:39:39

Toost Inc.
From: Netherlands
Registered: 2012-05-06
Posts: 8

Re: using joystick with mplayer

Bump for the same problem. All I managed to find out is that the axis are just too sensitive for MPlayer, and it starts reading everything as a button of a stick.
I even got this at one point:

No bind found for key 'JOY_DOWN-CLOSE_WIN'.

So, if you still want joystick control WITHOUT MPlayer getting confused and eventually crashing, avoid the analog sticks at all cost. DPad seems to be okay though.

Last edited by Toost Inc. (2013-03-05 02:41:51)

Say Satisfied Fans


Board footer

Powered by FluxBB