Dvb-dtv Input Devices Driver




This page is up-to-date to MythTV version 0.21

Using the native ASIO driver for the device allows Audition 3.0 to effectively use and interact with the device. When a native ASIO device driver is not available, the devcie conflict can be avioded by moving the input device up into the primary or secondary positions in the Audition 3.0 Audio Hardware Setup panel or by setting the device as the default recording device in the Windows Vista. An input driver is a device driver used for instructions for how the computer should communicate with an input device. Related pages A listing of computer drivers is available on our driver software page. If you have to manually install a driver for the device — perhaps the driver is already installed on your system — you can use the Update Driver button in the device’s Properties window. If the device driver is already installed on your system, click the “Browse my computer for driver software” link and choose an installed driver. Xpad - Linux USB driver for Xbox compatible controllers¶. This driver exposes all first-party and third-party Xbox compatible controllers. It has a long history and has enjoyed considerable usage as Window’s xinput library caused most PC games to focus on Xbox controller compatibility. CI devices can be: Integrated with your DVB device; Connected directly to your capture device; Connected to your computer: In this case the device driver for your operating system needs to support this (e.g. A USB based CI device). Depending on your Television provider you need a CAM module to insert into your CI.

  • 5DiSEqC
  • 6Finding satellite info and channels

--> You can skip this chapter if you're not using MythTV as a satellite reveiver.

This chapter explains how to configure your DVB-S (Satellite) capture devices. Before reading this page you should read MythTV structure. First the basics are explained followed by a step-by-step example. As example we will be using a DVB-S capture card from Technotrend (the Technotrend Budget S-1500), but this guide should work for any DVB-S card supported by your operating system.


'The Technotrend Budget S-1500 is a DVB-S capturecard with the possibility of adding a optional CI module. A CI-module gives you the possibility to add a Cam module so you can view encrypted channels (pay-tv). This is optional for most DVB cards and does not change any of the following configuration steps.''

If you are using your setup to watch encrypted channels (payTV) then you need to pay attention to your choice of hardware. your DVB capture device needs to support the use of a CI device. CI devices can be:

  1. Integrated with your DVB device;
  2. Connected directly to your capture device
  3. Connected to your computer: In this case the device driver for your operating system needs to support this (e.g. a USB based CI device).


Depending on your Television provider you need a CAM module to insert into your CI. In this Cam module you insert your smartcard provided by your television supplier. In short your hardware will be connected like:

From this point on you can follow this guide. Your hardware should decode your television signal automaticaly, transparent for MythTV.

--> you can skip this part if you're dvb-s device is already working properly

In most cases your capture cards should work 'out-of-the-box', adjustments are not necessary. To check if your capture device is working you see the following during boot or by using the dmesg command from the terminal.

the output should see:

The card is now ready for use. If your devices is not support by default then find out how to get drivers for it.

Driver

The ubuntu package named linux-firmware-nonfree contains drivers for some DVB-S cards, however there was an issue with some versions prior to 1.8(as shipped with lucid) See http://www.linuxtv.org/wiki/index.php/Hauppauge_WinTV-HVR-4000#Mythbuntu_9.04_users

Start mythtv-setup as root, and select option 2. Capture cards. Choose '(New capture card). Fill the configuration as follows:

  • Card Type: DVB DTV capture card (v3.x)
  • DVB Card Number: 0 (if this is your first DVB card. The number corresponds with what at the end of the dmesg output is displayed: 'registering frontend 0'.)
  • By filling out the card, you'll see that 'Frontend ID' and 'Subtype' automatically filled.
  • The timeouts can remain on their default values.

Now your screen should look somewhat like the one below (this may vary depending your version and look).


Capture card setup



If you use a DVB-S capture device, you need to setup the right settings for DiSEqC. This is the protocol which enables your system to tell your dish to which satellite it has to look.

  • Click on DiSEqC in the configuration of the capture card.
  • If nothing had yet been configured, you will see '(Unconnected)' on top of the screen. Select this to make adjustments.


Note: In order to select (Unconnected) it is necessary to press an arrow key followed by enter


Note: In the current version of MythTV it's not yet possible to alter a DiSEqC connection once it is established. If you still want to do this, you must remove the capture card and add it back (in your configuration menu not your hardware stupid..).


If you click '(Unconnected)', you'll get a small list of choices (see image). In this screen you choose to what device your DVB capture device is linked. If in doubt choose LNB.

Dvb-dtv Input Devices Driver


Diseqc setup



DiSEqC Switch

Choose Switch, if your capturecard is connected with a DiSEqC switch so you can select multiple LNB's (see image below).


Diseqc switch setup


In this screen you'll have the following fields:

  • Description: A recognizable description for this switch.
  • Repeat count: The number of times a command is repeated (for unreliable switches).
  • Switch Type: The type of switch, usually DiSEqC (Valid choices are: Tone, DiSEqC, Legacy SW21, SW42 Legacy and Legacy SW64).
  • Number of ports: The number of ports on the switch. Depending on the switchtype it's possible you can not change this (e.g. Tone is always 2 ports).


