LinuxMCE Forums

General => Developers => Topic started by: tschak909 on April 14, 2009, 06:31:39 pm

Title: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on April 14, 2009, 06:31:39 pm
This thread will detail the development and status of the Gyration 3101 Media Center Remotes.

Thank you all for your contributions thus far, so I am at this point waiting on the hardware to get here. I believe Jimmiejames has sent the hardware, as he asked me for my address here, which if anyone needs this to send hardware, or any correspondence, feel free to ask me in private message.

Onward and Upward.

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on April 15, 2009, 12:11:33 am
I have recieved payments from almost all of you, I believe. Will work with colinjones to verify.

I have ordered the Beagle USB protocol analyser for work, it will be arriving in a few days.

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on April 18, 2009, 05:58:14 am
Remote has arrived, thank you. Awaiting shipment of USB protocol analyser.

MCR Remote seems to have exact same USB ID as Gyration Go mouse. Same dongles it appears.

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on April 18, 2009, 07:06:09 am
I have started notes on integration here in the wiki:

http://wiki.linuxmce.org/index.php/GYR3101_Integration_Notes

Which includes a color coded chart of what part of the HID subsystem will decode each currently available decodable button, there are a couple at the bottom which don't emit any sort of HID code. Forensic analysis when I get the analyser will shed more light on this.

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: jimmejames on April 18, 2009, 07:13:49 am
For anyone curious, I purchased the remote Thom is configuring for at the now defunct Circuit City approximately 2 years ago.  It was a 30 something dollar remote at the time....   there is nothing special about it- your standard off the shelf model.
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on April 21, 2009, 10:00:50 pm
I have recieved the forensics analysis equipment, and will use it to analyse packets for the remaining buttons, as well as analyse the connect and bind request for any information we can use.

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on April 22, 2009, 05:04:42 am
Analysis with forensic equipment verifies my initial findings.

Everything shown on color coded chart is decoded.

And in actuality even the rocker switches are decoded, as well under 0810, which was a nice surprise.

Now, this essentially means AT THIS point:

* No Follow Me, that was handled by Fiire's firmware
* the left and right buttons are not mapped to media and lights. I am trying to see what will need to happen to intercept these to get expected behaviour.

To see what I need to do for this first pass, take a look at the template for the Gyration Go mouse.

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: krys on April 24, 2009, 05:09:44 pm
Good News! and good to see your making progress.
-Krys
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on April 26, 2009, 10:28:38 am
Some more investigative work done.

Architecturally, the remote is actually three devices in one, a mouse, and two keyboard devices.

For reasons not really important, Gyration split the remote into a keyboard and mouse, both of which have event devices which emit HID packets.

The good news is, that ALL of these packets are completely decoded by the kernel in 0810. However, this is made less easy by the fact that I have to decode button presses from two different devices, and act upon them.

It's made even more interesting by the fact that X does not decode the resulting event Key messages. Why? is anyone's quess. So this means that the input device must be accessed directly, and the resulting Key messages need to be decoded.

So for this remote, we need two threads created which listen to the input device file, read from it, and queue up a key event inside orbiter for further processing.

This brings us to the second bit of this whole thing, now that we know we have to decode these event messages, can't we just make and ship a DCE device that sends DCE commands to the right places?

Not exactly, and that would be reinventing part of the wheel...

Because there isn't a direct correlation between all keys and DCE commands, or PK_Button symbols, there is no way to just make a DCE device that sends Simulate Keypress messages to the orbiter.

Why?

Well, the answer is a bit more complicated.

LinuxMCE deals with anything that has buttons that you use as a remote to an on-screen device, as an Infra Red remote. This is done so that the RemoteMapping table can be used to determine what commands to send depending on the screen that is currently visible.

There are rows for each screen type, and in each, a set of new line delimited lines, containing:

keysym1;keysym2|message to send

i.e.

tv;live_tv;LiveTV;|0 -106 1 43 29 1

