Template:Making-it-work:dvb-usb-dib0700: Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
(→‎Remote control: udev rule alternative)
(→‎Keys repeated twice: Added note stating that changing toggle bit mask prevents key repeats on remote)
 
(35 intermediate revisions by 13 users not shown)
Line 1: Line 1:
== Making it work ==
== Making it Work (generic for all dib0700) ==
<noinclude><div style="background:#FF1F1F">
This page is a Template that is included by a couple of dib0700 based devices.


On the left in the toolbox there is a link called '''What links here'''. Use it to find the product
pages that include this template.

If you have product specific information, please include it on the product page.

See [[TerraTec Cinergy T USB XXS]] for an example of how to do this.
</div></noinclude>


{{Firmware:dvb-usb-dib0700}}
{{Firmware:dvb-usb-dib0700}}


=== Drivers ===
=== Drivers ===
It requires the dib0700 driver. Just use Mercurial by following the [[How to install DVB device drivers]] instructions.
It requires the dib0700 driver. Just use Mercurial by following the [[How to Obtain, Build and Install V4L-DVB Device Drivers]] instructions.


==== Forcing the activation of LNAs (Low Noise Amplifier) ====
{{Note|1=These patches still haven't made it into the tree, and have not received a lot of feedback after the latest official merges. Use at your own risk if you feel that you need them.
<div {{PreStyle}}>
; [http://www.linuxtv.org/pipermail/linux-dvb/2007-August/019493.html Silence unknown keycodes]
: When an unknown key code is received (from another remote, like the receiver's or the TV's), it is not eaten and the module keeps yelling about it. This patch stops the yelling.
: ''Jonas Anden, Thu Aug 2 00:28:17 CEST 2007''
: This patch is not cleanly applicable, but it is an easy one-liner to do by hand.
: This patch is regarded as not really being the proper fix; it just limits the effect of bad behaviour.
: This patch is not to be used with the following patch.
: This patch should be deprecated once the following patch has seen more testing.


You may have to force LNA to get this card working:
; [http://www.linuxtv.org/pipermail/linux-dvb/2008-February/023844.html Key repeat for dib0700 IR receiver]
: Solves remote toggle bit stuff and implements repeated key feature (with repeat delay to avoid unwanted double hits) for rc-5 and nec protocols. It also contains some keymap for the remotes used for testing (a philipps compatible rc5 remote and a teac nec remote). They are far from being complete since I've used them just for testing.
: ''Filippo Argiolas, Tue Feb 19 16:17:55 CET 2008''
: This patch is not to be used with the previous patch.
: '''This patch is preferred over the previous patch.'''
</div>
Please report [http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb on the list].}}


In <tt>/etc/modprobe.d/options</tt> add:
=== Disabling the remote control sensor ===
options dvb_usb_dib0700 force_lna_activation=1


==== Disabling the remote control sensor ====


You may want to disable the remote control sensor if you are using another one and want to avoid error messages in the logs:
You may want to disable the remote control sensor if you are using another one and want to avoid error messages in the logs:
Line 33: Line 30:
options dvb_usb disable_rc_polling=1
options dvb_usb disable_rc_polling=1


=== All relevant kernel modules options ===
==== All relevant kernel modules options ====


In <tt>/etc/modprobe.d/options</tt> add:
In <tt>/etc/modprobe.d/options</tt> add:
options [module name] [option name]=[setting]
options [module name] [option name]=[setting]
Line 44: Line 39:
The debug values are bit fields, with each bit representing a different category. Add values to turn on multiple debugging categories.
The debug values are bit fields, with each bit representing a different category. Add values to turn on multiple debugging categories.


==== dib3000mc ====
===== dib3000mc =====
{{Modparm|debug|Turn on debugging||0 (off)|integer}}
{{Modparm|debug|Turn on debugging||0 (off)|integer}}
{{Modparm|buggy_sfn_workaround|Enable work-around for buggy SFNs||0 (disabled)|integer}}
{{Modparm|buggy_sfn_workaround|Enable work-around for buggy SFNs||0 (disabled)|integer}}


==== mt2060 ====
===== mt2060 =====
{{Modparm|debug|Turn on debugging||0 (off)|integer}}
{{Modparm|debug|Turn on debugging||0 (off)|integer}}


==== dvb_usb_dib0700 ====
===== dvb_usb_dib0700 =====
{{Modparm|force_lna_activation|Force the activation of LNAs (Low Noise Amplifier), if applicable for the device||0 (automatic/off)|integer}}
{{Modparm|force_lna_activation|Force the activation of LNAs (Low Noise Amplifier), if applicable for the device||0 (automatic/off)|integer}}
{{Modparm|dvb_usb_dib0700_ir_proto|Set IR protocol|0&#61;NEC, 1&#61;RC5, 2&#61;RC6|1|integer}}
{{Modparm|dvb_usb_dib0700_ir_proto|Set IR protocol|0&#61;NEC, 1&#61;RC5, 2&#61;RC6|1|integer}}
{{Modparm|debug|Set debugging level|1&#61;info, 2&#61;fw, 4&#61;fwdata, 8&#61;data|0 (none)|integer (bitmap)}}
{{Modparm|debug|Set debugging level|1&#61;info, 2&#61;fw, 4&#61;fwdata, 8&#61;data|0 (none)|integer (bitmap)}}


==== dvb_usb ====
===== dvb_usb =====
{{Modparm|debug|Set debugging level|1&#61;info, 2&#61;xfer, 4&#61;pll, 8&#61;ts, 16&#61;err, 32&#61;rc, 64&#61;fw, 128&#61;mem, 256&#61;uxfer|0 (none)|integer (bitmap)}}
{{Modparm|debug|Set debugging level|1&#61;info, 2&#61;xfer, 4&#61;pll, 8&#61;ts, 16&#61;err, 32&#61;rc, 64&#61;fw, 128&#61;mem, 256&#61;uxfer|0 (none)|integer (bitmap)}}
{{Modparm|disable_rc_polling|Disable remote control polling||0 (enabled)|integer}}
{{Modparm|disable_rc_polling|Disable remote control polling||0 (enabled)|integer}}
{{Modparm|force_pid_filter_usage|Force all DVB USB devices to use a PID filter, if any||0 (disabled)|integer}}
{{Modparm|force_pid_filter_usage|Force all DVB USB devices to use a PID filter, if any||0 (disabled)|integer}}


==== dvb_core ====
===== dvb_core =====
{{Modparm|dvb_net_debug|Enable debug messages||0 (disabled)|integer}}
{{Modparm|dvb_net_debug|Enable debug messages||0 (disabled)|integer}}
{{Modparm|frontend_debug|Turn on frontend core debugging||0 (off)|integer}}
{{Modparm|frontend_debug|Turn on frontend core debugging||0 (off)|integer}}
Line 72: Line 67:
{{Modparm|dvbdev_debug|Turn on device debugging||0 (off)|integer}}
{{Modparm|dvbdev_debug|Turn on device debugging||0 (off)|integer}}


==== dibx000_common ====
===== dibx000_common =====
{{Modparm|debug|Turn on debugging||0 (off)|integer}}
{{Modparm|debug|Turn on debugging||0 (off)|integer}}


{{RemoteControlSupport}}
=== Remote control ===
Grey top, black bottom, 45 buttons, snowboard shape.

Find the IR receiver's device by looking in the <tt>dmesg</tt> output for a line similar to:

input: IR-receiver inside an USB DVB receiver as /class/input/'''input4'''

Additionally, the IR receiver will be listed if you execute the command:

cat /proc/bus/input/devices

For example:

I: Bus=0003 Vendor=2040 Product=9950 Version=0100
N: Name="IR-receiver inside an USB DVB receiver"
P: Phys=usb-0000:07:01.2-1/ir0
S: Sysfs=/class/input/'''input4'''
U: Uniq=
H: Handlers=kbd '''event4'''
B: EV=3
B: KEY=14afc336 284284d00000000 0 480058000 219040000801 9e96c000000000 90020000000ffd

In this example, the remote control gives output into <tt>/dev/input/event4</tt>.

The event number depends on your particular system and can vary.


==== Keys repeated twice ====
Eventually this event number can even vary at every reboot.
But there is still the problem of the key repeats for it, so that each keypress will be repeated twice. The patches, as mentioned above, may not work, but a workaround is possilbe. It is described in http://ubuntuforums.org/showthread.php?p=4253678


Simply add <tt>config = echo " > /dev/null</tt> before the main config in .mythtv/lircrc or .lircrc
You could create a new udev rule in <tt>/etc/udev/rules.d/65-persistent-hauppauge.rules</tt>.


begin
KERNEL=="input*", ATTRS{name}=="IR-receiver inside an USB DVB receiver", SYMLINK+="input/dvb-ir"
prog = mythtv
button = Mute
'''config = echo " > /dev/null'''
config = |
...
end


So each 2nd keypress will be suppressed. This works in some application but not others (e.g. vlc).
It has been mentionned that the following line works, instead of the above line (needs confirmation and deletion of the ugly line):


Alternatively there is a patch for the kernel driver that solves it, it can be found [http://javierarias.wordpress.com/2008/07/01/hauppauge-wintv-nova-t-stick-y-mando-a-distancia-funcionando-%C2%A1por-fin/comment-page-1/#comment-44 here].
KERNEL=="event*", ATTRS{name}=="IR-receiver inside an USB DVB receiver", SYMLINK+="input/dvb-ir


Finally if that doesn't work and you have the silver remote (A415-HPG-WE-A
This would make the Hauppauge receiver always always be linked to '''<tt>/dev/input/dvb-ir</tt>'''.
) then changing the lircd.conf line as follows can prevent the duplicate key presses. This has the side-effect of disabling key repeats for the remote entirely. Change
<tt>toggle_bit_mask 0x80000000</tt>
to
<tt>toggle_bit_mask 0x00000000</tt>


Note: do not try to comment out (using #) any line in this file, or lirc won't work anymore.
But Linux systems runing recent udev will automatically create non-varying names, a nicer and automatic way of providing a stable input event name:


Do NOT do this:
$ ls -la /dev/input/by-path/
total 0
drwxr-xr-x 2 root root 140 2008-02-07 20:31 .
drwxr-xr-x 4 root root 280 2008-02-07 20:31 ..
lrwxrwxrwx 1 root root 9 2008-02-07 20:31 pci-0000:00:1a.1-usb-0:2:1.0-event-kbd -> ../event1
lrwxrwxrwx 1 root root 9 2008-02-07 20:31 pci-0000:00:1a.1-usb-0:2:1.1-event-mouse -> ../event2
lrwxrwxrwx 1 root root 9 2008-02-07 20:31 pci-0000:00:1a.1-usb-0:2:1.1-mouse -> ../mouse1
lrwxrwxrwx 1 root root 9 2008-02-07 20:31 '''pci-4-1--event-ir -> ../event4'''
lrwxrwxrwx 1 root root 9 2008-02-07 20:31 platform-pcspkr-event-spkr -> ../event3


#toggle_bit_mask 0x80000000
LIRC will use it without needing a special kernel module. use the dev/input driver and specify the input event device in <tt>/etc/lirc/hardware.conf</tt>:
toggle_bit_mask 0x00000000


Replace the original line instead.
# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS=""
#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD=false
#Try to load appropriate kernel modules
LOAD_MODULES=true
# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="'''dev/input'''"
# If DEVICE is set to /dev/lirc and devfs is in use /dev/lirc/0 will be
# automatically used instead
DEVICE="'''/dev/input/by-path/pci-4-1--event-ir'''"
MODULES=""
# Default configuration files for your hardware if any
LIRCD_CONF="/etc/lirc/lircd.conf"
LIRCMD_CONF=""

Latest revision as of 13:24, 8 May 2010

Making it Work (generic for all dib0700)

This page is a Template that is included by a couple of dib0700 based devices.

On the left in the toolbox there is a link called What links here. Use it to find the product pages that include this template.

If you have product specific information, please include it on the product page.

See TerraTec Cinergy T USB XXS for an example of how to do this.

Firmware

August 21, 2008 - New firmware file fixing the last cause for i2c errors and disconnects and providing a new, more modular i2c request formatting.

You will need the dvb-usb-dib0700-1.20.fw firmware file in /lib/firmware or the relevant place for your distribution.

You may need to change the name of the file to dvb-usb-dib0700-1.10.fw or create a link until the driver code reflects that change.

For archival purposes: dvb-usb-dib0700-1.10.fw firmware file

August 29,2008 - Issues with Firmware 1.20. Some issues have been found with the latest version of the firmware. Users may wish to continue to use 1.10 unless they have patched their v4l-dvb code with dib0700_new_i2c_api.patch.

November 15,2008 - Issues with Firmware 1.20.

  • The above mentioned dib0700_new_12c_api.patch is not available discretely but is now rolled into the mercurial drivers
  • dvb-usb-dib0700-1.20.fw firmware file is now stable for reception, but remote control functionality is broken; any key press is repeated until the next key is pressed. The only way to get remote control functionality presently is to roll back to 1.10 firmware and suffer the occasional disconnect.
  • The mercurial drivers have been changed so they now load 1.20 firmware. To revert to 1.10 firmware you need to rename your firmware file to dvb-usb-dib0700-1.20.fw or provide a link of that name.
  • To avoid spurious remote control signals with 1.20 firmware, you need to edit /etc/modprobe.d/options or from Ubuntu onwards /etc/modprobe.d/options.confand add:
options dvb_usb disable-rc-polling=1

November 28,2008 - i2c errors. Changes were made to the remote control drivers on November 16,2008 to correct the repeat key problem. The card is generally stable for dual tuner reception and remote control function with Firmware 1.20.

November 10,2009 - mt2060 I2C write failed. Possible regression of a driver bug raised against Ubuntu running 2.6.27-14 and 2.6.31-2.17 causing mt2060 I2C errors in MythTV useage with firmware 1.20. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/397696 Recommend check the kernel extensions listed here for Low Noise Activation and rc_polling are loaded with correct config file name for your distribution, EIT listings information is turned off until a suitable delay (500ms-1000ms)is added to a single card (not both) and the card has correctly been added to the database as two tuners (no additional NULL entries) in the mythtv recordcard table.

Drivers

It requires the dib0700 driver. Just use Mercurial by following the How to Obtain, Build and Install V4L-DVB Device Drivers instructions.

Forcing the activation of LNAs (Low Noise Amplifier)

You may have to force LNA to get this card working:

In /etc/modprobe.d/options add:

options dvb_usb_dib0700 force_lna_activation=1

Disabling the remote control sensor

You may want to disable the remote control sensor if you are using another one and want to avoid error messages in the logs:

In /etc/modprobe.d/options add:

options dvb_usb disable_rc_polling=1

All relevant kernel modules options

In /etc/modprobe.d/options add:

options [module name] [option name]=[setting]

Get the parameters list using

modinfo [name of kernel module]

The debug values are bit fields, with each bit representing a different category. Add values to turn on multiple debugging categories.

dib3000mc
debug
Turn on debugging
Values: integer
Default: 0 (off)
buggy_sfn_workaround
Enable work-around for buggy SFNs
Values: integer
Default: 0 (disabled)
mt2060
debug
Turn on debugging
Values: integer
Default: 0 (off)
dvb_usb_dib0700
force_lna_activation
Force the activation of LNAs (Low Noise Amplifier), if applicable for the device
Values: integer
Default: 0 (automatic/off)
dvb_usb_dib0700_ir_proto
Set IR protocol
Values: integer 0=NEC, 1=RC5, 2=RC6
Default: 1
debug
Set debugging level
Values: integer (bitmap) 1=info, 2=fw, 4=fwdata, 8=data
Default: 0 (none)
dvb_usb
debug
Set debugging level
Values: integer (bitmap) 1=info, 2=xfer, 4=pll, 8=ts, 16=err, 32=rc, 64=fw, 128=mem, 256=uxfer
Default: 0 (none)
disable_rc_polling
Disable remote control polling
Values: integer
Default: 0 (enabled)
force_pid_filter_usage
Force all DVB USB devices to use a PID filter, if any
Values: integer
Default: 0 (disabled)
dvb_core
dvb_net_debug
Enable debug messages
Values: integer
Default: 0 (disabled)
frontend_debug
Turn on frontend core debugging
Values: integer
Default: 0 (off)
dvb_shutdown_timeout
Wait n seconds after close() before suspending hardware
Values: integer
Default: 0
dvb_force_auto_inversion
Set whether INVERSION_AUTO is forced on
Values: integer
Default: 0 (off)
dvb_override_tune_delay
Wait n milliseconds for lock after a tuning attempt
Values: integer
Default: 0
dvb_powerdown_on_sleep
Turn LNB power off on sleep
Values: integer
Default: 1 (enabled)
cam_debug
Enable verbose debug messages
Values: integer
Default: 0 (off)
debug
Turn on debugging
Values: integer
Default: 0
dvbdev_debug
Turn on device debugging
Values: integer
Default: 0 (off)
dibx000_common
debug
Turn on debugging
Values: integer
Default: 0 (off)

Remote control support

Using evdev

As long as the evdev module is loaded, a remote that is recogniced as hid device will be treated as a usb keyboard and this means that you can avoid using lirc.

However, many of the keys on your remote may generate keycodes which are not mapped to anything, by default.

In X you can use xev to find the keycodes and xmodmap to map them to useful symbols. Unfortunately, some keys may generate keycodes that X doesn't recognize at all and the device does not support keymaps, or this would be easy to fix.

Using LIRC

Usually remote controls in linux are managed by the lirc software collection.

To get lirc up and running you need to configure some things.

  • Settings for the hardware
    • Where does lirc get its input from? aka. the DEVICE. E.g. /dev/input/event3
    • How to handle the input? aka. the DRIVER. E.g. devinput
  • Settings for mapping driver output generated by your remote (a bunch of hex numbers) to key names (something like 0..9, Volume+, Next, Record)
  • Settings for mapping key presses to actions (usually located in your .lircrc)
Mythubuntu case

On mythubuntu 10.10, you just have to add this line in /etc/udev/rules.d/65-persistent-hauppauge.rules

SUBSYSTEM=="input", KERNEL=="event*", ATTRS{idVendor}=="2040", ATTRS{idProduct}=="8400", SYMLINK+="lirc0"
Device/driver settings

Find the IR receiver's device by looking in the dmesg output for a line similar to:

input: IR-receiver inside an USB DVB receiver as /class/input/input4

Additionally, the IR receiver will be listed if you execute the command:

cat /proc/bus/input/devices

For example:

I: Bus=0003 Vendor=2040 Product=9950 Version=0100
N: Name="IR-receiver inside an USB DVB receiver"
P: Phys=usb-0000:07:01.2-1/ir0
S: Sysfs=/class/input/input4
U: Uniq=
H: Handlers=kbd event4 
B: EV=3
B: KEY=14afc336 284284d00000000 0 480058000 219040000801 9e96c000000000 90020000000ffd

In this example, the remote control gives output into /dev/input/event4.

The event number depends on your particular system and can vary.

Eventually this event number can even vary at every reboot.

You could create a new udev rule in /etc/udev/rules.d/65-persistent-hauppauge.rules.

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

This would make IR receivers handled by the usb_dvb framework always always be linked to /dev/input/dvb-ir.

But Linux systems running recent udev will automatically create non-varying names, a nicer and automatic way of providing a stable input event name:

$ ls -la /dev/input/by-path/
total 0
drwxr-xr-x 2 root root 140 2008-02-07 20:31 .
drwxr-xr-x 4 root root 280 2008-02-07 20:31 ..
lrwxrwxrwx 1 root root   9 2008-02-07 20:31 pci-0000:00:1a.1-usb-0:2:1.0-event-kbd -> ../event1
lrwxrwxrwx 1 root root   9 2008-02-07 20:31 pci-0000:00:1a.1-usb-0:2:1.1-event-mouse -> ../event2
lrwxrwxrwx 1 root root   9 2008-02-07 20:31 pci-0000:00:1a.1-usb-0:2:1.1-mouse -> ../mouse1
lrwxrwxrwx 1 root root   9 2008-02-07 20:31 pci-4-1--event-ir -> ../event4
lrwxrwxrwx 1 root root   9 2008-02-07 20:31 platform-pcspkr-event-spkr -> ../event3

LIRC will use it without needing a special kernel module. use the dev/input (or devinput. Check this with the command "lircd --device=help".) driver and specify the input event device in /etc/lirc/hardware.conf

# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS=""

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD=false

#Try to load appropriate kernel modules
LOAD_MODULES=true

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="dev/input"
# If DEVICE is set to /dev/lirc and devfs is in use /dev/lirc/0 will be
# automatically used instead
REMOTE_DEVICE="/dev/input/by-path/pci-4-1--event-ir"
MODULES=""

# Default configuration files for your hardware if any
LIRCD_CONF="/etc/lirc/lircd.conf"
LIRCMD_CONF=""

If you have REMOTE and TRANSMITTER sections in your hardware.conf file, they should look like this:

#Chosen Remote Control
REMOTE="Terratec Cinergy DT USB XS Diversity"
REMOTE_MODULES=""
REMOTE_DRIVER="devinput"
REMOTE_DEVICE="/dev/input/by-path/pci-1-5-event-ir"
REMOTE_LIRCD_CONF="/etc/lirc/lircd.conf"
REMOTE_LIRCD_ARGS=""
#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""
Remote key setup

See device specific section below or try [1].


Sample .lircrc

A sample .lircrc can be found LircrcExample here.

Keys repeated twice

But there is still the problem of the key repeats for it, so that each keypress will be repeated twice. The patches, as mentioned above, may not work, but a workaround is possilbe. It is described in http://ubuntuforums.org/showthread.php?p=4253678

Simply add config = echo " > /dev/null before the main config in .mythtv/lircrc or .lircrc

 begin
  prog = mythtv
  button = Mute
  config = echo " > /dev/null
  config = |
  ...
 end

So each 2nd keypress will be suppressed. This works in some application but not others (e.g. vlc).

Alternatively there is a patch for the kernel driver that solves it, it can be found here.

Finally if that doesn't work and you have the silver remote (A415-HPG-WE-A ) then changing the lircd.conf line as follows can prevent the duplicate key presses. This has the side-effect of disabling key repeats for the remote entirely. Change toggle_bit_mask 0x80000000 to toggle_bit_mask 0x00000000

Note: do not try to comment out (using #) any line in this file, or lirc won't work anymore.

Do NOT do this:

 #toggle_bit_mask 0x80000000
 toggle_bit_mask 0x00000000

Replace the original line instead.