Difference between revisions of "Twinhan USB HID Remote"

From MythTV Official Wiki
Jump to: navigation, search
Line 59: Line 59:
 
Here is my lirc.conf:
 
Here is my lirc.conf:
  
<verbatim>
+
<pre>
 
begin remote
 
begin remote
 
   name  TwinHanRemote
 
   name  TwinHanRemote
Line 104: Line 104:
 
       end codes
 
       end codes
 
end remote
 
end remote
</verbatim>
+
</pre>
  
Adding to the above. To get lirc working on ubuntu with this remote.
+
RobM - Adding to the above. To get lirc working on ubuntu with this remote.
  
 
* Put the above remote details into /etc/lirc/lircd.conf
 
* Put the above remote details into /etc/lirc/lircd.conf
 
* Edit /etc/lirc/hardware.conf and make sure these were set:
 
* Edit /etc/lirc/hardware.conf and make sure these were set:
<verbatim>
+
<pre>
 
LOAD_MODULES=true
 
LOAD_MODULES=true
 
DRIVER="dev/input"
 
DRIVER="dev/input"
 
DEVICE="/dev/lirc"
 
DEVICE="/dev/lirc"
</verbatim>
+
</pre>
 
* Ensure you restart lirc via "/etc/init.d/lirc restart"
 
* Ensure you restart lirc via "/etc/init.d/lirc restart"
 
* Create a ~/.mythtv/lircrc file. A starting point is:
 
* Create a ~/.mythtv/lircrc file. A starting point is:
  
<verbatim>
+
<pre>
 
begin
 
begin
 
     prog = mythtv
 
     prog = mythtv
Line 165: Line 165:
 
     config = P
 
     config = P
 
end
 
end
</verbatim>
+
</pre>
  
 
The remove control has 4 buttons in the middle, with left and right being "volume up" and "volume down". I found it better to map these to just left/right keys, it makes navigating the mythtv interface feel more naturual
 
The remove control has 4 buttons in the middle, with left and right being "volume up" and "volume down". I found it better to map these to just left/right keys, it makes navigating the mythtv interface feel more naturual

Revision as of 10:30, 19 February 2007

This is a cheap terrestrial (free to air) DVB card. It is very similar to the Twinhan VisionPlus DVB card.

Australia

This card is sold in Australia and works with the "Free To Air" Digital TV services.

The channel frequencies for all regions in Australia are listed on the Digital Broadcast Australia website.

Sources for the card:

Note on multi-card use

I have experienced serious signal degradation problems when using 3 of these in a single myth box. When attempting use all 3 simultaneously, the signal quality would drop to unacceptable levels. I don't know what this was due to, but I suspect poor internal shielding, as each card was eventually connected to seperate antennas and still produced this behaviour.

Eventually 2 of the cards were replaced by a Compro VideoMate DVB-T200 and LeadTek Winfast DTV1000T and did not produce these problems in identical setup.

- adante.

In addition, I have also occassionally, on rare occassions, experienced problems loading the firmware which caused the card to freeze. It was necessary to 'cold boot' the system in order to get it to work again (ie, a regular reboot did not work). This happened with 2.6.14 firmware (iirc)

Kernel Driver

This card is supported in the stock Linux kernel 2.6.8+ by the bttv driver. the 'dmesg' command shows the following:

 bttv0: Bt878 (rev 17) at 0000:01:04.0, irq: 209, latency: 32, mmio: 0xe6afe000
 bttv0: detected: Twinhan VisionPlus DVB [card=113], PCI subsystem ID is 1822:0001
 bttv0: using: Twinhan DST + clones [card=113,insmod option]
 bttv0: gpio: en=00000000, out=00000000 in=00f762ff [init]
 bttv0: using tuner=4
 bttv0: add subdevice "dvb0"

Twinhan Mini Ter on Ubuntu Breezy and modules required

Remote Control

