Home of the Squeezebox™ & Transporter® network music players.
Page 4 of 6 FirstFirst ... 23456 LastLast
Results 31 to 40 of 55

Thread: JiveLite

  1. #31
    Senior Member
    Join Date
    Sep 2015
    Posts
    218

    Using ir-keytable

    Hi again,

    Now I have a relatively complete set of IR codes that I can send to ir-keytable. Most of tehse are based on the Logitech HArmony implementation for the squeezebox touch codes, but with some extras.

    I see that there is a ..jivelite/share/jive/jive/irMap_default.lua file that maps IR codes directly, but they don't agree with the codes that the Logitech "touch" (harmony) remote is sending. For example the file lists [0x768910ef] = "play and [0x7689d02f] = "arrow_right", but my remote is sending 0x6e08 and 0x6e0b respectively.

    As I'm using ir-keytable, I doubt whether the IR codes are useful in any case, but I don't see a file that handles the key event to action mappings.

    I have based my ir-keytable mappings file on the LIRC KEY SYMBOL list at https://github.com/ralph-irving/tcz-...r/jivekeys.csv
    but wanted to confirm on my system and have the possibility to tweak one or two keys.

    This is pure jivelite without pcp, so there is no configuration gui.

    I was also wondering if there is any way to make the interface zoom-in on keypress /(ir-keytable) events as the old squeezebox touch used to from IR events. That would make screen much easier to use from a distance.

    It might have been handled somewhere like jivelite/share/jive/jive/ui/IRMenuAccel.lua, but I'm not clever enough to read the code to check.

    EDIT:

    A couple more questions:

    1. It looks like some events are being picked up and handled as expected, while others are not. For example. The code for go_now_playing is set by ir-keytable as KEY_LEFTBRACE and is present in ..jivelite/share/jive/jive/InputToActionMap.lua as ["["] = "go_now_playing", but the action is not performed. The code set by ir-keytable as KEY_N does work as expected.

    Should special characters be specified for Jivelite as KEY_* events, rather than the resultant characters ("[" in the example)?


    2. I haven't worked out how to navigate the onscreen keyboard (search). The "Done" key is highlighted and the highlighting cannot be moved. Arrow keys seem to toggle through all characters in alphanumeric + special order (in the input field), instead of moving the highlighting on the virtual keyboard. Touch input does enter the touched character correctly.
    Is this as intended?
    Is there a configuration option somewhere to configure the behaviour?

    Arrow navigation would make the onscreen keyboard usable with a remote.
    Last edited by Learnincurve; 2020-12-24 at 02:10.

  2. #32
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    2,869
    Quote Originally Posted by Learnincurve View Post
    Thanks Ralphy,

    I have it sorted with the same code hack as before in jive.h

    BR.

    --Marius
    Can you send me your changes? Perhaps we can incorporate them into a less hackish version.
    Ralphy

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

  3. #33
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    2,869
    Quote Originally Posted by Learnincurve View Post
    Hi again,

    Now I have a relatively complete set of IR codes that I can send to ir-keytable. Most of tehse are based on the Logitech HArmony implementation for the squeezebox touch codes, but with some extras.

    I see that there is a ..jivelite/share/jive/jive/irMap_default.lua file that maps IR codes directly, but they don't agree with the codes that the Logitech "touch" (harmony) remote is sending. For example the file lists [0x768910ef] = "play and [0x7689d02f] = "arrow_right", but my remote is sending 0x6e08 and 0x6e0b respectively.

    As I'm using ir-keytable, I doubt whether the IR codes are useful in any case, but I don't see a file that handles the key event to action mappings.

    I have based my ir-keytable mappings file on the LIRC KEY SYMBOL list at https://github.com/ralph-irving/tcz-...r/jivekeys.csv
    but wanted to confirm on my system and have the possibility to tweak one or two keys.

    This is pure jivelite without pcp, so there is no configuration gui.

    I was also wondering if there is any way to make the interface zoom-in on keypress /(ir-keytable) events as the old squeezebox touch used to from IR events. That would make screen much easier to use from a distance.

    It might have been handled somewhere like jivelite/share/jive/jive/ui/IRMenuAccel.lua, but I'm not clever enough to read the code to check.

    EDIT:

    A couple more questions:

    1. It looks like some events are being picked up and handled as expected, while others are not. For example. The code for go_now_playing is set by ir-keytable as KEY_LEFTBRACE and is present in ..jivelite/share/jive/jive/InputToActionMap.lua as ["["] = "go_now_playing", but the action is not performed. The code set by ir-keytable as KEY_N does work as expected.

    Should special characters be specified for Jivelite as KEY_* events, rather than the resultant characters ("[" in the example)?


    2. I haven't worked out how to navigate the onscreen keyboard (search). The "Done" key is highlighted and the highlighting cannot be moved. Arrow keys seem to toggle through all characters in alphanumeric + special order (in the input field), instead of moving the highlighting on the virtual keyboard. Touch input does enter the touched character correctly.
    Is this as intended?
    Is there a configuration option somewhere to configure the behaviour?

    Arrow navigation would make the onscreen keyboard usable with a remote.
    The onscreen keyboard only supports the up/down scroll for each character and right arrow to move to the next character. To execute a "done" you need to have the KEY_L (go) key defined.

    There are several patches to the standard SDL-1.2.15 library to handle special keys for some remotes, but that shouldn't affect the KEY_LEFTBRACE as it is in the original codebase. KEY_N was added to jivelite and is actually mapped to a different action go_home_or_now_playing, so it's more likely the "action" is not mapped in the context you're trying to use it.

    You should be able to add your two keycodes to jive_framework.c and InputToActionMap.lua. The IR handling in jivelite was/is a bit of a hack in that some the key mappings use the EMULATE_IR compile time define to work.
    I've been working on an lirc_client jive module that uses lircd to read the IR keys instead of the current emulation. I have 2 remotes, that I really like, that ir_keytables doesn't return any scancodes for.

    The larger skin when using the remote on the touch is handled by the AutoSkin applet. It's hardcoded to use the WQVGAsmall and WQVGAlarge Skins, so it's not included in jivelite.
    Ralphy

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

  4. #34
    Senior Member
    Join Date
    Sep 2015
    Posts
    218
    Quote Originally Posted by ralphy View Post
    Can you send me your changes? Perhaps we can incorporate them into a less hackish version.
    My bad regarding the description of my changes. Here's what I did for the smoothest text scrolling at my screen's fixed refresh rate (56.2 Hz):

    After setting the JIVE_FRAMERATE=56 as an environment variable before launching Jivelite,

    the hacked change is in jive_label.c

    At framerate = 56 I found these settings gave smooth scrolling at good read-speed:

    #include "common.h"
    #include "jive.h"


    /* actual FPS will only run at half of the JIVE_FRAME_RATE */
    #define SCROLL_FPS (JIVE_FRAME_RATE / 2)
    <#define SCROLL_OFFSET_STEP_MINIMUM 5
    >#define SCROLL_OFFSET_STEP_MINIMUM 2
    <#define FONT_SCROLL_FACTOR 5
    >#define FONT_SCROLL_FACTOR 12

    No idea what else I may be breaking with these settings

  5. #35
    Senior Member
    Join Date
    Sep 2015
    Posts
    218
    Quote Originally Posted by ralphy View Post
    The onscreen keyboard only supports the up/down scroll for each character and right arrow to move to the next character. To execute a "done" you need to have the KEY_L (go) key defined.
    So the onscreen keyboard is for touch input only and up/down scrolls through characters alphanumerically. That's fine, just not what I was expecting.

    KEY_L gives "l" rather than go, so looks like I need to change the mappings for character_key actions.


    Thanks for the tips regarding the patches to the
    SDL library, as well as the files to modify for mappings. I'll take a look at all of those.

    BR.

  6. #36
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    2,869
    Quote Originally Posted by Learnincurve View Post
    So the onscreen keyboard is for touch input only and up/down scrolls through characters alphanumerically. That's fine, just not what I was expecting.

    KEY_L gives "l" rather than go, so looks like I need to change the mappings for character_key actions.


    Thanks for the tips regarding the patches to the
    SDL library, as well as the files to modify for mappings. I'll take a look at all of those.

    BR.
    Sorry that was wrong, the onscreen keyboard is different.

    KEY_RIGHT executes the search, but you must have at least one character in the search field first.

    KEY_LEFT or KEY_ESC moves back one level from the onscreen keyboard.
    Ralphy

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

  7. #37
    Senior Member
    Join Date
    Sep 2015
    Posts
    218
    Quote Originally Posted by Learnincurve View Post
    So the onscreen keyboard is for touch input only and up/down scrolls through characters alphanumerically. That's fine, just not what I was expecting.

    KEY_L gives "l" rather than go, so looks like I need to change the mappings for character_key actions.


    Thanks for the tips regarding the patches to the
    SDL library, as well as the files to modify for mappings. I'll take a look at all of those.

    BR.
    QUOTE=Learnincurve;1001279]So the onscreen keyboard is for touch input only and up/down scrolls through characters alphanumerically. That's fine, just not what I was expecting.

    KEY_L gives "l" rather than go, so looks like I need to change the mappings for character_key actions.


    Thanks for the tips regarding the patches to the
    SDL library, as well as the files to modify for mappings. I'll take a look at all of those.

    BR.[/QUOTE]

    It looks like jive_framework.c contains "irmap", which is a table to convert SDLK events to fake ir codes:
    Code:
    #ifdef EMULATE_IR
    static struct jive_keyir irmap[] = {
            { SDLK_UP,       0x7689e01f }, /* arrow_up */
            { SDLK_DOWN,     0x7689b04f }, /* arrow_down */
            { SDLK_LEFT,     0x7689906f }, /* arrow_left */
            { SDLK_RIGHT,    0x7689d02f }, /* arrow_right */
            { SDLK_0,        0x76899867 },
            { SDLK_1,        0x7689f00f },
            { SDLK_2,        0x768908f7 },
            { SDLK_3,        0x76898877 },
            { SDLK_4,        0x768948b7 },
            { SDLK_5,        0x7689c837 },
            { SDLK_6,        0x768928d7 },
            { SDLK_7,        0x7689a857 },
            { SDLK_8,        0x76896897 },
            { SDLK_9,        0x7689e817 },
            { SDLK_x,        0x768910ef }, /* play */
            { SDLK_a,        0x7689609f }, /* add */
            { SDLK_UNKNOWN,  0x0        },
    };
    #endif
    and those are picked up in irMap_default to define the jivelite actions:
    Code:
    irMap = {}
    irMap["name"] = "Squeeze IR Remotes"
    irMap["map"] = {
            [0x7689e01f] = "arrow_up",
            [0x7689b04f] = "arrow_down",
            [0x7689906f] = "arrow_left",
            [0x7689d02f] = "arrow_right",
    ...
    ...
    [0x76899867] = "0",
            [0x7689F00F] = "1",
            [0x768908F7] = "2",
            [0x76898877] = "3",
            [0x768948B7] = "4",
            [0x7689C837] = "5",
            [0x768928D7] = "6",
            [0x7689A857] = "7",
            [0x76896897] = "8",
            [0x7689E817] = "9"
    etc
    So if I'm using ir-keytable, then the system is receiving those as events as defined in my rc_keymaps mapping file. Eg:
    0x6e07 KEY_UP
    0x6e0d KEY_DOWN
    0x6e09 KEY_LEFT
    0x6e0b KEY_RIGHT

    0x6e0f KEY_1
    0x6e10 KEY_2
    0x6e11 KEY_3
    0x6e12 KEY_4
    0x6e13 KEY_5
    0x6e14 KEY_6
    0x6e15 KEY_7
    0x6e16 KEY_8
    0x6e17 KEY_9
    0x6e19 KEY_0


    and

    0x1240 KEY_A > action: "+" from now playing
    0x1241 KEY_B > action: next track =(jump fwd?)
    0x125d KEY_C > action: pause from now playing

    all of which seem to work,

    Judging by the actions, it looks like these are being picked up as lower case.



    but named key events like

    KEY_LEFTBRACE
    KEY_SLASH
    KEY_RIGHTBRACE
    etc

    are not working

    So where is the place to add inputs like KEY_LEFTBRACE, KEY_SLASH etc? If I modify InputToActionMap.lua at:

    Code:
    keyActionMappings = {}
    keyActionMappings.press = {
            [KEY_HOME] = "go_home_or_now_playing",
            [KEY_PLAY] = "play",
    ...
    ...
            [KEY_ALARM] = "go_alarms",
    -- Added by Marius for ir-keytable compatibility
            [KEY_SEMICOLON] = "go_music_library",
    }
    jivelite fails to load.

    If I also add
    Code:
    ...
    ...
            _set_const(L, -1, "KEY_ADD",JIVE_KEY_ADD);
            _set_const(L, -1, "KEY_PAUSE",JIVE_KEY_PAUSE);
    ...
    ...
            _set_const(L, -1, "KEY_PRINT",JIVE_KEY_PRINT);
    //Added By Marius for ir-keytable compatibility
            _set_const(L, -1, "KEY_SEMICOLON",JIVE_KEY_SEMICOLON);
            lua_pop(L, 2);
    
            return 0;
    }
    at the end of
    jive_framework.c

    I get an undeclared function error.

    I'm a lua and SDLK noob, so sorry if this should be obvious.

    BR.

  8. #38
    Senior Member
    Join Date
    Sep 2015
    Posts
    218
    Quote Originally Posted by ralphy View Post
    Sorry that was wrong, the onscreen keyboard is different.

    KEY_RIGHT executes the search, but you must have at least one character in the search field first.

    KEY_LEFT or KEY_ESC moves back one level from the onscreen keyboard.
    Thanks again! Confirmed.
    Last edited by Learnincurve; 2020-12-29 at 02:11.

  9. #39
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    2,869
    Quote Originally Posted by Learnincurve View Post
    I'm a lua and SDLK noob, so sorry if this should be obvious.

    BR.
    No the whole SDL keyboard handling is convoluted.

    JIVE_KEY* constants need to be added to the JiveKey enumeration in jive.h for the symbols to be recognized. Note that these are NOT the linux kernel keysymbol names which is why they are prefixed with JIVE_

    Take a look at how I added presets 7-10 to jivelite.
    There are way too many changes required to explain here. I missed one change that I had to fix in another commit.

    It's not a perfect example as I also had to remove the hex constants in the JiveKey enumeration because I had run out of space to add more keys.
    Ralphy

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

  10. #40
    Senior Member
    Join Date
    Sep 2015
    Posts
    218
    Quote Originally Posted by ralphy View Post
    The larger skin when using the remote on the touch is handled by the AutoSkin applet. It's hardcoded to use the WQVGAsmall and WQVGAlarge Skins, so it's not included in jivelite.
    Hi again,
    I found that the skins are selected in SelectSkinApplet.lua

    and the skins that would work for me are
    touch - Grid Skin (1024x600)
    remote - HD Skin (640x480)

    So assuming I found the correct alias's, I edited SelectSkinApplet.lua:
    local _defaultSkinNameForType = {
    -- ["touch"] = "WQVGAsmallSkin",
    ["touch"] = "PiGridSkin_1024x600",
    -- ["remote"] = "WQVGAlargeSkin",
    ["remote"] = "HDSkin-VGA",
    }

    which appears to load the correct "touch" skin at launch


    I'm still missing the piece to take my event inputs from SDLK instead of directly, to make sure that the KEY_LEFT, KEY_RIGHT, KEY_UP, KEY_DOWN arrow events are being read as virtual IR codes as set in jive_framework.c


    static struct jive_keyir irmap[] = {
    { SDLK_UP, 0x7689e01f }, /* arrow_up */
    { SDLK_DOWN, 0x7689b04f }, /* arrow_down */
    { SDLK_LEFT, 0x7689906f }, /* arrow_left */
    { SDLK_RIGHT, 0x7689d02f }, /* arrow_right */


    Really sorry to keep spamming the list with what may be trivial questions with obvious answers!

    BR.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •