The Shoes of the Fisherman's Wife Are Some Jive-Ass Slippers

tpot (at) frungy . org

rss

2005
Months
Mar

Sun, 27 Mar 2005

Installing MythTV using a DVICO Fusion HDTV DVB-T

The in-kernel DVB drivers work a treat for the DVICO card:

bt878: AUDIO driver version 0.0.0 loaded
bt878: Bt878 AUDIO function found (0).
ACPI: PCI interrupt 0000:00:0d.1[A] -> GSI 9 (level, low) -> IRQ 9
bt878(0): Bt878 (rev 17) at 00:0d.1, irq: 9, latency: 32, memory: 0xd6800000
DVB: registering new adapter (bttv0).
DVB: registering frontend 0 (Zarlink MT352 DVB-T)...

The trick is to do a rmmod snd_bt87x and then a insmod dvb_bt8xx as the standard ordering misdetects the card as bttv0 (analog?).

Jani Talikka has written a funky guide on installing MythTV and configuring it for a DVICO Fusion DVB-T card. The section on installing and fixing the tv_grab_au package was very timely as I was just stuck at that point. There are stacks of missing dependencies - the various XMLTV packages and various perl modules.

I needed to s/askQuestion/ask_choice/g on /usr/local/bin/tv_grab_au to get it to actually work, then follow Jani directions for manually adding channels as scanning for them does not work. More research required to get the XMLTV part of myth working correctly.

I managed to crash the Z400 though. If you send it a HTTP header that does not contain a colon the unit reboots instantly.

posted at: 14:26 | path: /pvr | permanent link to this entry

Fri, 25 Mar 2005

Installing DVB-T Card

I'm just waiting for a 2.6.11 kernel to compile. This is supposed to have support for the FusionHDTV card. The current kernel that comes with Ubuntu (2.6.8 apparently) doesn't qute know what the card is:

Linux video capture interface: v1.00
bttv: driver version 0.9.15 loaded
bttv: using 8 buffers with 2080k (520 pages) each for capture
bttv: Bt8xx card found (0).
PCI: Found IRQ 9 for device 0000:00:0d.0
PCI: Sharing IRQ 9 with 0000:00:04.2
PCI: Sharing IRQ 9 with 0000:00:04.3
PCI: Sharing IRQ 9 with 0000:00:09.0
PCI: Sharing IRQ 9 with 0000:00:0d.1
bttv0: Bt878 (rev 17) at 0000:00:0d.0, irq: 9, latency: 32, mmio: 0xd7000000
bttv0: subsystem: 18ac:db10 (UNKNOWN)
please mail id, board name and the correct card= insmod option to kraxel@bytesex.org
bttv0: using:  *** UNKNOWN/GENERIC ***  [card=0,autodetected]
bttv0: gpio: en=00000000, out=00000000 in=00ffffff [init]
bttv0: using tuner=-1
bttv0: i2c: checking for MSP34xx @ 0x80... not found
bttv0: i2c: checking for TDA9875 @ 0xb0... not found
bttv0: i2c: checking for TDA7432 @ 0x8a... not found
bttv0: registered device video0
bttv0: registered device vbi0
bt878: AUDIO driver version 0.0.0 loaded
bt878: Bt878 AUDIO function found (0).
PCI: Found IRQ 9 for device 0000:00:0d.1
PCI: Sharing IRQ 9 with 0000:00:04.2
PCI: Sharing IRQ 9 with 0000:00:04.3
PCI: Sharing IRQ 9 with 0000:00:09.0
PCI: Sharing IRQ 9 with 0000:00:0d.0
bt878(0): Bt878 (rev 17) at 00:0d.1, irq: 9, latency: 32, memory: 0xd6800000

While I'm waiting for the kernel modules to compile I'm installing mythtv. It comes nicely packaged into several packages, notably a frontend and backend. Ubuntu is really very nice, although the backspace key in firefox doesn't seem to work at all.

