wxJoystick not working for me

Hi wx'rs

I'm new to wxPython and this list.
I have an almost finished app to which I'm trying to add control trhough
joystick without success.

I'm trying the wxJoystick from the demo package wxPythonDemo 2.4 version
either got from the web or the debian package but the joystick doesn't
seem to work.

I am on debian sid.

If I run jstest /dev/js0 or /dev/js1 (a symlink to the first) I get the
device working, so I am confused.

Also other application (PD = Pure Data) works correctly with the same
joystick. At the moment it is an analgo (Agiler) but I tried briefly
before with a Logitech Wingman Rumblepad to no avail.

I tried stracing the joystick demo app and it seems opening /dev/js0 and
later both, but no expected results though.

here is part of the strace in the case it might help:

···

---------------------------------------------------------------
read(5, "[Icon Theme]\nInherits=core\n", 4096) = 27
close(5) = 0
munmap(0x404eb000, 4096) = 0
open("/dev/js0", O_RDWR|O_LARGEFILE) = 5
sched_get_priority_max(0) = 0
sched_get_priority_min(0) = 0
pipe([7, 8]) = 0
clone(child_stack=0x83e0258,
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND) = 2164
write(8, "\10\336=\10\5\0\0\0\350\325\377\277H\353\203@\30\326=\10"...,
148) = 148
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
write(8, "\0o\3@\0\0\0\0p\327\377\277\0\342\211@h\340=\10\0\0\0\200"...,
148) = 148
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
rt_sigsuspend([] <unfinished ...>
--- SIGRTMIN (Unknown signal 32) @ 0 (0) ---
<... rt_sigsuspend resumed> ) = -1 EINTR (Interrupted system
call)
sigreturn() = ? (mask now [RTMIN])
---------------------------------------------------------------

and later:

---------------------------------------------------------------
gettimeofday({1084367810, 254220}, NULL) = 0
ioctl(5, JSIOCGAXES, 0xbfffda80) = 0
gettimeofday({1084367810, 254492}, NULL) = 0
ioctl(5, JSIOCGAXES, 0xbfffda80) = 0
gettimeofday({1084367810, 254763}, NULL) = 0
gettimeofday({1084367810, 255127}, NULL) = 0
open("/dev/js0", O_RDONLY|O_LARGEFILE) = 9
close(9) = 0
open("/dev/js1", O_RDONLY|O_LARGEFILE) = 9
close(9) = 0
gettimeofday({1084367810, 256420}, NULL) = 0
---------------------------------------------------------------

any ideas?

please, let me know if I should move to wxPython 2.5 or any other
directions.

thanks in advance!
Ramiro.

--
rama <medialist@xicnet.com>

rama wrote:

Hi wx'rs

I'm new to wxPython and this list.
I have an almost finished app to which I'm trying to add control trhough
joystick without success.

I'm trying the wxJoystick from the demo package wxPythonDemo 2.4 version
either got from the web or the debian package but the joystick doesn't
seem to work.

I am on debian sid.

If I run jstest /dev/js0 or /dev/js1 (a symlink to the first) I get the
device working, so I am confused.

Also other application (PD = Pure Data) works correctly with the same
joystick. At the moment it is an analgo (Agiler) but I tried briefly
before with a Logitech Wingman Rumblepad to no avail.

I tried stracing the joystick demo app and it seems opening /dev/js0 and
later both, but no expected results though.

It looks like wxJoystick is trying to open the device read/write, so if you don't have write permissions to it (as I didn't) then it will fail to open it. A closer look shows that there is no hope for it to work even if you do have permissions to the device as the unix implementation seems to be incomplete. It creates a thread for reading the joystick device and sending the events, but it never starts it. I'll see if I can get it fixed for the next 2.5 release.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks for fast response! delay was mine.

I became anxious about an alternative way to solve this, but faced new
obstables now.

