Announcement

Collapse
No announcement yet.

Howto create a linux kernel IR remote keytable for Jivelite on piCorePlayer 5

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    I've just finished setting this up and it's working great with a generic 17 key remote.

    I did initially try with another remote with more buttons but it just did not work, it appeared as 'necx' protocol, whatever that is!

    So for anyone else trying to get this working, try a different remote if it doesn't work at first.

    Also, is it possible to have a remote button that cycles thru the different display modes in the 'now playing' screen, so it goes to VU meter, then album cover, etc.? I did look thru jivekeys.csv but couldn't see a key that would do this.
    Last edited by TheHypnoToad; 2019-08-09, 17:31.

    Comment


      #32
      Originally posted by TheHypnoToad View Post
      is it possible to have a remote button that cycles thru the different display modes in the 'now playing' screen, so it goes to VU meter, then album cover, etc.? I did look thru jivekeys.csv but couldn't see a key that would do this.
      KEY_LEFTBRACE (go_now_playing)
      Ralphy

      1-Touch, 5-Classics, 3-Booms, 2-UE Radio
      Squeezebox client builds donations always appreciated.

      Comment


        #33
        Originally posted by ralphy View Post
        KEY_LEFTBRACE (go_now_playing)
        Thanks, that worked perfectly.

        Comment


          #34
          My setup is working fine with jivelite and ir-keytables. Except for one thing. How do I shutdown the raspberry pi? Can I? tried mapping KEY_POWER (also tried KEY_I) to the appropriate key code in /usr/local/etc/keytables/jivelite, but it doesnt seem to do anything.

          Comment


            #35
            Originally posted by surfatwork View Post
            My setup is working fine with jivelite and ir-keytables. Except for one thing. How do I shutdown the raspberry pi? Can I? tried mapping KEY_POWER (also tried KEY_I) to the appropriate key code in /usr/local/etc/keytables/jivelite, but it doesnt seem to do anything.
            The power key mappings in jivelite are for LMS and the player only.

            To shutdown the rpi, in Jivelite go to Settings->piCorePlayer->Shutdown piCorePlayer
            Ralphy

            1-Touch, 5-Classics, 3-Booms, 2-UE Radio
            Squeezebox client builds donations always appreciated.

            Comment


              #36
              Originally posted by ralphy View Post
              The power key mappings in jivelite are for LMS and the player only.

              To shutdown the rpi, in Jivelite go to Settings->piCorePlayer->Shutdown piCorePlayer
              OK. Any way I can map that to a remote button?
              Can I run both lircd and ir-keytables simultaneously?

              Comment


                #37
                Originally posted by surfatwork View Post
                OK. Any way I can map that to a remote button?
                If you mean a button on the IR remote, no not with jivelite.

                Originally posted by surfatwork View Post
                Can I run both lircd and ir-keytables simultaneously?
                Yes. I've tested this controlling squeezelite via lircd using remote 1 and ir-keytables to control jivelite using remote 2.
                Ralphy

                1-Touch, 5-Classics, 3-Booms, 2-UE Radio
                Squeezebox client builds donations always appreciated.

                Comment


                  #38
                  Originally posted by ralphy View Post
                  If you mean a button on the IR remote, no not with jivelite.


                  Yes. I've tested this controlling squeezelite via lircd using remote 1 and ir-keytables to control jivelite using remote 2.
                  Ah, with 2 remotes!! I tried it with one and ir-keytables didnt work when lircd was running. Will try this way. Thanks :-)

                  Comment


                    #39
                    By the way, it might be good to add a line to the first post (instructions) that lircd is NOT "required" at all, if one is running jivelite. Sorry if it obvious to others, but that was a bit of a aha moment for me. Once I realized that, the rest was straight forward.
                    Mainly because there are loads of how-tos on the net about setting up lircd, irrecord, irw and the rest.

                    Comment


                      #40
                      Originally posted by surfatwork View Post
                      By the way, it might be good to add a line to the first post (instructions) that lircd is NOT "required" at all, if one is running jivelite. Sorry if it obvious to others, but that was a bit of a aha moment for me. Once I realized that, the rest was straight forward.
                      Mainly because there are loads of how-tos on the net about setting up lircd, irrecord, irw and the rest.
                      Thanks for the suggestion. Added.
                      Ralphy

                      1-Touch, 5-Classics, 3-Booms, 2-UE Radio
                      Squeezebox client builds donations always appreciated.

                      Comment


                        #41
                        Originally posted by ralphy View Post
                        If you are using the FLIRC usb dongle, it works the same as in previous piCorePlayer releases..
                        Hi Ralphy,
                        I just got my FLIRC usb dongle (v2) but cannot get it to work on pCP 6.1.0. Can you pls let me know where I can find these instructions (been surfing forums for hours so far...).
                        Many thanks in advance.
                        Last edited by Supertramp; 2020-07-29, 15:38.

                        Comment


                          #42
                          Originally posted by Supertramp View Post
                          Hi Ralphy,
                          I just got my FLIRC usb dongle (v2) but cannot get it to work on pCP 6.1.0. Can you pls let me know where I can find these instructions (been surfing forums for hours so far...).
                          Many thanks in advance.
                          Picoreplayer only supports the flirc usb dongle with jivelite by default.

                          However, it is possible to control squeezelite with a usb device that mimics a keyboard, like the flirc dongle using inputlircd if you manually install the pcp-lirc extension. That being said, it's not an simple setup.

                          If you enabled lirc through tweaks, pcp will launch lircd at startup which conflicts with inputlircd. So you must disable IR remote control in the web tweaks tab and reboot before proceeding.

                          Next, install pcp-lircd from the extensions webgui and put /usr/local/sbin/inputlircd in one of the user commands. Next add -i to squeezelite various options field on the squeezelite tab.

                          You will likely need to create a mapping file (-t) and you might need to add -m 0 and -r 300 in addition to the input device your usb device is sending key events on.

                          See the inputlircd manpage for option details.
                          Ralphy

                          1-Touch, 5-Classics, 3-Booms, 2-UE Radio
                          Squeezebox client builds donations always appreciated.

                          Comment


                            #43
                            Originally posted by ralphy View Post
                            Picoreplayer only supports the flirc usb dongle with jivelite by default.

                            However, ...
                            Many thanks for your reply.

                            “You will likely need to create a mapping file (-t) and you might need to add -m 0 and -r 300 in addition to the input device your usb device is sending key events on.”

                            Being a Linux dummy, what does such a file look like and where would I need to store it?

                            Alternatively, would the default way (jivelite) on a headless player be a possible, simpler and better solution? I have been experimenting with the related tweaks before, but no success.

                            Hope you can help me further...
                            Last edited by Supertramp; 2020-07-30, 19:52.

                            Comment


                              #44
                              Using inputlircd and a flirc to control squeezelite

                              First you must disable IR remote control in the web tweaks tab and reboot before proceeding.

                              Next, install pcp-lirc.tcz from the command line.
                              Code:
                              $ tce-load -wi pcp-lirc.tcz
                              Next, ensure squeezelite is stopped.

                              Code:
                              $ sudo /usr/local/etc/init.d/squeezelite stop
                              Plug in your FLIRC and find the name.

                              Code:
                              $ cat /proc/bus/input/devices
                              
                              I: Bus=0003 Vendor=20a0 Product=0001 Version=0101
                              N: Name="[B]flirc.tv flirc[/B]"
                              P: Phys=usb-20980000.usb-1.3/input0
                              S: Sysfs=/devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:20A0:0001.0001/input/input0
                              U: Uniq=
                              H: Handlers=sysrq kbd event0 
                              B: PROP=0
                              B: EV=10001f
                              B: KEY=3007f 0 0 0 0 483ffff 17aff32d bf544446 0 0 1 130c13 b17c000 267bfa d941dfed e09effdf 1cfffff ffffffff fffffffe
                              B: REL=40
                              B: ABS=1 0
                              B: MSC=10
                              Start inputlircd from the command line while testing. I've found the following options work best.

                              Code:
                              $ sudo /usr/local/sbin/inputlircd -n "flirc.tv flirc" -m 0 -g -r 500
                              Run irw and press each key. Note what keycode is generated for each key.

                              Code:
                              $ irw
                              29 0 KEY_C /dev/input/event0
                              19 0 KEY_P /dev/input/event0
                              For example my slimdevices remote PAUSE key sends KEY_C and PLAY sends KEY_P. The codes from your flirc will likely be different as I'm using an old flirc config which I created for use with jivelite on my wandboard, and don't want to reprogram my flirc.

                              Stop irw by pressing control-C

                              Create a file mapping of the keycode from your remote to a corresponding keycode squeezelite operation.

                              For example:

                              Code:
                              $ cat /home/tc/inputlircd.keymap
                              KEY_C = KEY_PAUSE
                              KEY_P = KEY_PLAY
                              The list of squeezelite IR keycodes can be found here

                              Kill and restart inputlircd from the command line adding the mapping file to test.

                              Code:
                              $ sudo pkill inputlircd
                              $ sudo /usr/local/sbin/inputlircd -n "flirc.tv flirc" -m 0 -g -r 500 -t /home/tc/inputlircd.keymap
                              Start squeeelite with the -i option and -d ir=debug to test if the keys work. You can ignore the error reading the ir config. It's not needed for inputlircd
                              Note that you need at least squeezelite version 1.9.7-1237 for this to work.

                              Code:
                              $ squeezelite -d ir=debug -i
                              [11:28:55.788622] load_lirc:242 loaded liblirc_client.so.0
                              [11:28:55.791797] ir_init:261 error reading config: ~/.lircrc
                              [11:28:57.951369] ir_thread:199 ir lirc: KEY_PLAY [0] -> 768910ef
                              [11:29:05.246239] ir_thread:199 ir lirc: KEY_PAUSE [0] -> 768920df

                              Once you're happy with the key map file, backup your pcp config and confirm the mapping file is in the backup.

                              Code:
                              $ tar -tvf /mnt/mmcblk0p2/tce/mydata.tgz | grep input
                              -rw-r--r-- ralphy/users        35 2020-08-01 11:20:21 home/tc/inputlircd.keymap
                              Add inputlircd to /opt/bootlocal.sh so it is started before squeezelite. See this post.

                              Add -i to squeezelite various options field on the squeezelite tab in the web interface.

                              Backup your config once more and reboot.
                              Last edited by ralphy; 2020-08-25, 13:49. Reason: Use bootlocal.sh to start inputlircd before squeezelite.
                              Ralphy

                              1-Touch, 5-Classics, 3-Booms, 2-UE Radio
                              Squeezebox client builds donations always appreciated.

                              Comment


                                #45
                                Many thanks for these great detailed instructions, Ralphy.

                                I have no physical access to my pCP in the next couple of weeks. I will try this once I am back home and report back.

                                Many thanks again!!

                                Comment

                                Working...
                                X