Once the institutions of the switch are known, you get the next screen. Here you can choose for each switchport what really is connected, this usually is an LNB.


Diseqc setup



DiSEqC Rotor

Choose Rotor, if you capturecard is connected to a rotating dish.


Diseqc rotor setup


  • Description: Add a recognizable description of the rotor here.
  • Rotor type: Add what type of rotor you will use. Valid choices are: 'DiSEqC 1.2' and 'DiSEqC 1.3 (GotoX / USALS)'. By the first you can configure the 'Posistions'.
  • Also you must enter some data specific to your rotor and location.

If you're done with the configuration of the DiSEqC rotor, then you get the next screen, where you can choose what is connected with your rotor. Again, this will usually be an LNB.


Diseqc rotor setup



DiSEqC 1.2 positions

Drivers xircom network & wireless cards online. If you choose for 'Positions' with rotor type 'DiSEqC 1.2', then you get the next screen where you can configure a positionnumber for each 'Orbital Position'.

You can find more information about DiSEqC in the chapter about DVB in general.


Diseqc rotor setup



DiSEqC LNB

Choose for LNB, if you capture device is directly connected with an LNB.


Diseqc lnb setup


  • Description: This should be a recognisable description for this LNB (e.g. 'Astra 19.2')
  • LNB preset: 'Universal (Europe)' is usually the right choice if you live in Europe, but depends on the type of LNB. Consult the documentation of your LNB if Universal does not work.

Create your settings for MythTV by opening the MythTV-setup.

setup your card, ensure you use card 0 (or any other adapter number you use), setup a storage directory, setup your Video Sources, setup your Input connections, Scan channels etc. For initial transponders, use one frequency that locks from the list:

  1. D**hnet 119 -> http://www.lyngsat.com/packages/dish119.html
  2. D**hnet 110 -> http://www.lyngsat.com/packages/dish110.html
  3. B*v 91 -> http://www.lyngsat.com/nimiq1.html
  4. B*v 82 -> http://www.lyngsat.com/nimiq2.html

Add 3 zeros to the end of each frequency (ie 12224 R should be 12224000, Right Circular, 20000000)


Unofficial Scripts

Warning: The following is unofficial and unsupported. If you have problems scanning then report them properly so they may be fixed.

For some non-standards compliant DVB-S broadcasters, Scanning satellites in Myth can sometimes be a error prone process. If this is the case for you, then a couple of handy programs may help you:

Good script that scans and imports channels into your MythTV system

myth_scanner

This program will grab all of the transponder info for the entire satellite, and populate the Myth channel & transponder database. All you need is to be tuned to any TP on that sat (using szap for example). You can find the most recent copy somewhere on www.happysat.org

modchannel.sh

This program will bulk rename/renumber/change EIT/change visible/delete channels/etc. Very handy if you have to rescan a sat often. Available at GenerationD
One of the best resources to retreive channel data.


This section is initially setup by Loki with help from MythPortal.be, an excellent resource for setting up MythTV (Dutch language).

Retrieved from 'http://www.mythtv.org/wiki?title=User_Manual:Setting_up_DVB-S_for_satellite&oldid=62339'

1.1. The simplest example¶

Here comes a very simple example of an input device driver. The device hasjust one button and the button is accessible at i/o port BUTTON_PORT. Whenpressed or released a BUTTON_IRQ happens. The driver could look like:

1.2. What the example does¶

First it has to include the <linux/input.h> file, which interfaces to theinput subsystem. This provides all the definitions needed.

In the _init function, which is called either upon module load or whenbooting the kernel, it grabs the required resources (it should also checkfor the presence of the device).

Then it allocates a new input device structure with input_allocate_device()and sets up input bitfields. This way the device driver tells the otherparts of the input systems what it is - what events can be generated oraccepted by this input device. Our example device can only generate EV_KEYtype events, and from those only BTN_0 event code. Thus we only set thesetwo bits. We could have used:

as well, but with more than single bits the first approach tends to beshorter.

Then the example driver registers the input device structure by calling:

This adds the button_dev structure to linked lists of the input driver andcalls device handler modules _connect functions to tell them a new inputdevice has appeared. input_register_device() may sleep and therefore mustnot be called from an interrupt or with a spinlock held.

While in use, the only used function of the driver is:

which upon every interrupt from the button checks its state and reports itvia the:

Dvb-dtv input devices driver touchpad

call to the input system. There is no need to check whether the interruptroutine isn’t reporting two same value events (press, press for example) tothe input system, because the input_report_* functions check thatthemselves.

Then there is the:

call to tell those who receive the events that we’ve sent a complete report.This doesn’t seem important in the one button case, but is quite importantfor for example mouse movement, where you don’t want the X and Y valuesto be interpreted separately, because that’d result in a different movement.

1.3. dev->open() and dev->close()¶

