MythTV 0.22 in Karmic 9.10 3

Posted by bikethetam Fri, 27 Nov 2009 22:08:00 GMT

This is the tale of my attempts, eventually successful, to setup Mythbuntu on a newly purchased HP slimline desktop s5280t.

Hardware

This is the decription of the machine: it's HP Slimline s5300. It comes with a quad-core CPU, 6GB of RAM and 640GB, but that doesn't matter for MythTV. What matters is the following list of devices:

  • Tuner card: Hauppauge WinTV-HVR1255
  • Remote control: TSGH-IR01 (the IR receiver plugs into the tuner card in what looks like a simple jack)
  • Video Card: Nvidia G210 with HDMI
  • Samsung LCD TV with DVI input (among others)

 

Setup

The initial Mythbuntu setup was uneventful. I installed Karmic from scratch without issue.

During installation, a few MythTV setup screens are proposed to do the initial configuration (tuner card, SchedulesDirect subsciption, channel lineup, ...). That went equally well except for the remote control:  none of the devices in the list matched mine.

Anyways, the setup completed and I could start MythTV. I must say I was pleasantly surprised, the UI came up and using the keyboard, I could actually "watch TV". There were a few annoying details, like the size of the UI that doesn't exactly match the size of the TV screen and a very slim noise band at the top of the image on 4:3 channels. But the major issues were of different kind:

  • no sound
  • no remote

Sound problem

The image comes from the video card through the HDMI port and I was hoping the sound would come out of the analog sound output of the computer and to the analog sound input of the TV. That's how it was working on my previous MythTV installation (Gentoo + Acer machine). The DVI input of the TV is supposed to work in concert with the analog sound input right next to it, but in this case it didn't: strangely, sound is coming out of the analog sound port but the TV ignores it.

After a little digging, I found that the TV can actually receive sound through HDMI. At least that's what it tells the video card when it sends its firmware signature (EDID) to the video card. The video card, naive as it is, believes it and replies to the TV that it's going to do just that. The TV is happy, it turns off the analog sound input and listens on HDMI.

Unfortunately, that's all too sophisticated for the Nvidia driver of the video card (version 185 by default by I also tried 190 to no avail). The nvidia driver doesn't know how to process sound coming from the motherboard. But it does know how to send sound to the TV and that's what it does, it sends an all blank soundtrack  to the TV.

The solution is on this page: Converting analog sound to HDMI. It consists in modifying the EDID information submitted by the TV and remove the bits about receiving sound through HDMI. The updated EDID must then be saved into xorg.conf. The video card will subsequently read the EDID from there instead of getting it from the TV and will stop telling the TV that sound is coming through HDMI which will cause the TV to listen on the analog input.

That worked like a charm for me (after a couple of reboots).

Remote troubles

Hauppauge 1250 IR receiver

The remote control that HP sent with the computer is designed for Windows Media Center Edition which led me to believe it fell into the "mceusb" category of remotes that can be used with LIRC and MythTV. But I was mistaken, the IR receiver is not a USB device, instead it plugs in directly into the tuner card (Hauppauge 1250).

Again, the issue here is with too recent hardware and outdated drivers: the driver for the Hauppauge tuner card doesn't recognize the IR receiver and completely ignores it. There's no fix as of yet. That's too bad because this remote control looked pretty solid compared to all the remotes that can be bought online.

The full explanation can be found on MythTV wiki.

USB Remote Control

I then went to buy that wireless PC remote I found on Amazon. It seemed standard enough and I was hoping I could use the other remote described above on the new IR receiver. It didn't work as planned. The first thing that is supposed to happen when plugging in a USB IR receiver is to have LIRC detect the device (should show up in dmesg) and that should be immediately followed by the device appearing under /dev with the name /dev/lirc0.

I got LIRC to detect something:

Nov 22 14:18:35 ibiza kernel: [   15.507820] lirc_dev: IR Remote Control driver registered, major 61
Nov 22 14:18:35 ibiza kernel: [   15.592792] lirc_mceusb: Windows Media Center Edition USB IR Transceiver driver for LIRC 1.90
Nov 22 14:18:35 ibiza kernel: [   15.592826] usbcore: registered new interface driver lirc_mceusb

but nothing showed up as /dev/lirc0. The testing LIRC tool 'irw' was not mute, some garbage got printed but not at all what's supposed to be printed.

In fact, even though LIRC didn't recognize the IR receiver, I could use the remote to do some basic operations: the up, down, left and right keys were doing exactly what is expected from the arrow keys of a regular keyboard. So I could use it to do the most basic navigation operations on the MythTV menus. Interesting but not good enough.

After lots of googling, I finally realized that the remote was in fact recognized as a keyboard and a mouse by the system. That's bad news because that means I won't be able to use the other remote with that receiver. Anyways, this is called an HID remote and LIRC has a driver for that, it's called "devinput". That Archlinux wiki page has the lircd.conf file to be used with such a device. I found only later that dmesg was showing the HID device:

Nov 22 16:48:42 ibiza kernel: [    3.247892] input: HID 073a:2230 as /devices/pci0000:00/0000:00:1d.1/usb7/7-1/7-1:1.0/input/input3
Nov 22 16:48:42 ibiza kernel: [    3.247957] generic-usb 0003:073A:2230.0001: input,hidraw0: USB HID v1.10 Keyboard [HID 073a:2230] on usb-0000:00:1d.1-1/input0
Nov 22 16:48:42 ibiza kernel: [    3.247968] usbcore: registered new interface driver usbhid
Nov 22 16:48:42 ibiza kernel: [    3.247970] usbhid: v2.6:USB HID core driver

First you have to find under which name the device was mapped:

# ll /dev/input/by-id/
0 lrwxrwxrwx 1 root root 9 Nov 22 14:18 usb-073a_2230-event-mouse -> ../event6
0 lrwxrwxrwx 1 root root 9 Nov 22 14:18 usb-073a_2230-mouse -> ../mouse2

Or you can just list all the "event" devices:

# cat /proc/bus/input/devices 
...
I: Bus=0003 Vendor=073a Product=2230 Version=0110
N: Name="HID 073a:2230"
P: Phys=usb-0000:00:1d.1-1/input0
S: Sysfs=/devices/pci0000:00/0000:00:1d.1/usb7/7-1/7-1:1.0/input/input6
U: Uniq=
H: Handlers=kbd mouse1 event6
B: EV=10001f
B: KEY=837fff002c3027 bf00444400000000 fffffffffffff 10c040a27c007 ffa67bfad941dfff febeffdfffefffff fffffffffffffffe
B: REL=343
B: ABS=100030000
B: MSC=10
...

Knowing the /dev/input /event number you can then test it with:

lircd -n -d /dev/input/event6 -H dev/input lircd.conf  

Create a /usr/share/lirc/remotes/hid/lircd.conf.hid file with the data from the Archlinux page and update /etc/lirc/lircd.conf with that patch. Also update /etc/lirc/hardware.conf with the device name (/dev/input/event6) and driver name (devinput).

MythTV will now work with the remote.

 


Comments

Leave a comment

  1. Joe 3 months later:

    Were you able to get the Hauppauge remote working with the generic PC Remote IR receiver? Or, even with it recognized in lirc, does it only work with the bundled remote?

  2. Currency 11 months later:

    The introduction of MythTV 0.22 in Karmic 9.10 is very detailed, good job!

  3. muneeb about 1 year later:

    thanks for sharing it but tell me one more thing can we use it for hacking purpose? i am not much interested it but i am a victim of hacking thanks again hcg diet

Comments