you can refer to this mapping by tv, live_tv, or LiveTV, and when evoked, will send a message from device 0 to -106 (the media plugin), message type 1 which is command, 43 which is MH Start Media, 29 which is the command parameter for media type, and 1 which means media type 1, which is TV.

Basically, this is the same format as the last set of parameters as MessageSend.

why is this important?

When Orbiter starts, it looks for all children of the Orbiter that are of category Remote Controls. It will then grab two very important pieces of device data, Configuration, and Mapping.

Mapping, is basically just a simple way to re-map scan codes (which are normally X scan codes, but can contain synthetic scan codes injected into the event system too. we'll use this to deal with buttons that X doesn't deal with.), the Gyration Go Mouse template uses this to map the three grey buttons to key codes for F6, F7, and F8, and can be used for SIMPLE remapping of completely decodable buttons to other keys. I use this to map the green windows button to menu. Each entry is:

event type, event keycode=new event type, new event keycode

event types:
2 = key pressed
3 = key repeat

Configuration, is the more interesting one, and can be used to emit commands to the system based on key codes that are recognized.

It is organized as so, one per line:

RemoteMapping_Entry,x scancode,UDH,Y

the last parameter is optional.

The first bit is of course, the remote mapping entry to match, remember earlier?, the second bit is the scan code to match, the third bit corresponds to Up, Down, or Held-down states, and Y is an optional parameter, that if present, means that this mapping ONLY makes sense for screens that have yielded all input, such as when a DVD menu is displayed, or when MythTV is visible. These correspond to screen types that are labeled as "osd" in the description.

These two device data will be used to map our remote buttons, but this still begs the question, if X doesn't decode our buttons, how will they reach this point?

This is where our injecting synthetic events comes into play.

There is a method in Orbiter that injects events into Orbiter's event queue. One of those events registers key presses, along with up, down, hold states.

What we do, is take the HID codes emitted, and add 10000 to them, so we can distinguish them from the other scan codes.. so HID packet 401 becomes 10401.

We can then reference the button like so in Configuration:

Music,10401,U,Y

and we now have a mapping for the music button to go to the music screen.

I hope this is shedding a light for others as to the internals of supporting other types of remote controls.

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: hari on April 28, 2009, 05:37:22 pm
way to go tschak!! Thanks for the braindump!!
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: krys on May 06, 2009, 07:17:04 pm
Any new progress?
-Krys
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on May 06, 2009, 07:30:19 pm
I had to take some time to investigate the HAL problem a bit further..when I get a chance, i'll hammer out the first pass of the new HID code in orbiter to handle spawning HID input threads and injecting synthetic event numbers onto them.

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: LegoGT on May 09, 2009, 05:09:07 pm
Are donations still being accepted for this work? I am really interested in this and would like to support it in any way possible.
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: dlewis on May 09, 2009, 05:13:00 pm
Are donations still being accepted for this work? I am really interested in this and would like to support it in any way possible.

Yes, donations are still being accepted. Please contact colinjones or tschak909 for details.
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: totonano on May 26, 2009, 09:17:19 pm
Any new progress?
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on May 26, 2009, 09:20:20 pm
Yes, I am working on the code now that I have free time.

As soon as I have it working, I'll post in. I've learned everything I need to learn for this, so I've been quiet. Now it's just clerical work to bang it out, and figuring out where to spawn the threads inside Orbiter.

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: colinjones on May 27, 2009, 12:47:40 am
Thom

Does that mean, then, that you also know what is needed to get the Fiire remote working under the new kernel HID handler instead of libusb? I am presuming that the Gryation remote needs to interface in the same way, or am I missing something there? (you know I really just want to upgrade to 0810 :) )
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on May 27, 2009, 12:55:37 am
I've said this before, and I won't mention it again.

The Fiire Remote is a SPECIAL CASE and must be handled by a totally different routine.