Martin Smith has written a MythTV DVB Setup Guide which I probably should read. I also need to rummage around in the garage and find a spare interior antenna to connect up to the DVB-T card.

On the Canberra PVR scene, two of my friends have taken slightly different approaches. Dave B has bought an Xbox to run Xbox Media Center and Dean has a Mac mini to play shows recorded using an analog tuner card. Who's cusine will reign supreme?

posted at: 19:44 | path: /pvr | permanent link to this entry

Tue, 15 Mar 2005

DVB-T Card

I bought a DViCO FusionHDTV DVB-T Lite card last week for my PVR project. It allegedly supports SD and HD broadcasts in Australia. There's even a Linux driver written by someone at the University of Queensland. He is supposed to have written the driver using a copy of RegSpy and a multimeter. I am wondering what the multimeter would be used for.

It really does look like the ultimate "budget" card for a PVR box. There's only two two connectors on the rear - antenna in and antenna out/passthrough. Other DVB-T cards have a S-Video or composite input to digitise the output of a VCR or video camera. For a HDTV streaming server, this isn't required.

On the media server front, I have been writing some Python classes to represent the structure of the UPnP ContentDirectory service and routines to generate DIDL-Lite XML to send to the Z400. The exact layout is probably device-specific, but using my cdsclient script the top level folder of the Zensonic Media Server looks like this:

<container id="0\Movie\" parentID="0\" restricted="0" searchable="0" childCount="0">
  <dc:title>Movie</dc:title>
  <upnp:class>object.container</upnp:class>
  <dc:creator></dc:creator>
</container>
<container id="0\Music\" parentID="0\" restricted="0" searchable="0" childCount="0">
  <dc:title>Music</dc:title>
  <upnp:class>object.container</upnp:class>
  <dc:creator></dc:creator>
</container>
<container id="0\Photo\" parentID="0\" restricted="0" searchable="0" childCount="0">
  <dc:title>Photo</dc:title>
  <upnp:class>object.container</upnp:class>
  <dc:creator></dc:creator>
</container>
<container id="0\OnlineMedia\" parentID="0\" restricted="0" searchable="0" childCount="0">
  <dc:title>OnlineMedia</dc:title>
  <upnp:class>object.container</upnp:class>
  <dc:creator></dc:creator>
</container>

Hopefully I can have have a bare-bones server that mimics this layout working fairly soon.

posted at: 13:33 | path: /pvr | permanent link to this entry

Mon, 07 Mar 2005

More On Test Driven Development

Noel Llopis has some nice introductory blog articles on test driven development as it applies to writing computer games: part1 and part2. Bonus marks for also mentioning scons.

posted at: 12:27 | path: /computers/testing | permanent link to this entry

New Z400 Firmware

A new version of the firmware has been released. It also includes a new version of the Zensonic Media Server.

From the release notes:

- Improved Xvid Jitter problem.
- Improve DVB MPEG2 compatibility.
   - File size limit (upgrade from 2G to 4G)
   - Some files that didn't play at all will now play
- Increased maximum image size limit beyond 6 megapixels.
- BUG fixed: CPU utilisation on media server goes to 100% for no reason.
- BUG fixed: Folders with large numbers of files show "Unable to open folder" error

The file size limit is a bit of a worry. 4GB is about four hours of viewing on the Tivo (digitised analog). I would guess that it's a bit less than that for SD and a lot less for HD recordings.

From the forum replies there still seems to be some issues with using the Z400 over wireless.

posted at: 11:39 | path: /pvr | permanent link to this entry

Sat, 05 Mar 2005

SOAP Client

I've been poking around at the Windows software that comes with the Z400 - the Zensonic Media Server. I was hoping talking to it would be as easy as using the Twisted Python SOAP client but unfortunately that has turned out not to be the case

As far as I can work out, the ZMS has troubles if the Content-Length header is not correct or within a certain range of the HTTP payload length. Also, it craps out if line endings aren't in DOS format (i.e \r\n instead of just \n). I don't know whether this is because the UPnP specification says so, or just by accident. Either way I'll have to figure out how to modify the twisted SOAP client to do what I want.