I am launching my wx app through PD
(http://crca.ucsd.edu/~msp/software.html),
which seems to open several python apps fairly well plus joystick
works nice in there and can send messages to the py app calling
functions inside classes

problem is: things like wxCallAfter where hanging my app
and later on getting: "Xlib: unexpected async reply" errors
while calling to functions inside the py app from PD, which pretend to
do a GetNextSibling to select next, or SetFocus() somwhere else.

if this not the right list for this, or I should re-post to this, let me
know.

muchas gracias!
Rama

btw, let me know if I can be of help for trying/debugging wxJoystick

···

El jue, 13-05-2004 a las 04:44, Robin Dunn escribió:

rama wrote:
> Hi wx'rs
>
> I'm new to wxPython and this list.
> I have an almost finished app to which I'm trying to add control trhough
> joystick without success.
>
> I'm trying the wxJoystick from the demo package wxPythonDemo 2.4 version
> either got from the web or the debian package but the joystick doesn't
> seem to work.
>
> I am on debian sid.
>
> If I run jstest /dev/js0 or /dev/js1 (a symlink to the first) I get the
> device working, so I am confused.
>
> Also other application (PD = Pure Data) works correctly with the same
> joystick. At the moment it is an analgo (Agiler) but I tried briefly
> before with a Logitech Wingman Rumblepad to no avail.
>
> I tried stracing the joystick demo app and it seems opening /dev/js0 and
> later both, but no expected results though.
>

It looks like wxJoystick is trying to open the device read/write, so if
you don't have write permissions to it (as I didn't) then it will fail
to open it. A closer look shows that there is no hope for it to work
even if you do have permissions to the device as the unix implementation
seems to be incomplete. It creates a thread for reading the joystick
device and sending the events, but it never starts it. I'll see if I
can get it fixed for the next 2.5 release.

--

rama <medialist@xicnet.com>

rama wrote:

Thanks for fast response! delay was mine.

I became anxious about an alternative way to solve this, but faced new
obstables now.