I will get to it, when I get to it. I promise.

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: hari on May 27, 2009, 12:13:41 pm
I'd love to not see any HID related code in orbiter... it is so fat already :-P
/me runs
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on May 27, 2009, 04:29:02 pm
Trust me, I wouldn't either. But there are many remote buttons that do not have DCE commands to directly map to, that have direct meaning in Orbiter itself. I have to have access to Orbiter's event queue.

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: hari on May 27, 2009, 05:20:29 pm
and what prevents us from adding the proper events?

br, Hari
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on May 27, 2009, 07:01:26 pm
anything is possible, i'm just telling you what i have to do now to make this work. :)

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on June 27, 2009, 09:14:32 pm
Well guys, it was a long road. But I just committed the Generic HID Handler to SVN, and the matching Gyration 3101 changes to sqlcvs.

This is a first pass, all the buttons work. I want to add support for holding down the mouse buttons to trigger the media and lights submenus, but that will come during the beta testing.

Thank you all for contributing, the feature is complete enough for testing for those of you who have 0810 installs.

There will not be an update for 0710.

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: kyfalcon on August 24, 2009, 05:07:40 pm
Thom,

I noticed that the up and down arrow buttons don't seem to work correctly for me. If I go to audio or video and then try to use them to scroll up or down they end up causing the list to jump to a particular artist or movie. Do I need to reset my remote somehow or somehow update its firmware. Does anybody else see this problem. Everything else works great! Appreciate the hard work!
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: fido on August 24, 2009, 05:46:30 pm
on a similar note, on my latest version the remote doesnt seem to function much.

For example the pause / play / rew / ff keys dont work at all when playing DVDs

The forward, rewind buttons when clicked bring up Thoms new overlay that allows you to mute or play/pause the movie.

Then while watching a ripped movie, the play/pause buttons dont work but the FF and RW buttons do....

Anyone else encountering this behaviour ?

I am pretty sure the remote worked a lot better on a previous build.....
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: WhateverFits on August 26, 2009, 01:11:46 am
fido, have you done apt-get update, apt-get dist-upgrade on the media director? Just curious if that has been done or if it fixed your problem.
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: fido on August 26, 2009, 03:34:30 pm
yeah, it was a clean install built from source...so all was up to date....

I have a drive with my previous build on it, so will probably add it back in and see how it compares....
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: stallione on August 30, 2009, 05:08:49 am
Thom is aware of this issue and will hopefully have the arrow keys working properly by the next build.
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: Viking on August 31, 2009, 09:44:22 pm
Hi,

I have finally also got hands on one of theese - very nice indeed :)

But how can I get the Fastforward/rewind rose up ?
# and * both gives me the Lightning rose ...

And secondly - it would be nice if there could be a button or linuxmce menu selection (after pressing the green windows key) for the MythTV "Menu key". As it is needed for changing audio or if the 16:9 description of the channel/program is not right and one has to change that manual. Even better would be the zoom menu that LinuxMCE has ;)

Did I descrbe that clearly enough ?

Greetings
Viking
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: tschak909 on August 31, 2009, 09:47:16 pm
this has been fixed in recent builds, tap the top left [>] button next to the left arrow to get the media gyro menu. There is no button for the light/vol atm.

-Thom
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: Viking on August 31, 2009, 10:07:41 pm
Hi Thom,

thanks a lot :) , will try it out in my test system (when i find time).

Do you use MythTV ? What do you think of my suggestion of having a Menu key ? Maybe using the "LiveTV" button below "skip" here :
http://wiki.linuxmce.org/index.php/Using_the_Gyration_Remote_GYR3101US_(Non-Fiire_Chief)

Greetings
Viking
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: kyfalcon on September 04, 2009, 06:10:33 pm
Thom,

Kudos it seems everything is working A-Ok on my remote. Thanks
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: huh on February 14, 2010, 07:34:03 am
Does anyone know the difference between a GYR3101US and a GYR3201US?

