Wednesday 29 November 2006

Leadtek Winfast TV2000 XP on gentoo (part 1 - infrared remote)

The TV2000 XP is a tv/radio tuner card with a video input slot and an infrared pilot (CoolCommand). It is based on Conexant CX23880/1/2/3 PCI Video and Audio Decoder. Complete output of lspci -vv looks like this:


02:02.0 Multimedia video controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder (rev 05)
Subsystem: LeadTek Research Inc. Unknown device 6611
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (5000ns min, 13750ns max), Cache Line Size 08
Interrupt: pin A routed to IRQ 22
Region 0: Memory at fa000000 (32-bit, non-prefetchable) [size=16M]
Capabilities: [44] Vital Product Data
Capabilities: [4c] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-

Linux kernel (2.6.17) contains drivers for this device in the Video For Linux section. You have to enable the following options:


Device Drivers --->
Multimedia Devices --->
<*> Video For Linux
[*] Enable Video For Linux API 1 (DEPRECATED)
[*] Enable Video For Linux API 1 compatible Layer
Video Capture Adapters --->
<M> Conexant 2388x (bt878 successor) support
<M> Conexant 2388x DMA audio support

For the infrared pilot to work you have to enable the evdev event interface:


Device Drivers  --->
Input Device Support --->
<*> Event Interface

Now recompile (make install && make modules modules_install for gentoo-sources) and reboot. After the system boots again, load the module cx8800 (modprobe cx8800). dmesg | tail -n 15 should report something similar to this:


