Solved My keymap for surveillance screenshot did not work
#1
I attempted to make a keymap for a gamepad for Kodi on RetroPie to take a screenshot while viewing a surveillance video stream.  I thought I made the gamepad Start button take a screenshot, but it did not work - no errors, just nothing changed. The Start button still goes to Information (?).

It is:

<keymap>  (I have tried this with and without a " /" after "keymap"; the slash is from a Keymap Editor Add-on)
    <global>
        <gamepad>
            <start>Screenshot</start>
        </gamepad>
    </global>
</keymap>

It is in: ~/.kodi/userdata/profiles/Webcams/keymaps since I have a profile setup for viewing webcam streams
I have tried it there and in the default directory path: ~/.kodi/userdata/keymaps
I have made a folder for screen shots, it is:  ~/RetroPie/Kodi screenshots
I have restarted Kodi and the Raspberry Pi many times since.

What is wrong?

Raspberry Pi 4B
RetroPie 4.7.1
Kodi 18.7
Kodi 18.7 on Raspberry Pi 4B
Reply
#2
Generally it looks ok to me - I can't see any issues with the syntax or anything like that.

First thing to check is in the debug log (wiki) whether the keymap is getting loaded or not. All such file loading is recorded there, so it will show if there is some hidden or less obvious issue with the file.

It may also be something due to retropie, but that's a little beyond our knowledge or support here.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#3
(2021-02-07, 12:25)DarrenHill Wrote: First thing to check is in the debug log (wiki) whether the keymap is getting loaded or not. All such file loading is recorded there, so it will show if there is some hidden or less obvious issue with the file.
If I posted this correctly, here is a log: https://paste.kodi.tv/zuyehixiva.kodi

I have a profile named Webcams.  The profile seems to work normally, but a search for this word, Webcams, I found:

Line 602:
2021-02-07 14:26:42.980 T:2972630112   DEBUG: no profile autoexec.py (/home/pi/.kodi/userdata/profiles/Webcams/autoexec.py) found, skipping

Line 947:
2021-02-07 14:26:59.848 T:2972630112   ERROR: GetDirectory - Error getting /home/pi/.kodi/userdata/profiles/Webcams/playlists/video/SECuRET L163BL.strm
2021-02-07 14:26:59.848 T:2972630112   ERROR: GetDirectory - Error getting special://profile/playlists/video/SECuRET L163BL.strm
Reply
#4
It looks like it's being seen or loaded. See lines 428-439 in the log for where the keymaps are being loaded.

Lines 429-437 are the default built-in system keymaps, line 438 is the keymap from the master profile and line 439 is the keymap from the selected profile (gen.xml is what the keymap editor calls the keymaps it creates).

Line 602 is nothing to worry about. You can use the autoexec.py to run python scripts on log-in, but as you don't have any, the file doesn't exist and so gets skipped. The other two are it trying to play stream (.strm) files that don't exist for whatever reason, but won't relate to this issue.

What screen are you in when you try to activate the button to make the screenshot? Note that whilst global is the default coverage (as its name suggests), there are other specific keymap sections for different screens, and if you're in one of those then the entry for that area might be overriding your entry. Does your screenshot command work if you're just at the top level menu and not doing anything else for example?
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#5
I am in the screen where the video feed is streaming.  No screen shots seem to be taken at any time that I can tell (no visuals or messages); I don't find any picture images in the set-up folder, either.

------------------------------------------------------------
I'm a little more familiar with the "ropes" now.  No real new info. here except where the intended button-push is identified, but here is a debug log where I have debugging enabled (level 2), I start Kodi, go to my video stream (WCPro L163BL Front.strm), press the Start button to take the screenshot, and then exit Kodi

https://paste.kodi.tv/kohetodike.kodi