The next step in my plan is to write some UPnP client tools to make SOAP requests to the ContentDirectory:1 and ConnectionManager:1 services. This should be really useful for working out what the ZMS returns and comparing it with what my media server does.

posted at: 11:59 | path: /pvr | permanent link to this entry

Tue, 01 Mar 2005

ElementTree

It seems everyone but me has heard of effbot's ElementTree module. It's a lovely little Python module that is "Designed to store hierachical data structures, such as simplified XML infosets, in memory".

Normally I would use the Python XML modules that come with the Python distribution, but ElementTree is just so much nicer. Here's some code to generate the return value for the Z400 browsing the list of internet radio stations:

#!/usr/bin/python

import urllib
from elementtree.ElementTree import Element, SubElement, dump

root = Element('DIDL-Lite')

root.attrib['xmlns'] = 'urn:schemas-upnp-org:metadata-1-0/DIDL-Lite'
root.attrib['xmlns:dc'] = 'http://purl.org/dc/elements/1.1/'
root.attrib['xmlns:upnp'] = 'urn:schemas-upnp-org:metadata-1-0/upnp'

ctr = SubElement(root, 'container')

ctr.attrib['id'] = urllib.quote('0\OnlineMedia\Internet radio\' \
        'Total Country 103 - The Internet\'s NEW Country LEADER ' \
        '(High Bandwidth).pls\\')
ctr.attrib['parentID'] = urllib.quote('0\OnlineMedia\Internet radio\\')
ctr.attrib['restricted'] = '0'
ctr.attrib['searchable'] = '0'
ctr.attrib['childCount'] = '3'

SubElement(ctr, 'dc:title').text = urllib.quote(
        'Total Country 103 - The Internet\'s NEW Country LEADER (High Bandwidth)')

SubElement(ctr, 'upnp:class').text = 'object.container.playlistContainer'
SubElement(ctr, 'dc:creator')
SubElement(ctr, 'res', protocolInfo = 'http-get:*:audio/x-scpls:*',
           size = '480').text = \
        'urllib.quote('http://192.168.1.101:5643/web/' \
        'C:\Program Files\Zensonic Media Server\RadioList\Total Country 103' \
        '- The Internet\'s NEW Country LEADER (High Bandwidth).pls')

dump(root)

I like the way there is no actual mention of anything related to XML. It's all just assigning values to a Python data structure. The program above produces the following disgusting output:

<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite" xmlns:d
c="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:
metadata-1-0/upnp"><container childCount="3" id="0%5COnlineMedia%5CInt
ernet%20radio%5CTotal%20Country%20103%20-%20The%20Internet%27s%20NEW%2
0Country%20LEADER%20%28High%20Bandwidth%29.pls%5C" parentID="0%5COnlin
eMedia%5CInternet%20radio%5C" restricted="0" searchable="0"><dc:title>
Total%20Country%20103%20-%20The%20Internet%27s%20NEW%20Country%20LEADE
R%20%28High%20Bandwidth%29</dc:title><upnp:class>object.container.play
listContainer</upnp:class><dc:creator /><res protocolInfo="http-get:*:
audio/x-scpls:*" size="480">http%3A//192.168.1.101%3A5643/web/C%3A%5CP
rogram%20Files%5CZensonic%20Media%20Server%5CRadioList%5CTotal%20Count
ry%20103%20-%20The%20Internet%27s%20NEW%20Country%20LEADER%20%28High%2
0Bandwidth%29.pls</res></container></DIDL-Lite>

This is then used as as the value of an XML text node after being passed through another level of quoting. (XML encapsulated within XML - WTF were they thinking??). After that the UPnP playback device should have enough information to fetch the .pls file and start streaming audio data.

BTW this XML is documented in the ContentDirectory:1 Service Template Version 1.01, Appendix A.

posted at: 21:51 | path: /pvr | permanent link to this entry