I am launching my wx app through PD
(http://crca.ucsd.edu/~msp/software.html), which seems to open several python apps fairly well plus joystick
works nice in there and can send messages to the py app calling
functions inside classes

problem is: things like wxCallAfter where hanging my app
and later on getting: "Xlib: unexpected async reply" errors
while calling to functions inside the py app from PD, which pretend to
do a GetNextSibling to select next, or SetFocus() somwhere else.

I know nothing about PD but messages like that usually happen when trying to call methods that modify a GUI object from a thread that is not the main thread.

btw, let me know if I can be of help for trying/debugging wxJoystick

I checked in my changes last week. If you want to try it out build the CVS version of wxWidgets and wxPython and let me know how it goes.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

rama wrote:
>
> problem is: things like wxCallAfter where hanging my app
> and later on getting: "Xlib: unexpected async reply" errors
> while calling to functions inside the py app from PD, which pretend to
> do a GetNextSibling to select next, or SetFocus() somwhere else.

I know nothing about PD but messages like that usually happen when
trying to call methods that modify a GUI object from a thread that is
not the main thread.

yes, that's exactly what I've found searching the web.
I still need to investigate more about how to make those "messages"
speaking to my py app go through the same thread which started the app.
It seems PD itself sends each new message (which are calls to functions
inside specific pd-py classes) over a new thread, so there is the
problem.

> btw, let me know if I can be of help for trying/debugging wxJoystick

I checked in my changes last week. If you want to try it out build the
CVS version of wxWidgets and wxPython and let me know how it goes.

excelent, for the moment I'm using the debian packages for all of it,
but I will dive into building CVS versions ASAP.

cheers
Ramiro-

···

El lun, 17-05-2004 a las 20:59, Robin Dunn escribió:

--
rama <medialist@xicnet.com>

great! Finally I managed to compile wxWidgets and wxPython, and the
joystick seems to work really nice.
The only things that don't seem to work are the options just beside the
POV Control in the demo (Availabe, 4-way only, Continuous).
I'm using a Logitech WingMan Rumblepad, wxWidgets and wxPython from CVS
and Python 2.3 on a Debian Sid.

Tell me if there is anything I should do to further test that part.

btw, now I'm working on programming the joystick to navigate a
wxTreeCtrl. I am about to post separately for this subject as I'm going
mad fiddling around with wxTreeCtrl.GetNextSibling(),
wxTreeCtrl.GetFirstChild() and things like that.. and I'm not sure
that's the way to go.

thanks for your help, Robin!

greetings
Ramiro

···

El lun, 17-05-2004 a las 15:59, Robin Dunn escribió:

rama wrote:

> btw, let me know if I can be of help for trying/debugging wxJoystick
>

I checked in my changes last week. If you want to try it out build the
CVS version of wxWidgets and wxPython and let me know how it goes.

--
rama <medialist@xicnet.com>

rama wrote:

The only things that don't seem to work are the options just beside the
POV Control in the demo (Availabe, 4-way only, Continuous).

Those aren't 'options', just indicators. Hm, maybe I should replace those with the psudo-LED indicators.

jeje, clear! uhmm, so, yes, probably those checkboxes look confusing.
LED indicator should be it.

greetings
Ramiro

···

El sáb, 22-05-2004 a las 18:17, Jeff Grimmett escribió:

rama wrote:

> The only things that don't seem to work are the options just beside the
> POV Control in the demo (Availabe, 4-way only, Continuous).

Those aren't 'options', just indicators. Hm, maybe I should replace
those with the psudo-LED indicators.

--
rama <medialist@xicnet.com>

rama wrote:

rama wrote:

btw, let me know if I can be of help for trying/debugging wxJoystick

I checked in my changes last week. If you want to try it out build the CVS version of wxWidgets and wxPython and let me know how it goes.

great! Finally I managed to compile wxWidgets and wxPython, and the
joystick seems to work really nice.
The only things that don't seem to work are the options just beside the
POV Control in the demo (Availabe, 4-way only, Continuous).
I'm using a Logitech WingMan Rumblepad, wxWidgets and wxPython from CVS
and Python 2.3 on a Debian Sid.

Tell me if there is anything I should do to further test that part.

The way I read the Linux joystick driver docs it appears that there is no way to spcifically get the POV values. The dirver always delivers those as an extra set of axis values, but I think that it will vary by type of joystick which axes will be used for the POV.

btw, now I'm working on programming the joystick to navigate a
wxTreeCtrl. I am about to post separately for this subject as I'm going
mad fiddling around with wxTreeCtrl.GetNextSibling(),
wxTreeCtrl.GetFirstChild() and things like that.. and I'm not sure
that's the way to go.

Probably.

···

El lun, 17-05-2004 a las 15:59, Robin Dunn escribió:

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

rama wrote:
>
> great! Finally I managed to compile wxWidgets and wxPython, and the
> joystick seems to work really nice.
> The only things that don't seem to work are the options just beside the
> POV Control in the demo (Availabe, 4-way only, Continuous).
> I'm using a Logitech WingMan Rumblepad, wxWidgets and wxPython from CVS
> and Python 2.3 on a Debian Sid.
>
> Tell me if there is anything I should do to further test that part.

The way I read the Linux joystick driver docs it appears that there is
no way to spcifically get the POV values. The dirver always delivers
those as an extra set of axis values, but I think that it will vary by
type of joystick which axes will be used for the POV.

allright, I don't know much about that part. I'm still implementing
joystick navigation for my app.

so maybe I use the hats/POV (if they are called like that) to control
the audio volume. then if it is of interest I will report how it goes.

>
> btw, now I'm working on programming the joystick to navigate a
> wxTreeCtrl. I am about to post separately for this subject as I'm going
> mad fiddling around with wxTreeCtrl.GetNextSibling(),
> wxTreeCtrl.GetFirstChild() and things like that.. and I'm not sure
> that's the way to go.

Probably.

yes, seems like I almost have it done, if it results useful I will post
the code I used to solve it.

infinite thanks for all the support

cheers
R

···

El lun, 24-05-2004 a las 14:45, Robin Dunn escribió:

--
rama <medialist@xicnet.com>