In case the driver has to repeatedly poll the device, because it doesn’thave an interrupt coming from it and the polling is too expensive to be doneall the time, or if the device uses a valuable resource (eg. interrupt), itcan use the open and close callback to know when it can stop polling orrelease the interrupt and when it must resume polling or grab the interruptagain. To do that, we would add this to our example driver:

Note that input core keeps track of number of users for the device andmakes sure that dev->open() is called only when the first user connectsto the device and that dev->close() is called when the very last userdisconnects. Calls to both callbacks are serialized.

The open() callback should return a 0 in case of success or any nonzero valuein case of failure. The close() callback (which is void) must always succeed.

1.4. Basic event types¶

The most simple event type is EV_KEY, which is used for keys and buttons.It’s reported to the input system via:

See uapi/linux/input-event-codes.h for the allowable values of code (from 0 toKEY_MAX). Value is interpreted as a truth value, ie any nonzero value means keypressed, zero value means key released. The input code generates events onlyin case the value is different from before.

In addition to EV_KEY, there are two more basic event types: EV_REL andEV_ABS. They are used for relative and absolute values supplied by thedevice. A relative value may be for example a mouse movement in the X axis.The mouse reports it as a relative difference from the last position,because it doesn’t have any absolute coordinate system to work in. Absoluteevents are namely for joysticks and digitizers - devices that do work in anabsolute coordinate systems.

Having the device report EV_REL buttons is as simple as with EV_KEY, simplyset the corresponding bits and call the:

function. Events are generated only for nonzero value.

However EV_ABS requires a little special care. Before callinginput_register_device, you have to fill additional fields in the input_devstruct for each absolute axis your device has. If our button device had alsothe ABS_X axis:

Or, you can just say:

This setting would be appropriate for a joystick X axis, with the minimum of0, maximum of 255 (which the joystick must be able to reach, no problem ifit sometimes reports more, but it must be able to always reach the min andmax values), with noise in the data up to +- 4, and with a center flatposition of size 8.

If you don’t need absfuzz and absflat, you can set them to zero, which meanthat the thing is precise and always returns to exactly the center position(if it has any).

When you plug the device into your USB, Windows will look for the associated driver, if it cannot find this driver then you will be prompted to insert the driver disc that came with your device. Common USB Device errors are ‘ usb port not working ‘, ‘device descriptor request failed error’ or ‘bugcodeusbdriver’ issues. If drivers were not downloaded automatically by Windows Update, use Device Manager to refresh the driver from Windows Update, or contact the device manufacturer. I’m Moli, your virtual agent. I can help with Moto phone issues. Download spartek usb devices driver win 7.

1.5. BITS_TO_LONGS(), BIT_WORD(), BIT_MASK()¶

These three macros from bitops.h help some bitfield computations:

1.6. The id* and name fields¶

The dev->name should be set before registering the input device by the inputdevice driver. It’s a string like ‘Generic button device’ containing auser friendly name of the device.

The id* fields contain the bus ID (PCI, USB, ..), vendor ID and device IDof the device. The bus IDs are defined in input.h. The vendor and device idsare defined in pci_ids.h, usb_ids.h and similar include files. These fieldsshould be set by the input device driver before registering it.

The idtype field can be used for specific information for the input devicedriver.

The id and name fields can be passed to userland via the evdev interface.

Dvb-dtv Input Devices Driver

1.7. The keycode, keycodemax, keycodesize fields¶

These three fields should be used by input devices that have dense keymaps.The keycode is an array used to map from scancodes to input system keycodes.The keycode max should contain the size of the array and keycodesize thesize of each entry in it (in bytes).

Devices

Dvb-dtv Input Devices Driver Updater

Userspace can query and alter current scancode to keycode mappings usingEVIOCGKEYCODE and EVIOCSKEYCODE ioctls on corresponding evdev interface.When a device has all 3 aforementioned fields filled in, the driver mayrely on kernel’s default implementation of setting and querying keycodemappings.

1.8. dev->getkeycode() and dev->setkeycode()¶

getkeycode() and setkeycode() callbacks allow drivers to override defaultkeycode/keycodesize/keycodemax mapping mechanism provided by input coreand implement sparse keycode maps.

1.9. Key autorepeat¶

.. is simple. It is handled by the input.c module. Hardware autorepeat isnot used, because it’s not present in many devices and even where it ispresent, it is broken sometimes (at keyboards: Toshiba notebooks). To enableautorepeat for your device, just set EV_REP in dev->evbit. All will behandled by the input system.

1.10. Other event types, handling output events¶

The other event types up to now are:

  • EV_LED - used for the keyboard LEDs.
  • EV_SND - used for keyboard beeps.

They are very similar to for example key events, but they go in the otherdirection - from the system to the input device driver. If your input devicedriver can handle these events, it has to set the respective bits in evbit,and also the callback routine:

Dvb-dtv Input Devices Driver Touchpad

This callback routine can be called from an interrupt or a BH (although thatisn’t a rule), and thus must not sleep, and must not take too long to finish.