Author Topic: [ SOLVED ] DVB-T USB Dongle Infra Red Control  (Read 1498 times)

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
[ SOLVED ] DVB-T USB Dongle Infra Red Control
« on: April 10, 2011, 06:49:12 AM »
I have a DTT USB dongle which apparently has IR control built in, and it came with a small IR controller.

Does anyone know what is required to be installed to enable use of this IR controller?

Thanks for suggestion  ;)
« Last Edit: May 01, 2011, 03:08:52 PM by Just19 »

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: DVB-T USB Dongle Infra Red Control
« Reply #1 on: April 10, 2011, 09:55:26 AM »
You will have to install and configure Lirc,

lirc is in the repos,

cheers,
MBantz

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: DVB-T USB Dongle Infra Red Control
« Reply #2 on: April 10, 2011, 10:54:52 AM »
You will have to install and configure Lirc,

lirc is in the repos,

cheers,
MBantz

I have 'lirc' installed, I just cannot figure out what next  :(

I don't even know what to do with it .... or even what it is .....  not a command, so no help or man page ..   so, please, how is it configured?

thanks  ;)

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: DVB-T USB Dongle Infra Red Control
« Reply #3 on: April 10, 2011, 10:58:39 AM »
Hi Just19,

I have no experience about IR, but think the link is a starting point:

http://www.lirc.org/

AS

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: DVB-T USB Dongle Infra Red Control
« Reply #4 on: April 10, 2011, 12:00:11 PM »
Thanks   as   but I could find nothing of use there ....  or if it is there I could not recognise it  ;D

Searching about the OS, I believe I need to modprobe

rc_lirc

....  well the name implies it might be needed.  :D

In addition, there are keymaps under

/etc/rc_keymaps

So I guess that is where the config takes place.

There is a   af9005   keymap file already there.

My DVB-T device is


Quote
dvb-usb: Afatech AF9015 DVB-T USB2.0 stick successfully deinitialized and disconnected.
usb 1-2.4.1: new high speed USB device using ehci_hcd and address 18
usb 1-2.4.1: New USB device found, idVendor=15a4, idProduct=9016
usb 1-2.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-2.4.1: Product: DVB-T 2
usb 1-2.4.1: Manufacturer: Afatech
usb 1-2.4.1: SerialNumber: 010101010600001
dvb-usb: found a 'Afatech AF9015 DVB-T USB2.0 stick' in cold state, will try to load a firmware
dvb-usb: downloading firmware from file 'dvb-usb-af9015.fw'
dvb-usb: found a 'Afatech AF9015 DVB-T USB2.0 stick' in warm state.
dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
DVB: registering new adapter (Afatech AF9015 DVB-T USB2.0 stick)
af9013: firmware version:4.95.0.0
DVB: registering adapter 0 frontend 0 (Afatech AF9013 DVB-T)...
tda18218: NXP TDA18218HN successfully identified.
Registered IR keymap rc-empty
input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2.4/1-2.4.1/rc/rc3/input16
rc3: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2.4/1-2.4.1/rc/rc3
dvb-usb: schedule remote query interval to 500 msecs.
dvb-usb: Afatech AF9015 DVB-T USB2.0 stick successfully initialized and connected.
Afatech DVB-T 2: Fixing fullspeed to highspeed interval: 10 -> 7
input: Afatech DVB-T 2 as /devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2.4/1-2.4.1/1-2.4.1:1.1/input/input17
generic-usb 0003:15A4:9016.000B: input,hidraw3: USB HID v1.01 Keyboard [Afatech DVB-T 2] on usb-0000:00:1d.7-2.4.1/input1

which would seem to imply I need a  af9015  keymap file.

....  to be continued ...

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: DVB-T USB Dongle Infra Red Control
« Reply #5 on: May 01, 2011, 01:18:33 PM »
I returned to this topic today for a time.

First the good news .....  I found explicit instructions on how to generate a keymap file for the remote controller.

It seemed to work fine. File looked like it might be right.

So, here are the links if anyone wants to have a 'play'  :D