Both Circuit City and Tiger Direct have them for $30 plus shipping
http://www.circuitcity.com/applications/SearchTools/item-details.asp?EdpNo=5608195&CatId=358 (http://www.circuitcity.com/applications/SearchTools/item-details.asp?EdpNo=5608195&CatId=358)


I have both WebDTs, had a N800 and have a GYR3101US.  Although I prefer the WebDT, my wire prefers the gyration remote...
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: rperre on February 14, 2010, 04:45:11 pm
that link is a 3201 which is supported, i just bought some from someone else.

never heard of the 3101 ?

Richard
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: huh on February 14, 2010, 04:50:25 pm
Are you sure you don't have that backwards?  From Vikings email above- it's the 3101 that's in the wiki.

Hi Thom,

thanks a lot :) , will try it out in my test system (when i find time).

Do you use MythTV ? What do you think of my suggestion of having a Menu key ? Maybe using the "LiveTV" button below "skip" here :
http://wiki.linuxmce.org/index.php/Using_the_Gyration_Remote_GYR3101US_(Non-Fiire_Chief)

Greetings
Viking
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: rperre on February 15, 2010, 01:25:20 am
I stand corrected, it's the 3101 i have.

For that price though i would try it, but i have 2 now and don't need more.

It looks like the exact same remote.

Richard
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: huh on February 15, 2010, 04:23:44 am
I ordered one.... should be here Wednesday...  I will test and post results...
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: rdmustang on February 18, 2010, 05:25:45 pm
I have 2x 3101 and 1x 3201.  Both work equally fine with an updated configuration in 0710.  The only downside to the 3201 is that it has a gold tinted faceplate instead of a silver one.
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: huh on February 18, 2010, 07:09:39 pm
Cool-  thanks for the heads up.   CC had them backordered...  Revised delivery is now tuesday...  Gold faceplate vs extra $60 for a silver one- for that I'm ok with gold
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: rperre on February 21, 2010, 06:53:26 am
Does anyone else have problems with these 3101 remotes, it seems to not connect right to the dongle.

In windows, there is no problem, it almost seems like a problem with power to the dongle, does this need a powered USB, and if so are the ion boards not powered?

Richard
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: wombiroller on February 21, 2010, 07:15:30 am
Does anyone else have problems with these 3101 remotes, it seems to not connect right to the dongle.

In windows, there is no problem, it almost seems like a problem with power to the dongle, does this need a powered USB, and if so are the ion boards not powered?

Richard
Mine seems to be working fine in 0810 Beta...
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: rperre on February 22, 2010, 03:59:06 am
mine works fine in windows, but on the md it's spotty

sometimes a button works, sometimes not. changed batteries, etc... unplugged.... removed it from webadmin, restarted, etc...

Maybe i'm doing the connect wrong, what is the process you all use.

Richard
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: wombiroller on February 22, 2010, 04:07:31 am
sorry rperre - for me it has been plug and play - no process... I occasionally have problems with me 'left click' button but I think that is just the remote playing up - all other buttons are OK.
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: rperre on February 24, 2010, 01:57:17 am
I finally tried an extension cord on the dongle, and guess what, it works without a hitch. I guess it wasn't plugging in all the way. Oh well at least i know it's working now. Love these remotes btw.

Richard
Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: huh on February 24, 2010, 05:32:13 am
I received my remote and after plugging it in, I found that these 3201's are essentially identical- as far as LMCE is concerned- with the 3101s! 

The only differences I can tell between the 3101 and 3201 are that:

1) My 3101 has a slight gold tint on the top surface- the 3201 is silver
2) At the very top left of the 3101 remote it says "Gyration".  No writing is visible in the same spot of the 3201.

I'm with Richard- these remotes are amazing.  Big thanks again to Thom for getting them working.

Title: Re: Development: Supporting Gyration Media Center Remotes
Post by: alx9r on November 03, 2010, 04:29:57 pm
I just wanted to thank thom for the work on this remote.  It really is an awesome way to control Linuxmce.  And it was completely plug and play under my 0810 install.

Thanks Thom!