Lines 1067-1076 is right where I press the Start button to take the screenshot - yes, all seems to be operating (as you've ssid), at least what it knows to do :)
(this is not meant to be shouting, just the specific spot)

In my novice inspection, I question these occurrences:

It's logged:
BUTTON [ 1 ] on "Controller" (consistent with how the gamepad buttons are usually numbered, i.e. 0, 1, 2, 3)
and
FEATURE [ b ] on game.controller.default (consistent with how the print on the controller is and optional button reference labeling, i.e. A, B, X, Y)

It says "ignored" and then "handled", (but this seems to be normal operation), and I would expect these references to be "gamepad"

What does happen is ... it brings up an information screen overlayed on the video, like it originally did.  I then close the video feed and exit Kodi.

Also, I am not able to see the loaded files in the folders (directories) in the file explorer, mc (Midnight Commander) of lines 429-439 - even with "sudo" permission (but the log shows it's using them, anyway).

And further, I thought I would do the screenshot as a long-press until I hit this snag.
Reply
#6
Next step is to try defining the keymap change in a group other than global.

Look at this file - that's the system generic gamepad keymap file. You can see the first set of key definitions is the global ones, but after that you can see all of the other screens where other maps are made. In your case I'd start by trying FullScreenVideo , but if that doesn't work then you might need to do a little more experimenting with the other window tags to see which one may be the applicable one for the window you're in.

It may also be that things are being overridden, either by Retropie or the game controller configuration addon in Kodi. If that's the case then things get more complicated, but have a try with the other windows tags than global above and if that still doesn't work then maybe something else needs to be done.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#7
I finally got it going.  The big problem was that it needed to be with "joystick". (Additionally, for some reason the buttons seems to get twisted/rearranged somewhere along the line - I'm not sure there is any relation while tinkering with keymapping. My controllers are SNES type.)

Going beyond taking a snapshot while streaming the video, I added zooming and panning of snapshots while in the photo viewer.

The basic uses are:

Video
1.) Use the "B" button for the main action while video streaming to take a snapshot
(snapshot folder is defined in System; rights/access/privileges given to the folder make it photos easily accessible through Windows Explorer via SSH terminal)

Photos
2.) Use the right shoulder button for zooming and the buttons (A, B, X, Y) for panning.
The D-pads "buttons" are original and up/down do zoom-in/zoom-out, but they are too touchy; they alse can't be redefined with long-press action.  Press and hold the right shoulder button for increasing zooming levels; very long is a return back to ZoomLevel1.  Then us the right side buttons for panning; they are long-press, so hold them down for the commands (300ms).  The zoom timings take a bit of getting used to, but they are, hopefully, reasonably natural.  It is a bit of a compromise as far as intuitiveness, but it is all that is available, tolerable, and definitely usable.


I don't believe this is anywhere else for a "gamepad" controller use, so here it is to make more functional use: 
gen.xml

<keymap>
  <FullscreenVideo>
    <joystick profile="game.controller.default">
      <a>Screenshot</a>
    </joystick>
  </FullscreenVideo>
  <SlideShow>
    <joystick profile="game.controller.default">
      <a holdtime="300">AnalogMoveYDown</a>
      <y holdtime="300">AnalogMoveYUp</y>
      <b holdtime="300">AnalogMoveXRight</b>
      <x holdtime="300">AnalogMoveXLeft</x>
      <start>Info</start>
      <rightbumper>ZoomNormal</rightbumper>
      <rightbumper holdtime="300">ZoomLevel1</rightbumper>
      <rightbumper holdtime="500">ZoomLevel2</rightbumper>
      <rightbumper holdtime="700">ZoomLevel3</rightbumper>
      <rightbumper holdtime="900">ZoomLevel4</rightbumper>
      <rightbumper holdtime="1000">ZoomLevel5</rightbumper>
      <rightbumper holdtime="1200">ZoomLevel6</rightbumper>
      <rightbumper holdtime="1500">ZoomLevel7</rightbumper>
      <rightbumper holdtime="1800">ZoomLevel8</rightbumper>
      <rightbumper holdtime="2100">ZoomLevel9</rightbumper>
      <rightbumper holdtime="2400">ZoomLevel1</rightbumper>
    </joystick>
  </SlideShow>
</keymap>


Note: my buttons have gotten twiisted up.  On the controller up/down/left/right is as they should be when Y/A/X/B, respectively, are pressed.
Reply
#8
Thread marked solved.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply

Logout Mark Read Team Forum Stats Members Help
My keymap for surveillance screenshot did not work0