http://www.videoguidelinux.org/en/hardware/62-configurazione-linux-lirc-per-telecomando-dvb-t

With this video
Linux LIRC Configuration for DVB-T Remote Control


My summary is as follows ....

Assuming that the DVB-T device is installed and functioning correctly .... as root do the following ...

Run
cat /proc/bus/input/devices | grep -n10 9016  <--  the device ID from running LSUSB
to find the Handler event number ....  in my case it was event6

Modify the file
/etc/sysconfig/lircd
as follows ....
Top line
DRIVER="devinput"
...
# with devfs enabled
DEVICE=/dev/input/event6      <-- use the event number received above
#DEVICE=/dev/lirc/serial

I guess this one needs editing too .....
# Hardware driver module to load
HWMOD=""
but I have not yet figured that out.


To get the allowed names of Keys on Remote
irrecord --list-namespace


To assign names to the IR and create the file lircd.conf
irrecord -H dev/input -f -d /dev/input/event6 ~/lircd.conf



Copy the new config file to the /etc and/or (?) /etc/lirc/ directory
cp ~/lircd.conf /etc/
cp /etc/lircd.conf /etc/lirc/



LIRC service start
/etc/init.d/lircd restart

*******

So I got to find the info I missed about that HWMOD entry ......  and then find out what is supposed to happen when I press some of those buttons on the R/C  ;D  ;D

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: DVB-T USB Dongle Infra Red Control
« Reply #6 on: May 01, 2011, 03:08:24 PM »
I found that I had either used the incorrect  event#  or it had changed!

I redid what I had done previously, and then set up just one command in KDE - HArdware - Input Devices - Remote Controls  which launched Kaffeine on the last channel used, when I press the Power button of the little remote.

I have yet to add the other keys ....  in fact some seem to be dodgy so will likely not work or not do what they are supposed to do ......  but that matters little at this moment!

I got it to work!   Just too pleased with myself!  ;D  ;D

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: [ SOLVED ] DVB-T USB Dongle Infra Red Control
« Reply #7 on: May 02, 2011, 04:51:57 AM »
Today's report:

I cold booted this am, and attempted to use the IR, but no good.
Tried to use irw to see if the signals were getting in to the PC and nothing showed.

On checking, the event# had changed to event6 again!

This time, instead of changing files, I unplugged the device, and then replugged it.

It then got event3 as yesterday.

Everything worked as set up yesterday.


I have unplugged and replugged a few times since, even using different USB sockets ...  on board and hub ....  and every time it has taken event3

So it seems to me that if this is permanently attached it will use event6 and if plugged in after booting it will take event3.

I am happy enough with plugging it in after booting to enable the IR.

regards.


Code: [Select]
57:I: Bus=0003 Vendor=15a4 Product=9016 Version=0200
58-N: Name="IR-receiver inside an USB DVB receiver"
59-P: Phys=usb-0000:00:1d.7-8/ir0
60-S: Sysfs=/devices/pci0000:00/0000:00:1d.7/usb1/1-8/rc/rc3/input11
61-U: Uniq=
62-H: Handlers=kbd event3
63-B: PROP=0
64-B: EV=100013
65-B: KEY=1000000 0 0 0 0
66-B: MSC=10
« Last Edit: May 02, 2011, 04:56:58 AM by Just19 »

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: [ SOLVED ] DVB-T USB Dongle Infra Red Control
« Reply #8 on: May 02, 2011, 01:08:08 PM »
Well it seems that this event# ID is going to cause all sorts of problems as it is inconsistent .....  it seems to cycle through the event numbers depending on who knows what?


Quote
57:I: Bus=0003 Vendor=15a4 Product=9016 Version=0200
58-N: Name="IR-receiver inside an USB DVB receiver"
59-P: Phys=usb-0000:00:1d.7-2.4.1/ir0
60-S: Sysfs=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2.4/1-2.4.1/rc/rc8/input22
61-U: Uniq=
62-H: Handlers=kbd event5
63-B: PROP=0
64-B: EV=100013
65-B: KEY=1000000 0 0 0 0
66-B: MSC=10

