LinuxMCE Forums

General => Users => Topic started by: jamo on January 19, 2013, 08:31:51 pm

Title: Media list (grid) scroll/page down button on IR remote
Post by: jamo 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
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: tschak909 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
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo 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 (http://wiki.linuxmce.org/index.php/Infrared_Remote_Buttons_Understood_by_LinuxMCE)

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 (http://wiki.linuxmce.org/index.php/Control_LinuxMCE_using_an_Infrared_remote#Programmer.27s_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.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo 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 (http://wiki.linuxmce.org/index.php/Remote_Mapping_Table), Command Table (http://wiki.linuxmce.org/index.php/Command_Table) and  Button Table  (http://wiki.linuxmce.org/index.php/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-

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.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: tschak909 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
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo 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.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: tschak909 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

Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo 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 (http://wiki.linuxmce.org/index.php/Remote_Mapping_Table) 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 (http://wiki.linuxmce.org/index.php/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).
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: tschak909 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
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo 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.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma 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.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: tschak909 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
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma 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.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: tschak909 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
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo 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.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on January 28, 2013, 09:01:06 pm
I still have the windows MCE remote as shown but I presume by interfaces you mean something else like the USBUIRT, of which I only have one. See screenshot. PS - presume it's ok to delete the default MCEremote?
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on January 29, 2013, 07:31:05 am
Thom

Would like to help with the debugging if I can. Will help me to get a better understanding of the code and structures. Can you point me to which source code covers this section?
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: tschak909 on January 29, 2013, 03:48:01 pm
Can you verify that when the screen changes from the main menu, to the file list view, that there is a Set Screen Type being sent, and that the destination is your USB UIRT device ?

-Thom
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on January 29, 2013, 11:05:06 pm
Can you verify that when the screen changes from the main menu, to the file list view, that there is a Set Screen Type being sent, and that the destination is your USB UIRT device ?

When the screen changes from the main menu to the file list view I see three commands, a 'Populate Datagrid' and 2x 'Get Datagrid Contents'.  No Set Screen Type command appears to be sent.  I'm tailing DCERouter.log for this info.

This would explain why the ch+/- button commands are being sent to the Media Plugin rather than the Orbiter?  While playing media my media control buttons are not working either, I assume a similar 'Set Screen Type' command is missing there.

This is pretty critical to proper operation by IR remote, I'm going to create a ticket.

Jason
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on January 30, 2013, 08:23:20 am
When I hit "Audio" from the media menu, a whole lot of stuff scrolls through the log (because the messages include basically everything that is populating the grid... which is a lot of album titles) but searching backwards to the "Set Screen Type" command, reveals the following
Code: [Select]
35;1mSet Screen Type^[[0m, retry none, parameters: <0x773f9b70>
08      01/22/13 21:55:19.657             Parameter 48(Value): 66 <0x773f9b70>
So, as delicately pointed out by yourself, that is screen type 'B' as per ascii code of 66.
That's from my previous post so I can't check what device it's going to - I'm not at my machine now but will try to have a squizz a bit later and maybe pastebin the whole log from the point where I choose the media list.

Jason, do you not see this if you open the log and search back to the point where you first opened the grid? you have to go back quite a bit...

Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: tschak909 on January 30, 2013, 04:10:17 pm
I need to see the from and to device parameters of the Set Screen Type, to see where the message is going.

-Thom
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on January 30, 2013, 07:39:01 pm
I need to see the from and to device parameters of the Set Screen Type, to see where the message is going.

-Thom


Ok, here's (http://pastebin.com/XR20S6nz) the log from the time I hit "enter" via IR remote on the "Audio" menu to the time I try to press the chdown button on the remote. Sorry about all the "populate data grid" nonsense but I didn't want to clip it and lose something.

Clipped section below:
Code: [Select]
8      01/30/13 20:15:33.525           Received Message from 121 (^[[36;1mUSB UIRT 0038 / TV Room^[[0m) to 78 (^[[36;1mOnScreen Orbiter / TV Room^[[0m), type 1 id 190 Command:^[[35;1mEnter/Go^[[0m, retry none, parameters: <0x6b5b1b70>
08      01/30/13 20:15:33.556           Received Message from 78 (^[[36;1mOnScreen Orbiter / TV Room^[[0m) to USB UIRT 0038(121), type 1 id  687 Command:^[[35;1mSet Screen Type^[[0m, retry none, parameters: <0x775c9b70>
08      01/30/13 20:15:33.556             Parameter 48(Value): 66 <0x775c9b70>
.
.
<snip populate datagrid stuff>
.
.
05      01/30/13 20:15:35.685           ^[[33;1mfile grid pics took 0 ms^[[0m <0x977efb70>
08      01/30/13 20:15:47.283           Received Message from 121 (^[[36;1mUSB UIRT 0038 / TV Room^[[0m) to 10 (^[[36;1mMedia Plug-in / Server Closet^[[0m), type 1 id 65 Command:^[[35;1mJump Position In Playlist^[[0m, retry none, parameters: <0x6b5b1b70>
08      01/30/13 20:15:47.283             Parameter 5(Value To Assign): -1 <0x6b5b1b70>
07      01/30/13 20:18:34.367           Event #75 has no handlers <0x81ddeb70>
07      01/30/13 20:18:34.367           Received Message from 18 (^[[36;1mAsterisk / Server Closet^[[0m) to -1001 (^[[36;1munknown / ^[[0m), type 2 id 75 Event:^[[32;1mExtensions Status^[[0m, retry none, parameters: <0x81ddeb70>
07      01/30/13 20:18:34.367             Parameter 13(Text): SIP/203:Registered <0x81ddeb70>

So as far as I can see- screen type is being set to 'B' and passed to USBUIRT correctly. So no idea why my next "chdown" press yields "Jump Position in Playlist" instead of scroll down as expected.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on January 30, 2013, 08:02:39 pm
Jason, do you not see this if you open the log and search back to the point where you first opened the grid? you have to go back quite a bit...

Nope, I'm not getting that command.  I will check again but I select enter on the remote to open the grid and then got only 3 more commands, not including a Set Screen Type, as the grid displayed.

J.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on January 30, 2013, 09:51:16 pm
Heres my DCERouter.log as I move up the UI2 menu and select the Audio datagrid.  No Set Screen Type command is sent on my system, I'm using a standard XP MCE remote.

http://pastebin.com/ir81qhWN

J.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on February 19, 2013, 07:19:54 am
I'll pick this up again now that the transmitting part it working and try to get to the bottom of this. If you've got any sizeable number of titles in your media list, not being able to page down becomes a real pain. I'm finding I have to use the "search" facility to get to the performer/title I want but it would be nice to browse. Would also be nice to be able to use the "first letter" jump-to list which also doesn't seem possible with a basic IR remote.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on February 19, 2013, 09:39:31 pm
UI2 is intended to be controlled with a gyration remote.  That was its intent.  Controlling it with IR is possible, but as you are finding limited at times.
UI1 was intended for IR remote control.

You could also grab one of the multitude of inexpensive gyro mouse/keyboard/ir remote combos that are popping up.  Have the best of all worlds.  :)
http://unisen-usa.com/product/waveair/kp810r/ for example.

J.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on February 20, 2013, 07:36:48 am
UI2 is intended to be controlled with a gyration remote.  That was its intent.  Controlling it with IR is possible, but as you are finding limited at times.
UI1 was intended for IR remote control.

Now where was that little gem of information hiding when I was planning my system!!

Thanks for the tips, J. I've actually experimented quite a bit with a Wiimote but one of the main reasons I'm not using this on this MD is because if I ever get my AV switching working, there will be no LinuxMCE on-screen-display while I'm controlling my settop box so the UI2-gyro-type controls will be of no use to me because you need the visual cues (on-screen arrows and things which show if you're controlling lights or volume).

As you point out, though, a combo remote would potentially solve that problem.

Hmmmm...

I could go back to UI1 but what I really like about UI2 is the constant media backdrop. I load all our family pics onto the screensaver and it is brilliant having them cycle the whole time in the background. I like UI2.

It really can't be that difficult to sort out this page-down issue, though.... and, hopefully, the jump to letter in the playlist. Otherwise, the IR remote is actually controlling it (UI2) very well for me and it's MUCH easier for my wife and children to work with. Also great having a "button" for pause, stop, mute, etc. Those are things you typically want to do in a hurry so to just pick up the remote and press the button works really well.

I will continue digging in the meantime. I think the next step is to review the logs and maybe get stuck into the code of the mediaplugin which I gather hands a lot of these things off to the various devices etc.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on February 24, 2013, 12:21:01 am
It really can't be that difficult to sort out this page-down issue, though.... and, hopefully, the jump to letter in the playlist. Otherwise, the IR remote is actually controlling it (UI2) very well for me and it's MUCH easier for my wife and children to work with. Also great having a "button" for pause, stop, mute, etc. Those are things you typically want to do in a hurry so to just pick up the remote and press the button works really well.

The pgup/pgdn issues may be solved fairly easily.  If we can determine the exact cause...  Are you using a Windows MCE remote? 

I'm finding I have to use the "search" facility to get to the performer/title I want but it would be nice to browse. Would also be nice to be able to use the "first letter" jump-to list which also doesn't seem possible with a basic IR remote.

Making the letters accessible to an IR remote will take a bunch of grunt work with HADesigner.  Not an easy task but, as far as I know, it could be done.  HADesigner is a real beast and very un-friendly to use.  tschak may be able to provide a little more insight into what would be required to activate these buttons for non-mouse selection.

J.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on February 24, 2013, 08:49:21 pm
Thanks, J.

No, the remote is not an Win MCE remote, it is the remote I got with the Zotac AD04 z-box I'm using as a media director. I  set up a template for it myself.

I guess pg-down is first step and it at least looks as though it is supposed to work whereas it seems as if using an IR remote for the "letter list" is not part of the plan.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on February 25, 2013, 07:20:11 am
Found the source of the problem with lost pgup/pgdn functionality, I have it working again.  Need to chase the functions and figure out why it doesn't work properly the way it is expected to.

J.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on February 25, 2013, 07:31:28 am
Good news! Let me know if there's anything I can test or help out with.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on February 26, 2013, 07:45:34 pm
I hope to have something for you within the week (hopefully sooner).  This issue also seems to be affecting usb game pads.

Jason.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on February 27, 2013, 01:42:38 am
On your MD that you are trying to use the remote with can you try this .deb and let me know if it fixes the issue with your remote.

Code: [Select]
wget http://dl.dropbox.com/u/118201886/pluto-orbiter_2.0.0.45.13022727209_i386.deb
dpkg -i pluto-orbiter_2.0.0.45.13022727209_i386.deb

J.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on February 27, 2013, 05:21:49 am
Is this happening on your core, an MD or both?

J.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on February 27, 2013, 12:51:28 pm
Can try the package tonight.

It is only happening on the MD- am only trying it on the MD. Core is headless in closet.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on February 27, 2013, 01:35:09 pm
Thanks jamo, that shoots down my working theory.

J.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on February 27, 2013, 01:37:13 pm
Ummm... what does that mean? Should I try it or not? What is your theory?
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on February 27, 2013, 04:34:29 pm
I expect the .deb will work for you.  However, it is not the 'proper' final solution.  A step on the way to finding the actual problem.  I was seeing common issues on hybrids and thought it may be isolated to hybrids, your issue shoots that working theory but helps to narrow my search.

Let me know if it solves your issue and that will help me going forward.

Jason
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on February 27, 2013, 08:23:02 pm
Afraid not... .deb applied fine. I rebooted the MD and still no page down.

Tail from DCErouter.log on pressing the skip-next or ch-down buttons:
Code: [Select]
8      02/27/13 21:20:20.495           Received Message from 175 (USB UIRT 0038 / TV Room) to 10 (Media Plug-in / Server Closet), type 1 id 65 Command:Jump Position In Playlist, retry none, parameters: <0x78cfdb70>
08      02/27/13 21:20:20.495             Parameter 5(Value To Assign): +1 <0x78cfdb70>
08      02/27/13 21:20:21.599           Received Message from 175 (USB UIRT 0038 / TV Room) to 10 (Media Plug-in / Server Closet), type 1 id 65 Command:Jump Position In Playlist, retry none, parameters: <0x78cfdb70>
08      02/27/13 21:20:21.599             Parameter 5(Value To Assign): +1 <0x78cfdb70>
08      02/27/13 21:20:24.591           Received Message from 175 (USB UIRT 0038 / TV Room) to 10 (Media Plug-in / Server Closet), type 1 id 65 Command:Jump Position In Playlist, retry none, parameters: <0x78cfdb70>
08      02/27/13 21:20:24.591             Parameter 5(Value To Assign): +1 <0x78cfdb70>
08      02/27/13 21:20:37.181           Received Message from 175 (USB UIRT 0038 / TV Room) to 10 (Media Plug-in / Server Closet), type 1 id 65 Command:Jump Position In Playlist, retry none, parameters: <0x78cfdb70>
08      02/27/13 21:20:37.181             Parameter 5(Value To Assign): +1 <0x78cfdb70>
08      02/27/13 21:20:49.047           Received Message from 175 (USB UIRT 0038 / TV Room) to 10 (Media Plug-in / Server Closet), type 1 id 65 Command:Jump Position In Playlist, retry none, parameters: <0x78cfdb70>
08      02/27/13 21:20:49.047             Parameter 5(Value To Assign): -1 <0x78cfdb70>
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on February 28, 2013, 12:16:51 am
Hrmph.  Okay, that leads me to believe we've got seperate issues.  Lets work yours through again.  I see a command being sent from the UIRT to the Media Plugin. 

The incorrect command is being sent from your UIRT to the Media Plug-in to cause the list to scroll.  When my system scrolls the list it sends a 'Simulate Keypress' command.  Yours is sending the 'Jump Position In Playlist' command,  which is the 'track forward' command that would be sent to a playback device.

Hmm.  After looking at your logs and comparing them to mine, I think that button mapping/screen types are not set correctly in your template.  I've never touched an IR remote template so I'm in new territory there.  The screen type is being set and button presses are being passed to the Media Plug-in.  So, lets look at the template.

J.

Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on February 28, 2013, 11:14:17 am
Jason - looking back at my initial troubleshooting on this, I was pretty sure that if the screentype were set to type 'B' as it was supposed to be, then the correct command should have been fired. It all adds up. To my mind, one of two things is happening-

1. Screentype at the time of pressing the chdown button, is not in fact type 'B'     -- OR
2. The mapping/logic that combines current screentype with remote control command received is failing.

I'm not sure how to test 1... the logs seem to show that screentype is 'B' but I don't know where this goes.

But I'm going to start with the USBUIRT device code, if I can find it. Because the "Set screen type" to 'B' command is sent *to* the USBUIRT device when I open the audio list and then, that (USBUIRT) device is sending the (incorrect) "jump position in playlist" command when I press chdown. so it's a good starting point. But where do I find the code?

I usually grab it from the svn http repository. If anyone can point me in the right dir...
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on February 28, 2013, 02:31:05 pm
Jamo,

The UIRT is working properly passing commands.  And the ScreenType is being sent.

Source code is in the lmce svn, feel free to have a look.  It's not like this just wouldn't work for one person though.  This works for everyone right now, except in certain cases where the ScreenType is not set properly.  I would look at the device template initially, then did you make any alterations to your database?

Definitely the remotemapping is not being set they way it should be.  But I'm in new territory here.

J.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on March 01, 2013, 08:37:29 am
Jason

You say this works for everyone (except me) - can we confirm that? Is scroll down working for you from an IR remote? Anyone else? If so, then it would certainly suggest there's something odd about my particular setup. It doesn't rule out a bug that is only exposed by my setup but the likelihood is more that my setup is the problem. I will certainly have another look at my remote template... perhaps compare it to the MCE remote template to see if there are any glaring differences other than the obvious (IR CODES!).

I agree the UIRT is sending and receiving messages correctly and "sending" the screentype... but is it "setting the screentype". I mean, it says screentype is 'B' but where is that "stored" and when/where is that checked to adjust the commands for the current context. Watch this space.

Thanks again for your help and interest in this. I hope I'm not wasting everyone's time here with a silly mistake on my side but that's why I'm posting detail about structures and things I discover when I can in the hope that those parts of it may be useful to someone chasing down related problems in future.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on March 01, 2013, 11:06:23 am
having a look at the uirt code, there is a method:
Code: [Select]
void USB_UIRT_0038::CMD_Set_Screen_Type(int iValue,string &sCMD_Result,Message *pMessage)
//<-dceag-c687-e->
{
m_cCurrentScreen=(char) iValue;
LoggerWrapper::GetInstance()->Write(LV_STATUS,"USB_UIRT_0038::CMD_Set_Screen_Type Screen type now %c",m_cCurrentScreen);
}
That presumably is called when the device receives the message (from the onscreen orbiter) to set the screen type to 'B'. That message was showing in my DCErouter log as soon as I chose "audio". It looks to me as if the above method should write an entry in the USBUIRT log something like "USB_UIRT_0038::CMD_Set_Screen_Type Screen type now B" or something similar. Will check when I get home. Not sure what the first command- "m_cCurrentScreen=(char) iValue;" is doing except, rather obviousl, setting the variable m_cCurrentScreen to the char cast of the passed in value.... and presumably this is the important part but I can't find any code that "reads" or "uses" this value.... yet.

Edit:
Checked at home and confirmed that when I open the music or video list, the onscreen orbiter sends the message to the UIRT to say "Set screen type" but the UIRT log shows nothing. So either my assumption is wrong above that it should be logging something when this happens or there is a problem somewhere and that command is not received by the UIRT. The UIRT log is recording other things, like the unknown IR codes it receives... just not this.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on March 01, 2013, 02:35:26 pm
More code exploration... in the guts of IRReceiverBase.cpp - I found the method that appears to deal with received codes and even the section that seems to implement the "remote mapping hierarchy"-

Code: [Select]
void IRReceiverBase::ReceivedCode(int PK_Device_Remote,const char *pCode,const char *pRepeat, int iRepeat)
{
if( m_bIgnore )
return;

#ifdef DEBUG
LoggerWrapper::GetInstance()->Write(LV_STATUS,"IRReceiverBase::ReceivedCode device %d code %s repeat %s/%d",
PK_Device_Remote,pCode,pRepeat,iRepeat);
#endif

char cRemoteLayout = m_mapRemoteLayout[PK_Device_Remote];
map<string,MapKeysToMessages *>::iterator it = m_mapKeyMapping.find(StringUtils::ToUpper(pCode));
if( it!=m_mapKeyMapping.end() )
{
MapKeysToMessages *pMapKeysToMessages = it->second;
MapKeysToMessages::iterator itMessage;

itMessage = pMapKeysToMessages->find(make_pair<char,char> (cRemoteLayout,m_cCurrentScreen) );
if( itMessage==pMapKeysToMessages->end() )
itMessage = pMapKeysToMessages->find(make_pair<char,char> (cRemoteLayout,0) );
if( itMessage==pMapKeysToMessages->end() )
itMessage = pMapKeysToMessages->find(make_pair<char,char> (0,m_cCurrentScreen) );
if( itMessage==pMapKeysToMessages->end() )
itMessage = pMapKeysToMessages->find(make_pair<char,char> (0,0) );
.
.
.
.

And I think that what is happening here is that the pMapKeysToMessages structure at this point first line is trying to find a match for this particular command for a specific RemoteLayout, CurrentScreen. Then, if that fails, it tries to find one for a RemoteLayout and any screen. Then, if *that* fails, it tries to find one for any RemoteLayout and a specific screen and if that fails it tries to just find a command match.

Interesting.

The assumption, of course, is that at this point the cRemoteLayout and m_cCurrentScreen variables are appropriately set. Who knows if that is the case or not. Presumably m_CurrentScreen is correctly set as per the CMD_Set_Screen_Type below but... who knows? Esp since that one isn't logged.
The cRemoteLayout var is set in this method but is set to a value in the m_mapRemoteLayout[] structure matched to the primary key of the remote. And I don't know where that structure is populated.

Tshak mentioned earlier that the remotelayout is not used. If that is the case, then this would be an empty structure and presumably cRemoteLayout a null or something that would fail for the first and second itMessage assignments and drop through to the third.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on March 01, 2013, 08:53:56 pm
You say this works for everyone (except me) - can we confirm that? Is scroll down working for you from an IR remote? Anyone else? If so, then it would certainly suggest there's something odd about my particular setup. It doesn't rule out a bug that is only exposed by my setup but the likelihood is more that my setup is the problem. I will certainly have another look at my remote template... perhaps compare it to the MCE remote template to see if there are any glaring differences other than the obvious (IR CODES!).

Yes it is working on all systems.  There is only one known bug where sometimes the SetScreenType command is not sent at all, this is not an issue on your system though.

Thanks again for your help and interest in this. I hope I'm not wasting everyone's time here with a silly mistake on my side but that's why I'm posting detail about structures and things I discover when I can in the hope that those parts of it may be useful to someone chasing down related problems in future.

I want to figure out what the heck is going one here too!   :'(


having a look at the uirt code, there is a method:
..
Edit:
Checked at home and confirmed that when I open the music or video list, the onscreen orbiter sends the message to the UIRT to say "Set screen type" but the UIRT log shows nothing. So either my assumption is wrong above that it should be logging something when this happens or there is a problem somewhere and that command is not received by the UIRT. The UIRT log is recording other things, like the unknown IR codes it receives... just not this.

This all looks good.  The log event may not show depending on log levels, log levels are reduced to avoid filling your HD.  :)

More code exploration... in the guts of IRReceiverBase.cpp - I found the method that appears to deal with received codes and even the section that seems to implement the "remote mapping hierarchy"-
...
And I think that what is happening here is that the pMapKeysToMessages structure at this point first line is trying to find a match for this particular command for a specific RemoteLayout, CurrentScreen. Then, if that fails, it tries to find one for a RemoteLayout and any screen. Then, if *that* fails, it tries to find one for any RemoteLayout and a specific screen and if that fails it tries to just find a command match.

Yep.  Looks good here.

The assumption, of course, is that at this point the cRemoteLayout and m_cCurrentScreen variables are appropriately set. Who knows if that is the case or not. Presumably m_CurrentScreen is correctly set as per the CMD_Set_Screen_Type below but... who knows? Esp since that one isn't logged.
The cRemoteLayout var is set in this method but is set to a value in the m_mapRemoteLayout[] structure matched to the primary key of the remote. And I don't know where that structure is populated.

I am assuming (and fairly safely I believe) that the currentscreen is properly set.  I am wondering about the RemoteLayout for your template.  I am speculating here that perhaps the first is failing and that the second is matching causing the third to not get hit, which would prevent the proper codes from being sent.  This is my current working theory.  :)

Tshak mentioned earlier that the remotelayout is not used. If that is the case, then this would be an empty structure and presumably cRemoteLayout a null or something that would fail for the first and second itMessage assignments and drop through to the third.

I realize that tschak says that the remotelayout is not used (and he usually knows best), but it is being utilized in the function calls and *could* be causing an issue.  The mapping is then checked against the values in the RemoteMapping table which would set the appropriate command for your chup/chdn buttons to Simulate Keypress.  Everything here looks good.  I'm wondering about the RemoteLayout and if that isn't where this is falling apart, even though it is 'not used'.  I'm not at a system I can trace that through on right now though.  Will trace that a bit when I get home.  My mce remote has the remotelayout set to 'W', what is yours set for?

J.
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: jamo on March 01, 2013, 09:22:55 pm
Thanks J, agreed on just about all counts there.

Unfortunately my remote layout is also set to 'W'. In fact, for fear my template was the problem, I compared my template with the MCE Remote template side-by-side and the only difference was that the MCE Remote template had a "controlled by category" set to media director. So I set mine to the same, reboot etc but no change.

Shew....

I'm pretty stymied.

All I can think of is hacking into the USBUIRT code at that section I posted - where it takes the decision about the command and outputting everything that is going on to a custom (or normal) log and then compiling that and running it on my system. Prob is, I haven't the faintest idea how to do that... actually, I do... I think I need to set up a development system or something. Somewhere in the wiki about it. I'll read up. Probably about time I contributed, eh? Necessity is a mother.

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

Guess that's it ^^
Title: Re: Media list (grid) scroll/page down button on IR remote
Post by: phenigma on March 01, 2013, 10:12:46 pm
Thanks J, agreed on just about all counts there.
Unfortunately my remote layout is also set to 'W'. In fact, for fear my template was the problem, I compared my template with the MCE Remote template side-by-side and the only difference was that the MCE Remote template had a "controlled by category" set to media director. So I set mine to the same, reboot etc but no change.

Damn.  I don't suppose you have an MCE remote to test with?   ::)

Shew....
I'm pretty stymied.
All I can think of is hacking into the USBUIRT code at that section I posted - where it takes the decision about the command and outputting everything that is going on to a custom (or normal) log and then compiling that and running it on my system. Prob is, I haven't the faintest idea how to do that... actually, I do... I think I need to set up a development system or something. Somewhere in the wiki about it. I'll read up. Probably about time I contributed, eh? Necessity is a mother.

I am almost 100% that this is a config issue, the code is working, feel free to keep poking around though!  I want to check your database.  sqlCVS update everything.  Then sqlCVS diff the RemoteMapping table (under designer).  Does anything show as NEW or MOD?  Or does it say 'No changes'?

http://wiki.linuxmce.org/index.php/Building_From_Source
Guess that's it ^^

More and less, the 0810 instructions are the most recent but not entirely easy to follow what is going on there and some of it is not proper for 1004.   :P

J.