cx2388x v4l2 driver version 0.0.5 loaded
ACPI: PCI Interrupt 0000:02:02.0[A] -> GSI 22 (level, low) -> IRQ 22
CORE cx88[0]: subsystem: 107d:6611, board: Leadtek Winfast 2000XP Expert [card=5,autodetected]
TV tuner 44 at 0x1fe, Radio tuner -1 at 0x1fe
cx88[0]: Leadtek Winfast 2000XP Expert config: tuner=38, eeprom[0]=0x01
input: cx88 IR (Leadtek Winfast 2000XP as /class/input/input2
cx88[0]/0: found at 0000:02:02.0, rev: 5, irq: 22, latency: 32, mmio: 0xfa000000
tuner 0-0060: All bytes are equal. It is not a TEA5767
tuner 0-0060: chip found @ 0xc0 (cx88[0])
tuner 0-0060: type set to 38 (Philips PAL/SECAM multi (FM1216ME MK3))
tda9887 0-0043: chip found @ 0x86 (cx88[0])
cx88[0]/0: registered device video0 [v4l2]
cx88[0]/0: registered device vbi0
cx88[0]/0: registered device radio0

and ls -l /dev/v4l/ should show devices radio0, vbi0 and video0, all belonging to user root and group video. Also, please note the line input: cx88 IR (Leadtek Winfast 2000XP as /class/input/input2. There should be a new event device in /dev/input/ with the same number (in this case, it will be /dev/input/event2). Unfortunately, device's name depends on the order in which devices are created by udev, and this might change. In order to find a static name of the remote, inspect the /dev/input/by-path directory. It contains device symlinks that udev created using devices' physical addresses. This is enough for a PCI card, because it will be constatant as long as the slot the card is plugged won't change. In my case, the infrared control is visible as /dev/input/by-path/pci-0000:02:03.0--event-ir.


Add cx8800 to /etc/modules.autoload/kernel-2.6 , so it will be loaded each time system starts. Now, in your /etc/make.conf, add lirc v4l v4l2 to USE flags and add a line LIRC_DEVICES="devinput". Although lirc has a driver for Leadtek Winfast TV2000 XP (named leadtek_0010), I was unable to get it to work under kernel 2.6.17 (it did not create a device node, and all attempts to use it resulted in lircd crashing and irw reporting "could not connect to socket"). Emerge lirc (and kdelirc if you want an easy way to control all KDE applications with your remote) and then execute emerge -avuDN world.


First, check if the remote works. Run lircd -d /dev/input/by-path/pci-0000:02:03.0--event-ir -n and press some buttons on the remote. Lircd should report them (although, sadly, not all keys work through the event interface). Edit /etc/conf.d/lircd and set LIRCD_OPTS="-d /dev/input/by-path/pci-0000:02:03.0--event-ir" (change the path to match your configuration). Save Leadtek Winfast TV2000 XP lirc configuration as /etc/lircd.conf. Save lirc configuration for xmms, mplayer and vlc as /etc/lircrc.


Now kill the manually started daemon and start the system one (/etc/init.d/lircd start). Add it to the runlevel (rc-update add lircd default). Start xmms/mplayer/vlc to test how your remote works. If you encounter any problems, verify that irw reports key names correctly.

Saturday 18 November 2006

Gry są złe

Złe, niedobre i powinny być zakazane. Koniecznie. Od ponad roku żadnej dłużej niż jeden dzień na dysku nie zostawiłem, myślałem, że już mnie nie bawią... A potem trafił się Oblivion. Teoretycznie nie powinien w ogóle ruszać na moim archaicznym sprzęcie, ale trochę kombinowania (głównie za pomocą Oldblivion) i udało się uzyskać całkiem porządną jakość. A przynajmniej tak mi się wydawało.


Widok na Imperial City

PiBis odwiedził mnie i przyniósł swojego nowiutkiego laptopa. Trzeba było czymś pomęczyć nową maszynkę, wybór padł właśnie na Oblivion. I to był błąd. Zobaczyłem fale na wodzie, trawę ruszającą się pod wpływem wiatru i motyle fruwające nad kwiatami. Poległem. Jak powszechnie wiadomo, faceci są jak małe dzieci, tylko mają więcej pieniędzy. W związku z czym mam teraz nieco mniej pieniędzy (ale w granicach rozsądku, na całe szczęście) a Oblivion u mnie wygląda tak:


Widok na Imperial City

Ten sam widok chwilę później, gdy opadła mgła:


Widok na Imperial City

Pierwszy raz w grze zdarzyło mi się, że mając wejść do jakiegoś lochu, stałem 5 minut przed wejściem patrząc na zachodzące słońce. Grafika w tej grze powala, wycieczka po zapomnianej świątyni potrafi naprawdę przestraszyć: po wypalenu się ostatniej pochodni z ekwipunku, korzystając ze słabiutkiego światła rzucanego przez zaklęcie wypatrywałem kolejnej pułapki i aż podskoczyłem, gdy z za narożnika wymaszerował na mnie szkielet.


A przechodząc na temat bardziej techniczny: z mojej obsesji już się zwierzałem, tym razem jej efektem był wybór karty z pasywnym chłodzeniem.


Gigabyte GS 7600 w opakowaniu

Zabawka jest nieco krótsza od poprzedniej (którą, notabene, z bólem serca oddam w dobre ręce) i zdecydowanie chudsza.


karty graficzne od spodu
karty graficzne od góry

GV-N76G256D-RH: na pokładzie 256 MB pamięci DDR2, magistrala AGP 8x. Wynik 3DMark 2005: 3680 punktów, po minimalnym podkręceniu: 3810 punktów. GlxGears na starej karcie wyciągały do 3k FPS, na nowej 6k FPS. Co mnie lekko zaskoczyło, karta ma też osobne gniazdo zasilania. Takie czasy... Przysporzyło mi to nieco problemów - w pogoni za ciszą wymieniłem jakiś czas temu zasilacz (nowy ma wentrylator o średnicy 12 centymetrów i odpinane kable), potem obudowę (wentylatory, a jakże, 12 centymetrów, do tego zasilacz umieszczony na dole, w osobnej komorze), a teraz okazało się, że muszę przeciągnąć dodatkowy kabel zasilający. Chwilę to trwało, kabli w przejściu między jedną a drugą komorą obudowy jest dość dużo.


Plątania kabli zasilających w obudowie
Karta na swoim miejscu

Z instalacją w systemie poszło już gładko. Windows oczywiście pokrzyczał trochę, kazał się ponownie aktywować (a niech mu będzie, w końcu Politechnika funduje studentom oryginały), restartował sie 3 razy w trakcie instalowania sterowników. Gentoo podeszło do sprawy tak spokojnie, że zacząłem się obawiać, iż coś jest nie tak. Sprawdziłem, co zgłasza lspci oraz jak wygląda wynik glxgears i zostałem przyjemnie zaskoczony - sterowniki nVidii, bez żadnej ingerencji ze strony użytkownika, wykryły i obsłużyły zmienioną kartę.


Wczoraj usłyszałem upragniony od dawna komplement: szwagier wszedł do pokoju i poprosił, żebym włączył komputer. Wreszcie mogłem odpowiedzieć: "Przecież jest włączony!"

Friday 17 November 2006

Gentoo jest lepsze

Mammal chwalił się wczoraj, że Ubuntu jest szybkie. Ale to nic w porównaniu z Gentoo z prędkością 4818KB/sek.