I suppose there may be a means of using a variable in place of the event# within the conf file/s, having caught the correct number on plug in ........  probably not worth the hassle though .......

regards.

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: [ SOLVED ] DVB-T USB Dongle Infra Red Control
« Reply #9 on: May 02, 2011, 02:04:34 PM »
For some kernels I need to create this file:

/etc/udev/rules.d/10-local.rules

containing:

Code: [Select]
KERNEL=="event*", ATTRS{name}=="IR-receiver inside an USB DVB receiver", SYMLINK+="input/dvb-ir"


Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: [ SOLVED ] DVB-T USB Dongle Infra Red Control
« Reply #10 on: May 02, 2011, 03:19:40 PM »
For some kernels I need to create this file:

/etc/udev/rules.d/10-local.rules

containing:

Code: [Select]
KERNEL=="event*", ATTRS{name}=="IR-receiver inside an USB DVB receiver", SYMLINK+="input/dvb-ir"



Having created that rule, what else must be done?  Some change to the conf file so it is used?

I am at sea when it comes to udev rules so have no idea what it actually does  :(

Can you explain a little please?

regards.

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: [ SOLVED ] DVB-T USB Dongle Infra Red Control
« Reply #11 on: May 02, 2011, 04:27:05 PM »
It creates a symlink /dev/input/dvb-ir when the kernel receives an event with the name "IR-receiver...."

This means you don't have to bind to the event, but rather the /dev/input/dvb-ir device - I have:

Code: [Select]
[silke@localhost rules.d]$ ls -la /dev/input/
totalt 0
drwxr-xr-x  4 root root    260 maj  2 18:09 ./
drwxr-xr-x 17 root root   3920 maj  2 18:10 ../
drwxr-xr-x  2 root root    100 maj  2 18:09 by-id/
drwxr-xr-x  2 root root    140 maj  2 18:09 by-path/
lrwxrwxrwx  1 root root      6 maj  2 18:09 dvb-ir -> event4
crw-r-----  1 root root 13, 64 maj  2 18:09 event0
crw-r-----  1 root root 13, 65 maj  2 18:09 event1
crw-r-----  1 root root 13, 66 maj  2 18:09 event2
crw-r-----  1 root root 13, 67 maj  2 18:09 event3
crw-r-----  1 root root 13, 68 maj  2 18:09 event4
crw-r-----  1 root root 13, 69 maj  2 18:09 event5
crw-r-----  1 root root 13, 63 maj  2 18:09 mice
crw-r-----  1 root root 13, 32 maj  2 18:09 mouse0

I then refer to /dev/input/dvb-ir in the /etc/sysconfig/lircd file

After reboot (or perhaps just restart of udev and lirc) I use the irw command to see if it connects alright.

cheers,
MBantz



Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: [ SOLVED ] DVB-T USB Dongle Infra Red Control
« Reply #12 on: May 02, 2011, 04:48:48 PM »
Thank you ......  I thought that might be the case .....  I will make the changes as outlined and all should be well.

Thanks for the tip  ;)

Offline coonhunter

  • Full Member
  • ***
  • Posts: 201
Re: [ SOLVED ] DVB-T USB Dongle Infra Red Control
« Reply #13 on: May 02, 2011, 04:59:00 PM »
Today's report:


I have unplugged and replugged a few times since, even using different USB sockets ...  on board and hub ....  and every time it has taken event3

So it seems to me that if this is permanently attached it will use event6 and if plugged in after booting it will take event3.

I am happy enough with plugging it in after booting to enable the IR.

regards.



You can check out this link and see if its helpful:  http://www.lirc.org/html/devinput.html

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: [ SOLVED ] DVB-T USB Dongle Infra Red Control
« Reply #14 on: May 02, 2011, 05:57:49 PM »
Thanks coonhunter  ;)

My difficulty is that I knew nothing at all about IR controllers or how they are seen by the OS, and so most of what I read went over my head .......  I could not decide what was relevant or not.

The above scheme from MBantz seems to work for me so far.
No reason to believe it won't continue to do so I guess .......  unless hal begins to interfere.

Thanks all for the help getting this working.

regards.