Tuesday 2 September 2014

More remote control decoding

Astro have now retired their old decoders, which I spent some time a few years ago trying to control from my PC. It seems at least someone has found a use for that info, but from reading the thread, what they actually wanted was the remote codes for the latest generation Samsung decoders that Astro replaced all the old decoders with.
In the public interest then, here is an updated LIRC config, and additionally a kernel rc configuration file for the Samsung Astro Byond decoders. Be warned: the kernel rc configuration is using standard key codes, including KEY_POWER, which may cause your PC to shutdown in many default configurations of GNU/Linux desktops - where all available input devices are grabbed by X. Changing to KEY_POWER2 might help with that particular problem - but unless you configure X to ignore the remote control, you'll still see side effects from other keys.

1. The kernel configuration file (/etc/rc_keymaps/AstroByond).
#table AstroByond, type: RC6
0x80562700 KEY_0
0x80562701 KEY_1
0x80562702 KEY_2
0x80562703 KEY_3
0x80562704 KEY_4
0x80562705 KEY_5
0x80562706 KEY_6
0x80562707 KEY_7
0x80562708 KEY_8
0x80562709 KEY_9
0x8056270C KEY_POWER
0x8056270F KEY_INFO
0x80562720 KEY_CHANNELUP
0x80562754 KEY_HOME
0x80562758 KEY_UP
0x80562759 KEY_DOWN
0x8056275A KEY_LEFT
0x8056275B KEY_RIGHT
0x8056275C KEY_OK
0x8056276D KEY_RED
0x8056276E KEY_GREEN
0x8056276F KEY_YELLOW
0x80562770 KEY_BLUE
0x80562783 KEY_SHOP
0x80562784 KEY_FAVORITES
0x805627A9 KEY_BACK
0x805627CC KEY_TV
0x805627D8 KEY_SCREEN
0x805627F2 KEY_RADIO
0x805627FB KEY_DOT

2. A traditional lirc configuration file (/usr/local/share/lirc/remotes/AstroByond.conf). Note that the codes seem to be 2s complements of the values above, with an additional prefix. I'm not sure whether this is due to a difference in the way LIRC interprets codes compared with the kernel drivers, or if it is a result of misdetection of other parameters. LIRC's auto-detection is a bit off anyway, as it failed to detect the toggle_bit_mask, and I had to first detect as raw codes, then analyze the resulting file. I think spotted a pattern of alternation between 85xx and 8Dxx for the lower 16 bits, so figured that the toggle_bit_mask was 0x8000. After setting that manually, the remote became very responsive in irw. I did similar manual patching of bit 15 in the ir-keytable results above, but it doesn't seem to make a difference there, just looks cleaner if the keys all have the same prefix.
# this config file was automatically generated
# using lirc-0.9.0(emulation) on Mon Sep  1 22:10:16 2014
# contributed by Jason Rumney
# brand:                       Astro Byond
# model no. of remote control: URC931000-01R00
# devices being controlled by this remote: Samsung Astro Byond Decoder

begin remote

  bits           37
  eps            30
  aeps          100

  header       2709   757
  one           476   394
  zero          476   394
  gap          105172
  toggle_bit_mask 0x0000008000
  rc6_mask    0x100000000

      begin codes
          KEY_POWER                0x037FA958F3
          KEY_CHANNELUP            0x037FA958DF
          KEY_CHANNELDOWN          0x037FA958DE
          KEY_0                    0x037FA958FF
          KEY_1                    0x037FA958FE
          KEY_2                    0x037FA958FD
          KEY_3                    0x037FA958FC
          KEY_4                    0x037FA958FB
          KEY_5                    0x037FA958FA
          KEY_6                    0x037FA958F9
          KEY_7                    0x037FA958F8
          KEY_8                    0x037FA958F7
          KEY_9                    0x037FA958F6
          KEY_DOT                  0x037FA95804
          KEY_OK                   0x037FA958A3
          KEY_UP                   0x037FA958A7
          KEY_DOWN                 0x037FA958A6
          KEY_LEFT                 0x037FA958A5
          KEY_RIGHT                0x037FA958A4
          KEY_TV                   0x037FA95833
          KEY_RADIO                0x037FA9580D
          KEY_HOME                 0x037FA958AB
          KEY_BACK                 0x037FA95856
          KEY_RED                  0x037FA95892
          KEY_GREEN                0x037FA95891
          KEY_YELLOW               0x037FA95890
          KEY_BLUE                 0x037FA9588F
          KEY_INFO                 0x037FA958F0
          KEY_FAVORITES            0x037FA9587B
          KEY_SUBTITLE             0x037FA958B4
          KEY_SHOP                 0x037FA9587C
          KEY_SCREEN               0x037FA95827
          KEY_BUTTONCONFIG         0x037FA9580A
    end codes

end remote

No comments: