MythTV 0.22 in Karmic 9.10
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.
Fix for Firefox flashing when in full screen 2
Since Jaunty, when Firefox is displayed in full screen (F11), any of the following actions will result in Firefox disappearing for a second and the background desktop image replacing it:
- right click
- alt-tab
- hovering over a link with a tool tip
That happens if compiz is in use and I verified the problem both on machines using Intel and Nvidia video cards.
The fix is easy:
- go to System -> Preferences -> CompizConfig Settings Manager -> General
- uncheck "Unredirect Fullscreen Windows"
Screen flickering with nvidia on ubuntu 20
Another nasty side effect of using compiz with an nvidia video card is the screen flickering. Right when a compiz 3D effect kicks in or 30 seconds after it, the screen goes black for a fraction of a second. This is not a new issue, I have struggled with it since hardy and it happens with all nvidia driver versions I can remember (173, 177 and 180).
Cause The cause the is the Powermizer feature of the nvidia driver. It adjusts the GPU speed depending on the usage that is being made of the desktop. Every time Powermizer decides to change the frequency, the screen flickers. You can easily verify that by going to the "Nvidia X Server Settings" panel, Powermizer. Watch the "Performance Levels" and see how the level changes every time the screen flickers.
Solutions There are many related posts on the web. The most common solution that gets reported is described for example at Linux Outlaws Forum. Add the following lines to /etc/modprobe.d/options:
options nvidia NVreg_RegistryDwords='PerfLevelSrc=0x2222' options nvidia NVreg_Mobile=1
It didn’t worked for me in Intreprid or older Ubuntu releases.
So the real solution that does completely works for me is to freeze the powermizer performance level to 0 through the "Nvidia X Server Settings" panel in the "Clock frequencies" pane. But that panel is only available after setting the "Coolbits" option in /etc/X11/xorg.conf in the screen section. For example, this is what I have:
Section "Screen"
Identifier 'Default Screen'
Device 'nVidia Corporation G72M [Quadro NVS 110M/GeForce Go 7300]'
Monitor 'Generic Monitor'
Option 'AddARGBVisuals' 'True'
Option 'NoLogo' 'True'
Option 'RenderAccel' 'True'
Option 'Coolbits' '1'
Option 'RegistryDwords' 'PowerMizerLevel=0x3'
Option 'AddARGBGLXVisuals' 'True'
DefaultDepth 24
SubSection 'Display'
Depth 24
Modes '1680x1050'
EndSubSection
EndSection
Then after restarting X, you can open the Nvidia setting panel and do the following:
- Go to "Clock frequencies"
- Check the "Enable Overclocking" box and accept the warning
- Select "3D clock frequencies" and pick a GPU and Memory frequency
- Apply
On my 7300 card, setting GPU to 100MHz and Memory to 400MHz works just fine, compiz 3D effects are still very smooth. Unfortunately, this needs to be done every time you restart X. If somebody finds a better solution, please let me know.
Update for Jaunty 9.04 and nvidia 180 (4/24/2009): in Jaunty with 180.44 and xorg 1.6, where the flickering is worst than ever, the solution above with /etc/modprobe.d/options actually works and no there is no need to lock the 3D clock frequency.
Nvidia driver and image corruption in Intrepid 1
Compiz is a must have on a Linux desktop. It brings the end user experience up to the MacOSX level. Unfortunately it sometimes comes with nasty side effects. On my Inspiron 6400 with a 7300 video card, it started misbehaving in Intrepid with driver 177. Window titles would either disappear or get painted with weird pink stripes. It happens only sometimes and only with a few applications. It may happen when the focus switches from one window to another or just when typing.
Thunderbird is the application where it happens the most. The definitive test is to start a new email and type the subject: the titlebar of that window will systematically get corrupted. It’s really ugly when it happens.
Nvidia driver version 177 is clearly the worst. Reverting to 173 improves things a bit but it still won’t pass the Thunderbird compose email test. You can easily switch to 173 by going to System/Administration/Hardware Drivers.
But today, as I was experimenting with the newest nvidia driver, 180.29, everything got fixed. Big thanks to Nvidia for fixing this!
How to setup the 180 driver in Ubuntu Intrepid Ibex?
I followed the instructions in Adam Michael Roach webpage. Basically, do the following: Append those 2 lines to /etc/apt/sources.list:deb http://ppa.launchpad.net/anders-kaseorg/ppa/ubuntu intrepid main deb-src http://ppa.launchpad.net/anders-kaseorg/ppa/ubuntu intrepid mainand run the following commands:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 026491A5DD081BDC6CDFC0DE6298AD34413576CB sudo apt-get update sudo apt-get install nvidia-glx-180Reboot and you’re done:
me@myhost ~ $ dmesg | grep -i nv [ 16.183016] nvidia: module license 'NVIDIA' taints kernel. [ 16.438964] nvidia 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16 [ 16.438974] nvidia 0000:01:00.0: setting latency timer to 64 [ 16.439174] NVRM: loading NVIDIA UNIX x86 Kernel Module 180.29 Wed Feb 4 23:44:25 PST 2009