The bundled remote control has a USB reciever that acts as a HID keyboard device and send keycodes. This has been a problem for some people because there was no easy way to change the keycodes that it sends. Apparently is it possible to use LIRC to intercept the incoming keycodes and handle them as any other lirc device. Here is an extract from the MythTV Users mailing list:

 To get this (or any) USB IR HID device to work with mythtv:
   1) Compiled lirc with devinput as the driver (under Other)
   2) Faffed about trying cat /dev/input/eventX until I found one that was
      the remote (or just "cat /proc/bus/input/devices" to determine it)
   3) Used irremote --device /dev/input/eventX to configure lircd.conf for
      the keypresses on the remote. It's quite (almost) able to figure it out
      itself.
 This also required some hand editing as some of the buttons were
 multiple key presses (eg, Ctrl+Alt+F6 for power) and not all the keys
 were unique in the file. I just dumped some output from irremote to a
 file and picked out unique ones for each key.

Link to the full email: [Re: TwinHan IR remote and receiver problem - SOLVED]

Thought I'd just add a bit here, I wrote that thread about the remote but it's not very helpfull.

The problem with the TwinHan remote is that certain keys on the remote (Power, Volume) send more that one key to the keyboard buffer. This confuses the lirc.conf configurator "irremote".

Example: Power sends Ctrl+Alt+F6.

irremote seems to have a fair chance of mapping ctrl, alt OR F6 to Power in the conf file. Now, if another key on the remote (say, Pause) sends something like Alt+F4 (Pause doesn't send that btw) you run the chance of Power and Pause being mapped to the Alt key. Which means that Power does Power and Pause and vice versa.

The only solution to this that I found was saving the output from irremote to a file after pressing the offending keys. Then, pick a unique keykode from each buttons presses (in our example, F4 and F6) and put those after your entries in lirc.conf.

Here is my lirc.conf:

begin remote
  name  TwinHanRemote
  bits           32
  eps            30
  aeps          100
  one             0     0
  zero            0     0
  gap          115899
  toggle_bit      0
      begin codes
          fullscreen               0x8001002C
          Power                    0x8001001D
          1                        0x80010002
          2                        0x80010003
          3                        0x80010004
          4                        0x80010005
          5                        0x80010006
          6                        0x80010007
          7                        0x80010008
          8                        0x80010009
          9                        0x8001000A
          0                        0x8001000B
          rec                      0x80010066
          favorite                 0x8001002F
          rewind                   0x80010017
          forward                  0x80010031
          ch+                      0x80010068
          ch-                      0x8001006D
          vol-                     0x8001006C
          vol+                     0x80010067
          recall                   0x8001002E
          play                     0x8001001C
          stop                     0x8001006B
          pause                    0x80010014
          mute                     0x80010032
          cancel                   0x80010001
          capture                  0x80010019
          preview                  0x80010025
          epg                      0x80010012
          recordlist               0x80010026
          tab                      0x8001000F
          teletext                 0x8001001E
      end codes
end remote

RobM - Adding to the above. To get lirc working on ubuntu with this remote.

  • Put the above remote details into /etc/lirc/lircd.conf
  • Edit /etc/lirc/hardware.conf and make sure these were set:
LOAD_MODULES=true
DRIVER="dev/input"
DEVICE="/dev/lirc"
  • Ensure you restart lirc via "/etc/init.d/lirc restart"
  • Create a ~/.mythtv/lircrc file. A starting point is:
begin
    prog = mythtv
    button = ch+
    repeat = 3
    config = Up
end

begin
    prog = mythtv
    button = ch-
    repeat = 3
    config = Down
end

begin
    prog = mythtv
    button = vol+
    repeat = 3
    config = Right
end

begin
    prog = mythtv
    button = vol-
    repeat = 3
    config = Left
end

begin
    prog = mythtv
    button = play
    config = Return
end

begin
    prog = mythtv
    button = stop
    config = Esc
end

begin
    prog = mythtv
    button = pause
    repeat = 3
    config = P
end

The remove control has 4 buttons in the middle, with left and right being "volume up" and "volume down". I found it better to map these to just left/right keys, it makes navigating the mythtv interface feel more naturual