Results 1 to 4 of 4
Hi
I am running Ubuntu and I'm trying to use a Logitech S510 media remote (it comes with a USB RF Receiver) in my own program.
With Ubuntu the device ...
- 04-19-2008 #1Just Joined!
- Join Date
- Apr 2008
- Posts
- 4
reading multimedia remote control in 'C'
Hi
I am running Ubuntu and I'm trying to use a Logitech S510 media remote (it comes with a USB RF Receiver) in my own program.
With Ubuntu the device works 'out of the box' when it comes to controlling volume, using the scroller control and pressing the 'OK' button. The 'Play' button also works when running Movie Player.
However, in my own application using the OpenGL key function, the multimedia buttons (including 'Play') do not show up as keypresses at all. Running xev, the multimedia buttons do cause an event but they all give an identical response as follows:
FocusOut event, serial 26, synthetic NO, window 0x3800001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 26, synthetic NO, window 0x3800001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 26, synthetic NO, window 0x0,
keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Does anyone know how I hook into the multimedia controls in the way that Movie Player must do?
Many thanks
- 04-19-2008 #2Just Joined!
- Join Date
- Apr 2008
- Posts
- 4
OK, replying to my own post, I found that, on my machine, the remote control's activity may be seen by typing:
cat /dev/input/event5
Opening this device as a file for binary reading in my 'C' program (and running as sudo) I get the following confusing sequence of bytes when I press the remote's 'Play' button (in decimal):
252 131 010 072 197 087 013 000 001 000 164 000 001 000 000 000 252 131 010 072 205 087 013 000 000 000 000 000 000 000 000 000 253 131 010 072 157 159 001 000 001 000 164 000 000 000 000 000 253 131 010 072 165 159 001 000 000 000 000 000 000 000 000 000
The mad thing is that at the next press I get:
193 132 010 072 168 166 013 000 001 000 164 000 001 000 000 000 193 132 010 072 176 166 013 000 000 000 000 000 000 000 000 000 194 132 010 072 063 207 001 000 001 000 164 000 000 000 000 000 194 132 010 072 072 207 001 000 000 000 000 000 000 000 000 000
then
195 132 010 072 019 019 001 000 001 000 164 000 001 000 000 000 195 132 010 072 027 019 001 000 000 000 000 000 000 000 000 000 195 132 010 072 113 194 003 000 001 000 164 000 000 000 000 000 195 132 010 072 121 194 003 000 000 000 000 000 000 000 000 000
then
195 132 010 072 060 039 008 000 001 000 164 000 001 000 000 000 195 132 010 072 069 039 008 000 000 000 000 000 000 000 000 000 195 132 010 072 029 152 010 000 001 000 164 000 000 000 000 000 195 132 010 072 037 152 010 000 000 000 000 000 000 000 000 000
i.e. the sequence changes each time. I am clearly meddling with dark forces I don't understand.
Does anyone know how this works?
Many thanks.
- 04-20-2008 #3
I don't know anything about this, but nobody else seems eager to jump in. Maybe this might get you started.
--
Bill
Old age and treachery will overcome youth and skill.
- 04-20-2008 #4Just Joined!
- Join Date
- Apr 2008
- Posts
- 4
Thanks for taking the trouble to reply, Bill. Reading around various articles there seems to have been quite a bit of correspondence about making the S510 keyboard and mouse compatible with the Ubuntu kernel and I believe it is now included, but that many of the 'multimedia' features don't work.
The big gap in my understanding is whether the devices are seen as a 'standard' keyboard and mouse or whether there is a proprietary Logitech protocol that has not been implemented in Linux. I've seen some utilities which aim to map 'events' to keypresses etc., but I don't know whether these events are limited to single bytes, or more complex sequences. For instance, there is a system called LIRC which is supposed to be compatible with infrared remote controls. Would this be capable of interpreting the apparently dynamically-changing codes from the S510?
When I see S510 events appearing at /dev/input/event5 how have they arrived there? Is Ubuntu simply relaying bytes from the RF receiver, or is it using some higher level protocol I should know about?


Reply With Quote