Author Topic: Media list (grid) scroll/page down button on IR remote  (Read 22085 times)

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Media list (grid) scroll/page down button on IR remote
« on: January 19, 2013, 08:31:51 pm »
Set up the remote that comes with the Zotac AD04 box in LinuxMCE and it works really nicely - the receiver being my new USBUIRT. But my only gripe is that in media lists I have to scroll right to the bottom before I can get the list to scroll. How do I set up a button to page down on the media list?

Any ideas? I've tried the chanup, chandown buttons and, in fact, just about every other button but none seems to do that.

Another thing that would be useful is to be able to access the "letter list" on the right. That would help to be able to jump to a point on the list but with a plain IR remote (not a mouse/gyro or wiimote) it doesn't seem possible. Is it?

thanks
James

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Media list (grid) scroll/page down button on IR remote
« Reply #1 on: January 19, 2013, 08:59:56 pm »
Most likely, you need to make a new remote device template.

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

-Thom

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Re: Media list (grid) scroll/page down button on IR remote
« Reply #2 on: January 21, 2013, 07:51:08 am »
Thanks, Tshak. I have done that, though - built the new template for my remote and, as mentioned above, it is all going swimmingly. The buttons work well.

And I can go down entry by entry through the media list by using the down button. When I get to the bottom another down press causes the list to scroll. But it would be nice to be able to do that with a separate button without having to go down through all the entries- a sort of "page down" button.

So my limited understanding of remotes is that there is a list of commands that LMCE understands as per wiki entry

So most of these have IR codes in my remote template but I'm trying to execute specific behaviour on the UI with a specific button. I think the DCE command I'm trying to execute is the "scroll grid" command... and I would like to somehow tie that to a particular button on my remote, say "channel up/down"... so that when I'm viewing the media list, pressing that button would cause the grid to scroll.

It looks as if what I'm after may be some custom configuration in the Programmer's Guide. This points to remote mapping between button names and DCE commands that are sent when a button is pressed in a certain context. Sweeet. Will check it out.

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Re: Media list (grid) scroll/page down button on IR remote
« Reply #3 on: January 22, 2013, 07:26:27 am »
OK, I'm getting a bit more understanding of this lot thanks to the wiki pages - Remote Mapping Table, Command Table and Button Table which some kind soul recreated last night.

Of course all of the above exist in the Pluto Media database but it's difficult to know that without the nice, linking wiki entries.

It seems that the sequece of "events" from IR remote to LinuxMCE action is something like this-

  • Button Press on remote, transmits IR code to receiver
  • Receiver device, set up in LinuxMCE receives IR code and checks if it matches IR codes in any of the remotes that are controlled by it. This is done via the IR codes section in the remote template, where a "command" is associated with the IR code
  • If the above matches, the "command" or "button" is therefore known... this "command" is then checked against the Remote Mapping Tabletable. There may be multiple entries in this table for the same command but pluto tries to match the most specific (ie least generic) one.... specifically, it will first match an entry in this table where the "Screen Type" and "Remote Layout" match those in the current context. If this fails, it will fall back to a less specific entry.
    • On matching in the above table, the associated message is sent to the associated device using a similar format to messagesend.
    .

    In my case, all looks good - I'm pressing the chup/chdown button on my remote, which, according to my remote template, should be telling the receiver that the "command" is chup or chdown. Since I'm on the media browser screen (type B), this should result in a message of "0 -203 1 28 26 6" or "0 -203 1 28 26 7" being sent. Decoding this lot- 0 means the message is "from" device (core/dcerouter?), -203 means message is "to" onscreen orbiter of current room 1, 1 means it is a message of type "command" 2, 28 is the command itself, which in this case is a simulated keypress 3, 26 is the parameter name for the command and 6 is the parameter value. In the case of "simulated keypress", the parameter is the key itself which, from the button table, 6 represents Scroll Up!!! 4 So it should flipping work!

    Nope.

    So I thought I'd check out the DCErouter log this morning while the children set fire to the furniture in another part of the room...
Code: [Select]
08      01/22/13 7:09:57.786              Parameter 74(Offset): 0 <0x76eafb70>
05      01/22/13 7:09:57.786            file grid pics took 0 ms <0x976f0b70>
08      01/22/13 7:10:09.129            Received Message from 121 (USB UIRT 0038 / TV
Room) to 10 (Media Plug-in / Server Closet), type 1 id 65 Command:Jump Position In
Playlist, retry none, parameters: <0x6e69eb70>
08      01/22/13 7:10:09.129              Parameter 5(Value To Assign): +1 <0x6e69eb70>
08      01/22/13 7:10:32.622            Received Message from 121 (USB UIRT 0038 / TV
Room) to 10 (Media Plug-in / Server Closet), type 1 id 65 Command:Jump Position In
Playlist, retry none, parameters: <0x6e69eb70>
08      01/22/13 7:10:32.622              Parameter 5(Value To Assign): -1 <0x6e69eb70>
08      01/22/13 7:10:41.349            Received Message from 121 (USB UIRT 0038 / TV
Room) to 10 (Media Plug-in / Server Closet), type 1 id 65 Command:Jump Position In
Playlist, retry none, parameters: <0x6e69eb70>
08      01/22/13 7:10:41.349              Parameter 5(Value To Assign): +1 <0x6e69eb70>
08      01/22/13 7:10:42.878            Received Message from 121 (USB UIRT 0038 / TV
Room) to 10 (Media Plug-in / Server Closet), type 1 id 65 Command:Jump Position In
Playlist, retry none, parameters: <0x6e69eb70>
08      01/22/13 7:10:42.878              Parameter 5(Value To Assign): +1 <0x6e69eb70>
08      01/22/13 7:10:44.314            Received Message from 121 (USB UIRT 0038 / TV
Room) to 10 (Media Plug-in / Server Closet), type 1 id 65 Command:Jump Position In
Playlist, retry none, parameters: <0x6e69eb70>
08      01/22/13 7:10:44.314              Parameter 5(Value To Assign): +1 <0x6e69eb70>
08      01/22/13 7:10:45.688            Received Message from 121 (USB UIRT 0038 / TV
Room) to 10 (Media Plug-in / Server Closet), type 1 id 65 Command:Jump Position In
Playlist, retry none, parameters: <0x6e69eb70>
08      01/22/13 7:10:45.688              Parameter 5(Value To Assign): +1 <0x6e69eb70>

Aha!! Looks as if possy was on the right track. It looks like the correct message being fired "Jump position in Playlist" (sort of...) but why is it going to the Media Plug-in in the Server Closet? Is there a media plug-in in the TV room.... don't know because I'm at work but will check later. So it could be that it's being sent to the wrong plug in. OR.... maybe it's just the wrong flipping command... is Jump Position what I want? Stay tuned.
« Last Edit: January 22, 2013, 07:46:25 am by jamo »

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Media list (grid) scroll/page down button on IR remote
« Reply #4 on: January 22, 2013, 07:44:10 am »
if you look at the media plugin, there is a message interceptor for the jump to position in playlist command...depending on the target media device, this is transformed, and/or sent to the target device.

-Thom

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Re: Media list (grid) scroll/page down button on IR remote
« Reply #5 on: January 22, 2013, 09:26:59 pm »
TShak has helped me shed some light on this-

