Saturday, April 29, 2006

The state of TV out on ATI cards in Linux...

... is just sad. The GATOS stuff doesn't really look that maintained, TVout is only supported in the CVS version, the proprietary ATI drivers only support Radeon 8500 and up (tough luck if you happen to have a Radeon 7500 with RV200), xorg7.0 is supposed to support TVout using the GATOS code, but doesn't really exist yet.
*sigh*
I caved and picked up a Nvidia FX5200 card with TV out.

pvr500 with ivtv

Followed the generic distribution howto for my 2.6.15 kernel. Installed ivtv 0.4.4, copied firmware to /usr/lib/hotplug/firmware, kick out the old modules, /sbin/modprobe ivtv and get in dmesg:


ivtv: ==================== START INIT IVTV ====================
ivtv: version 0.4.4 (tagged release) loading
ivtv: Linux version: 2.6.15-1-k7 K7 gcc-4.0
ivtv: In case of problems please include the debug info between
ivtv: the START INIT IVTV and END INIT IVTV lines, along with
ivtv: any module options, when mailing the ivtv-users mailinglist.
ivtv0: Autodetected WinTV PVR 150 card (cx23416 based)
ACPI: PCI Interrupt 0000:02:08.0[A] -> Link [LNKB] -> GSI 5 (level, low) -> IRQ 5
ivtv0: Unreasonably low latency timer, setting to 64 (was 32)
tveeprom: Second (radio) tuner idx 101
tveeprom: ivtv version
tveeprom: Hauppauge: model = 23552, rev = D492, serial# = 9492586
tveeprom: tuner = Philips FQ1236A MK4 (idx = 92, type = 57)
tveeprom: tuner fmt = NTSC(M) (eeprom = 0x08, v4l2 = 0x00001000)
tveeprom: audio processor = CX25843 (type = 25)
tveeprom: decoder processor = CX25843 (type = 1e)
ivtv0: i2c attach to card #0 ok [client=tveeprom, addr=50]
ivtv0: This is the first unit of a PVR500
tuner (ivtv): chip found at addr 0xc0 i2c-bus ivtv i2c driver #0
TEA5767 detected.
ivtv0: i2c attach to card #0 ok [client=(tuner unset), addr=60]
tuner: type set to 62 (Philips TEA5767HN FM Radio) by autodetect
type set to 62 (Philips TEA5767HN FM Radio)
tuner (ivtv): chip found at addr 0xc2 i2c-bus ivtv i2c driver #0
ivtv0: i2c attach to card #0 ok [client=(tuner unset), addr=61]
cx25840 1-0044: cx25843-23 found @ 0x88 (ivtv i2c driver #0)
cx25840 1-0044: loaded v4l-cx25840.fw firmware (14264 bytes)
ivtv0: i2c attach to card #0 ok [client=cx25840, addr=44]
wm8775 1-001b: chip found @ 0x36 (ivtv i2c driver #0)
ivtv0: i2c attach to card #0 ok [client=wm8775, addr=1b]
tda9887 1-0043: (ivtv) chip found @ 0x86 (ivtv i2c driver #0)
ivtv0: i2c attach to card #0 ok [client=tda9887, addr=43]
ivtv0: Detected a TEA5767 radio tuner. Enabling radio support.
ivtv0: loaded v4l-cx2341x-enc.fw firmware (262144 bytes)
ivtv0: Encoder revision: 0x02050032
ivtv0: Allocate DMA encoder MPEG stream: 128 x 32768 buffers (4096KB total)
ivtv0: Allocate DMA encoder YUV stream: 194 x 10800 buffers (2048KB total)
ivtv0: Allocate DMA encoder VBI stream: 120 x 17472 buffers (2048KB total)
ivtv0: Allocate DMA encoder PCM audio stream: 455 x 4608 buffers (2048KB total)
ivtv0: Create encoder radio stream
tuner: type set to 57 (Philips FQ1236A MK4) by ivtv i2c driver #0
cx25840 1-0044: 0x0000 is not a valid video input!
ivtv0: Initialized WinTV PVR 500 (unit #1), card #0
ivtv: ====================== NEXT CARD ======================
ivtv1: Autodetected WinTV PVR 150 card (cx23416 based)
ACPI: PCI Interrupt 0000:02:09.0[A] -> Link [LNKC] -> GSI 10 (level, low) -> IRQ 10
ivtv1: Unreasonably low latency timer, setting to 64 (was 32)
tveeprom: Second (radio) tuner idx 101
tveeprom: ivtv version
tveeprom: Hauppauge: model = 23552, rev = D492, serial# = 9492586
tveeprom: tuner = Philips FQ1236A MK4 (idx = 92, type = 57)
tveeprom: tuner fmt = NTSC(M) (eeprom = 0x08, v4l2 = 0x00001000)
tveeprom: audio processor = CX25843 (type = 25)
tveeprom: decoder processor = CX25843 (type = 1e)
ivtv1: i2c attach to card #1 ok [client=tveeprom, addr=50]
tuner (ivtv): chip found at addr 0xc2 i2c-bus ivtv i2c driver #1
ivtv1: i2c attach to card #1 ok [client=(tuner unset), addr=61]
cx25840 2-0044: cx25843-23 found @ 0x88 (ivtv i2c driver #1)
cx25840 2-0044: loaded v4l-cx25840.fw firmware (14264 bytes)
ivtv1: i2c attach to card #1 ok [client=cx25840, addr=44]
wm8775 2-001b: chip found @ 0x36 (ivtv i2c driver #1)
ivtv1: i2c attach to card #1 ok [client=wm8775, addr=1b]
tda9887 2-0043: (ivtv) chip found @ 0x86 (ivtv i2c driver #1)
ivtv1: i2c attach to card #1 ok [client=tda9887, addr=43]
ivtv1: This is the second unit of a PVR500
ivtv1: Correcting tveeprom data: no radio present on second unit
ivtv1: loaded v4l-cx2341x-enc.fw firmware (262144 bytes)
ivtv1: Encoder revision: 0x02050032
ivtv1: Allocate DMA encoder MPEG stream: 128 x 32768 buffers (4096KB total)
ivtv1: Allocate DMA encoder YUV stream: 194 x 10800 buffers (2048KB total)
ivtv1: Allocate DMA encoder VBI stream: 120 x 17472 buffers (2048KB total)
ivtv1: Allocate DMA encoder PCM audio stream: 455 x 4608 buffers (2048KB total)
tuner: type set to 57 (Philips FQ1236A MK4) by ivtv i2c driver #1
cx25840 2-0044: 0x0000 is not a valid video input!
ivtv1: Initialized WinTV PVR 500 (unit #2), card #1
ivtv: ==================== END INIT IVTV ====================


Tune a channel and get an mpeg stream:

ivtvctl -c 2
cat /dev/video0 > test.mpg


Plays back in xine with no problem. Nice quality, too, but no de-interlace. We'll get to that, if needed.

MythTV recognizes the card no problem at all. Sweet! I programmed two shows in parallel, and they were recorded just fine. This is GREAT.

Friday, April 21, 2006

Joschka Fischer

I went to a talk by Joschka Fischer today. I was really curious about seeing the man that took the oath for German foreign minister in jeans and sneakers. As you can see these days he dresses a little bit more conservative. He had nice words for the audience, "you remind me more of university, than a successful tech company."

Either way, it was very interesting. He gave a quick introduction on his history in the German government, his positions on a variety of issues ranging from a nuclear Iran, the Iraq war, the rise of China and India, over global warming to renewable energies. He cautioned, "I'm not an expert on Internet technologies, but I am for foreign relations and issues affecting the environment." Then he opened it up for questions. A lot of issues were covered in detail, particularly the nuclear program in Iran, Fischer's fear of an arms race in the Middle East and the impact on the region, if Iran were to acquire the bomb. Scary stuff. He disagreed several times on various subjects with the policies set in Washington, DC, and had very harsh words about the Iraq war, "bad idea, poorly planned, bad execution". He outright dismissed claims by the Iranian government that their nuclear program is for civilian use, "Why do they need a closed fuel cycle? Why highly enriched Uranium? The Iranian program looks very similar to the existing Indian and Pakistani programs." Airstrikes on iranian nuclear facilities "with very high likelyhood are not going to be sufficient to destroy the program". And then there is Israel, and the rethoric of the Iranian government. Fischer managed to explain these issues concisely in terms and ways that were easy to follow and even though I'm following the news from the region, it was nice to have all the issues presented together and how they interact.

On renewable energies he considered a program started by the SPD/Greens government an economic success, "Germany is a leader in the field of solar technologies now, as well as wind energy". He talked about how all humans have the same right to fulfill their dreams as everyone in the industrialized nations.

"The developed world can't tell countries like China or India to cut back when their people are trying to go after their dreams", and then looped it back to renewable energies and cooperative world politic as the only solution for long-term prosperity. "In Europe war was the driver of change. My father went to war, my grand-father did, and his father did. War is terrible, but it's also change. You burry the dead, attend to the wounded, and then rebuild. You know where to spend the money and concentrate your efforts on the build-up. However, with the weapons available in the 21st century and the way the world-economy is interconnected, war is no longer an appropriate way to deal with the problems. "Diplomacy and cooperation between countries is the only way."

Immigration and the expansion of the European Union came up as well, particularly admitting Turkey into the EU. Fisher felt compelled to explain to his american audience (which by rough observation consisted of about 2/3 non-Americans, half of them Germans) what such a move would mean, "imagine Mexico, the Central American countries, as well as Columbia, in talks with the US to join the union. Think about the uproar this would create, what people would say".
Fischer compared immigration policy in the US to the Europe. A fairly open policy as it exists in the US would never work in countries like Germany. He explained that with the difference in attitude towards the poor. "The poor in the US are basically ignored and forgotten. If European countries had such a substantial amount of poor people as the US, they would quickly organize into a group with extremist tendencies (left or right) that could not be ignored by the government". This reminds me of the riots in France a couple months ago. It is already happening there. Probably just a matter of time until it happens in Germany.

Overall, I'm very happy I had the chance to listen to Joschka Fischer and meet him in person. This was not as impressive as seeing Michail Gorbatshev last year (or shaking his hand). However, Fischer was much more intellectually stimulating.

Shortly after the talk, the building began to rumble and shake. I went outside and saw 3 Blackhawk helicopters fly by accompanying this rather big military transport helicopter. Oh yes, President Bush is in town today, Airforce One was parked at Moffet Field, Bush probably was on his way to an invited guests only event somewhere on the Peninsula to dispense his usual nonsense. The contrast couldn't have been stronger.

Thursday, April 20, 2006

Hauppauge PVR-500

The new capture card is on its way. The PVR-500 has dual-tuner support (so we can record both Lost and Bones at the same time). It has hardware MPEG2 encoders, and is supposed to be fully supported by MythTV. This will be nice... I hope.

apcupsd

Rebuild the OpenBSD kernel, exclude uhiddev, ums, wsmouse, wskbd, ukbd, uhid, include ugen. install kernel and reboot.

Follow the instructions in the manual at www.apcupsd.org. Very straightforward:


./configure --enable-usb --with-upstype=usb --with-upscable=usb --prefix=/usr/local --with-cgi-bin=/var/www/cgi-bin/ --enable-cgi --with-css-dir=/var/www/htdocs/local/css --with-log-dir=/var/log/apcupsd
make
sudo make install


Don't turn on pthreads support. Bad idea on OpenBSD.

I went through the testing steps just up to the simulated shutdown. Nice:


Thu Apr 20 23:08:57 PDT 2006 apcupsd 3.12.2 (18 January 2006) openbsd startup succeeded
Thu Apr 20 23:14:16 PDT 2006 Communications with UPS lost.
Thu Apr 20 23:14:28 PDT 2006 Communications with UPS restored.
Thu Apr 20 23:16:29 PDT 2006 Power failure.
Thu Apr 20 23:16:35 PDT 2006 Running on UPS batteries.
Thu Apr 20 23:16:53 PDT 2006 Mains returned. No longer on UPS batteries.
Thu Apr 20 23:16:53 PDT 2006 Power is back. UPS running on mains.


Works like a charm so far.

Monday, April 17, 2006

One time too often...

... did Patricia blow the fuse on the circuit that powers the computers downstairs with the vacuum.

I got a APC BackUPS 900 RS at Central. It's supported by NUT using the hidups driver. And as I read more documentation I realize the hidups driver is for Linux only, OpenBSD ports only have NUT 2.0.0 and the generic newhidups is not built by default. Yay, let's build NUT 2.0.3 ourselves using the settings from the OpenBSD package.


./configure --sysconfdir=/etc/nut --datadir=/usr/local/share/ups --with-statepath=/var/db/nut --with-user=_ups --with-ssl --enable-strip --with-cgi --with-cgipath=/var/www/cgi-bin/nut '--with-gd-libs=-L/usr/local/lib -lgd -lpng -lz -ljpeg -lttf -lm' --with-gd-includes=-I/usr/local/include --prefix=/usr/local


Hmmm, that works, but doesn't build the newhidups driver. Appending --drivers=newhidups yields


gcc -I../include -O -Wall -Wsign-compare -s -c newhidups.c
In file included from newhidups.c:25:
libhid.h:35:17: usb.h: No such file or directory


Uh oh, trouble ahead. Revisions since 2.0.0 mostly deal with newhidups. Is this not working on OpenBSD? Great.

apcupsd to the rescue: This page explicitly mentions the BackUPS RS series. This requires a kernel rebuild and I will loose my USB keyboard. Sub-optimal, but I can live with that. Ok. It's late enough to go to bed now. I try this some other evening.

Wednesday, April 12, 2006

capture card

I have a KWorld/V-Stream TV883DVR-Pro which I picked up at Fry's last year. So far used it only for straight video in from the camera. For MythTV I need the tuner working.

Installed Debian, switched to testing, got kernel 2.6.15 and the v4l-dvb snapshot from 01162006.
Added a new card definition based on my experiments from last year and a little bit wiggle here and there:


[CX88_BOARD_VSTREAM_883_DVRPRO_TV] = {
.name = "V-Stream 883DVR Pro TV",
.tuner_type = 39,
.radio_type = UNSET,
.tda9887_conf = TDA9887_PRESENT,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.blackbird = 1,
.input = {{
.type = CX88_VMUX_TELEVISION,
.vmux = 0,
.gpio0 = 0x000004ff,
},{
.type = CX88_VMUX_COMPOSITE1,
.vmux = 1,
.gpio0 = 0x000007fa,
},{
.type = CX88_VMUX_SVIDEO,
.vmux = 2,
.gpio0 = 0x000007fa,
},{
.type = CX88_VMUX_CABLE,
.vmux = 3,
.gpio0 = 0x000007f8,
}},
},


I'm not sure if this is really a blackbird card, but it sure would be nice. The colors in tvtime are not 100% right yet, but it's much better than my experiments with the video4linux snapshot last year.

The card is working great with tvtime. No sound, though. However, in MythTV I can't get video buffers filled. whatever that means: "NVP: Timed out waiting for free video buffers." *sigh* It's getting late...

Update:
Looks like my card doesn't have a hardware MPEG2 encoder. Too bad.

Monday, April 10, 2006

MythTV?

Let's get this MythTV thing set up on grumpy and see how far I'm getting. I'm hoping I can get the MPEG2 encoder in my CX88 card up and running.

Some links:
Linux TV CX88 Wiki
mythtv.org

Add the following to /etc/apt/sources.list:


deb-src ftp://ftp.nerim.net/debian-marillat/ etch main
deb ftp://ftp.nerim.net/debian-marillat/ etch main


Following simple instructions...


apt-get install mythtv

Thursday, April 06, 2006

The Replay is dead!

Our ReplayTV 5080 is stuck at the "Please wait..." screen. Internet research indicates this means the OS image can't be read from the hard drive. Great. There are still 3 episodes of Prision Break on that hard drive that we need to watch...

l9ter's ReplayTV Upgrade Site was very helpful in finding a new software image. RTVPatch is a program to copy the image to a new hard drive. Just running RTVPatch on my Debian 3.1 system doesn't list any hard drives.

Update:
It's not the drive. I re-imaged to another drive after booting from the live CD from the rtvpatch site. Put that back into the ReplayTV, no dice. I noticed a LOT of dust in the cooling vents of the ReplayTV, so looks like we fried some part of the motherboard. Great.

On the upside, I was playing with MythTV over the weekend. My CX88 based capture card was at least partially recognized. I used it for capturing video via line-in from our camera for quite some time, but never bothered setting up the tuner. I'm going to put Debian 3.1 stable with the latest kernel in this box and see if the card gets recognized better. According to the cvs log there were lots of CX88 related V4L fixes in the last year. Also have to take a close look at my card, might be lucky and have a blackbird design in there. I seem to remember that this card is supposed to be able to do MPEG2 capture.

... and it would be kinda cool to play with MythTV more.

Update:
The drive is at least partially bad, when I tried to get the recorded episodes off the video partition, the whole system hung eventually.

Wednesday, April 05, 2006