When the media grid is up, I'm on screen 66. I know this from the DCERouter.log at thepoint where I hit the "Audio" from the media menu.
Code: [Select]
35;1mSet Screen Type^[[0m, retry none, parameters: <0x773f9b70>
08      01/22/13 21:55:19.657             Parameter 48(Value): 66 <0x773f9b70>

The screentype for this screen is revealed as NULL from the pluto database as follows
Code: [Select]

mysql> select ScreenType from DesignObj inner join Screen_DesignObj on DesignObj.PK_DesignObj = Screen_DesignObj.FK_DesignObj where Screen_DesignObj.FK_Screen = 66;
+------------+
| ScreenType |
+------------+
| NULL       |
+------------+
1 row in set (0.00 sec)

Therefore, I need to look at the remote mapping that matches to screentype=null and remotelayout='W'. Not quite sure why the remotelayout is 'W' but it is in the corresponding field in webadmin for my remote.

So, retrieve remotemapping as follows
Code: [Select]
mysql> select * from RemoteMapping where RemoteMapping.ScreenType is null and RemoteMapping.RemoteLayout = 'W';
Empty set (0.00 sec)
But... I seem to recall that the null/null option will be the default if you don't get a more specific match.
Code: [Select]
select * from RemoteMapping where RemoteMapping.ScreenType is null and RemoteMapping.RemoteLayout is null;
which returns 1 row with the relevant chup/chdown lines revealing
Code: [Select]
chup;ChanUp;|0 -106 1 65 5 +1
chdown;ChanDown;|0 -106 1 65 5 -1
Which corresponds nicely to what is happening as shown in the log below. The media plugin is getting the chup, chdown buttons as a "jump position in playlist" which is nice... but not what I want. The problem, to my mind, is that the context needs to be set... this is not media that's playing... this is a grid (or filelist) that's viewing. So the grid needs a screentype (not a null as I found it to be) and the screentype needs to correspond then to a remote mapping in the remote mapping table that transforms the remote buttons into something more appropriate to a grid/filelist.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Media list (grid) scroll/page down button on IR remote
« Reply #6 on: January 22, 2013, 09:57:49 pm »
WHOA WHOA WHOA WHOA WHOA! ___STOP____!

*thwap-jamo-really-hard*

Dude, you didn't listen to what I said!

Parameter Value 48 is the ASCII value for the screen type letter! I specifically said this! STOP WHAT YOU ARE DOING AND PULL UP AN ASCII CHART!

Look for value 66...

That is 'B' !

RemoteLayout is also not used, ignore it.

-Thom


jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Re: Media list (grid) scroll/page down button on IR remote
« Reply #7 on: January 23, 2013, 07:28:22 am »
*Thanks Tschak for the correction delivered with all the subtlety and finesse of a Texan*

OK, sorry, that does make sense- so the message in the log
Code: [Select]
35;1mSet Screen Type^[[0m, retry none, parameters: <0x773f9b70>
08      01/22/13 21:55:19.657             Parameter 48(Value): 66 <0x773f9b70>
is noting the screen type being set as opposed to the actual screen ID. Which is what it says, of course!

Right, so the screen type at the point when I press chdown on the remote is 'B'. Remote layout is ignored, so, by Remote Mapping looking at ScreenType 'B', a chdown on the remote should fire one of these:
Code: [Select]
chdown;ChanDown;|0 -203 1 28 26 7.
Which should be a message to the Onscreen Orbiter (-203) of type command (1) which is a simuated keypress (28) for which parameter 26 has the value 7. The button table would give 7 as "Scroll Down".

So all the setup looks good. Except that when I press the button on the remote, I get a
Code: [Select]
08      01/22/13 7:10:09.129            Received Message from 121 (USB UIRT 0038 / TV
Room) to 10 (Media Plug-in / Server Closet), type 1 id 65 Command:Jump Position In
Playlist, retry none, parameters: <0x6e69eb70>

Why, Mr Anderson, why?

I guess the first test I can do is hit the "play" button when I'm on the same grid because in the remote mapping, that is mapped to
Code: [Select]
Play;|0 -203 1 37 for screentype 'B' but is not mapped to that for any other screentype. So if the system is using that record in remotemapping, I would expect to get the associated command 37 which is "play media" send to the onscreen orbiter (device -203).

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Media list (grid) scroll/page down button on IR remote
« Reply #8 on: January 23, 2013, 03:47:50 pm »
Hey, had to stop ya, because when it comes to the database, you have to be 100% correct, or stuff breaks spectacularly! :)

-Thom

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Re: Media list (grid) scroll/page down button on IR remote
« Reply #9 on: January 24, 2013, 08:33:17 am »
Hey, had to stop ya, because when it comes to the database, you have to be 100% correct, or stuff breaks spectacularly! :)
-Thom

Sure!

OK... no real progress last night except to say that after a little more log watching and reviewing the remote mapping, device tables etc, I'm convinced that for some reason the RemoteMapping for screentype 'B' is *not* being used. The keypresses I make on my remote generate messages in the DCERouter.log that correspond very accurately with the default RemoteMapping which leads me to suspect that the more specific Mapping for screentype 'B' is not being used, despite the current screen definitely being of type 'B'.

Also confirmed that the message that *should* be sent if mapping for 'B' is used would work- I used
Code: [Select]
/usr/pluto/bin/messagesend localhost 0 78 1 28 26 7
Where 78 is the onscreen orbiter in question (similar to virtual device -203) and command 28 is simulated keypress with parameter 7  mapped to "Scroll down". it works - the media grid scrolls.

And, afaict, this is what should happen when I press chdown on my remote when on screentype 'B'. But it doesn't, instead I get "jump to position in playlist" passed to the media plugin, which corresponds with what should happne if the default mapping is used.


Going to have to dig a bit further.

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: Media list (grid) scroll/page down button on IR remote
« Reply #10 on: January 27, 2013, 10:34:41 pm »
Set up the remote that comes with the Zotac AD04 box in LinuxMCE and it works really nicely - the receiver being my new USBUIRT. But my only gripe is that in media lists I have to scroll right to the bottom before I can get the list to scroll. How do I set up a button to page down on the media list?

Any ideas? I've tried the chanup, chandown buttons and, in fact, just about every other button but none seems to do that.

On standard MCE remotes these buttons used to scroll the mediagrids for me, that stopped working with my standard MCE remote some time ago.  Don't remember when.  Haven't worked for quite some time in 1004 imho.  Forgot all about it till now and just tested it.  No scroll with my standard MCE remote.

J.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Media list (grid) scroll/page down button on IR remote
« Reply #11 on: January 28, 2013, 12:09:04 am »
I need you both to tell me, if there is more than one Infrared Interface connected to your media director, and which one is set as the primary interface (look in Web Admin -> Wizard > media directors).. NOTE: USB Game Pad counts as an IR interface.

I am willing to bet, that a patch that I had submitted (which has since been undone), fixed this by sending CMD_Set_Screen_Type messages to ALL of the IR transcievers attached to the system, instead of merely to the first one. (One of the many things sent over to an Orbiter when it initializes, is a device map).

-Thom

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: Media list (grid) scroll/page down button on IR remote
« Reply #12 on: January 28, 2013, 03:29:59 am »
I need you both to tell me, if there is more than one Infrared Interface connected to your media director, and which one is set as the primary interface (look in Web Admin -> Wizard > media directors).. NOTE: USB Game Pad counts as an IR interface.

I have a single USB-UIRT, a single Windows XP MC Remote and no USB Game Pad devices attached to my core.

J.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Media list (grid) scroll/page down button on IR remote
« Reply #13 on: January 28, 2013, 04:45:59 am »
ok, then I will need to do some further investigation, this is most definitely a bug.

-Thom

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Re: Media list (grid) scroll/page down button on IR remote
« Reply #14 on: January 28, 2013, 09:46:23 am »
Will check the web admin too but also think I have only one IR receiver defined.

I do have two remotes under that one - the std MCE remote that is set up when you install your usbuirt and the one I created, but as far as the receiver goes, I think only one device. Will confirm.

Thanks for the follow up Thom.