Wednesday, August 23, 2006

I installed a new kernel on one of my ubuntu machines, and then I shut it down, and installed the DViCO FusionHDTV DVB-T Lite I've borrowed at the moment.

When I booted it back up, the kernel detected it, but /dev/dvb didn't exist.

(I reconfigured vmware, with a kernel module for the new kernel at this point).


[4294701.717000] Linux video capture interface: v2.00
[4294701.758000] bttv: driver version 0.9.16 loaded
[4294701.758000] bttv: using 8 buffers with 2080k (520 pages) each for capture
[4294701.762000] bttv: Bt8xx card found (0).
[4294701.762000] ACPI: PCI Interrupt 0000:01:08.0[A] -> Link [APC3] -> GSI 18 (level, high) -> IRQ 18
[4294701.762000] bttv0: Bt878 (rev 17) at 0000:01:08.0, irq: 18, latency: 32, mmio: 0xd8000000
[4294701.762000] bttv0: detected: DViCO FusionHDTV DVB-T Lite [card=128], PCI subsystem ID is 18ac:db10
[4294701.762000] bttv0: using: DViCO FusionHDTV DVB-T Lite [card=128,autodetected]
[4294701.762000] bttv0: gpio: en=00000000, out=00000000 in=00ffffff [init]
[4294701.776000] bttv0: using tuner=-1
[4294701.779000] bttv0: add subdevice "dvb0"
[4294701.887000] bt878: AUDIO driver version 0.0.0 loaded
[4294701.891000] bt878: Bt878 AUDIO function found (0).
[4294701.891000] bt878_probe: card id=[0xdb1018ac],[ DViCO FusionHDTV DVB-T Lite ] has DVB functions.
[4294701.891000] bt878(0): Bt878 (rev 17) at 01:08.1, irq: 18, latency: 32, memory: 0xd8001000


I followed the instructions here:

apt-get installed the necessary packages, then hg cloned the v4l source. I compiled it all, and loaded all of the kernel modules with make load, which ended up creating 4 adapters in /dev/dvb.

I only have the one, and it's not a dual tuner or anything, so obviously dummy adapters had been created, for devices I don't have.

I rebooted the machine, but again, didn't have /dev/dvb.

I manually loaded the module I need, for the DVB-T Lite:

sudo modprobe dvb-bt8xx


dmesg said:

[4295222.076000] DVB: registering new adapter (bttv0).
[4295222.092000] DVB: registering frontend 0 (Zarlink MT352 DVB-T)...


and /dev/dvb/adapter0 existed.

I then installed mysql (apt-get install mysql-server).

When I went to install mythtv, I discovered that it wasn't in the package list for some reason.

A bit of googling, and I found this page. Apparently mythtv is broken against dapper at the moment anyway.

I added "deb http://knm.org/mythdebs/ binary/" to my sources.list, and updated apt.

Now there was a bunch of myth packages. I tried installing mythtv, and mythtv-frontend and mythtv-backend, but I ended up with stacks of dependency issues.

At this point, I realised I was a dope.. I was running breezy on that machine, not dapper, and the myth packages on knm.org are for dapper.

I looked a bit harder, I had to add multiverse repositories to sources.list. (I removed the knm source). I updated apt again, the myth packages were available.

I then used apt to install mythtv, and it worked out for itself that it needed backend, frontend etc.

Once it was all installed, I set the mythtv user's password, logged in as them, ran a vncserver as them, and connected to it. I ran mythtv-setup.

I went through and configured the basic stuff as before. It segfaulted when it went back to the main menu, after configuring the general settings. Hmm. It wrote the settings I changed though.

I configured the card as a video source, and then setup the program data source. This caused issues, because I didn't have a tv_grab_au script.

I grabbed the one that uses the oztivo guide server this time, from here.

I installed that, but was having issues trying to get it to generate a config file.

I reconfigured the source in myth, and got a bit further, it generated the config file.

I edited the file, and added in my username and password for the guide server, and some channels, though I just guessed the names, because I couldn't be bothered to check them.

I ran the mythfilldb script, but tv_grab_au crashes, with something about an invalid token.

It turns out that there's something about the config file that it generated, that doesn't work. I removed all the comments, and made a basic config file, just containing the login details, and channels to use, and it worked.

It downloaded the guide data, and created the channels. However trying to watch TV still doesn't work, fails with errors about "PIDs not set".

I installed mythweb, and looked, to see that there are no sources defined for the channels. Even after scanning the channels, in the setup, which found and created more channels, there are still no PIDs.

Tuesday, August 22, 2006

I had issues with setting the time on my debian box, using ntpdate the other day.

I decided to dist upgrade the box, I don't really know why, since it meant downloading 100M of data, and I still couldn't set the time.

Afterward, I noticed that I couldn't use IMAP from my laptop to that box anymore. Argh.

I knew what I'd done.. the dist upgrade would have updated imapd, and the standard imapd that's in Debian Etch doesn't support plain text authentication.

When I first rebuilt that box, from Woody, or whatever it had on it before, and installed IMAP, I discovered that problem. For hours, I tried to work out what I could do, either on the client (thunderbird) or the server, to get them to talk to each other.

Secure Authentication didn't work, and using IMAP over SSL didn't work, in desperation, I connected up the old Woody disk, and grabbed the imapd binary off it, and replaced the standard Etch imapd binary.

This worked fine, I had my plain text auth back, and I didn't worry about it.

I'd forgotten about doing that though, and quite sillyly, I hadn't symlinked imapd to the old binary, I'd replaced it, so when I dist upgraded, it replaced it again, and I don't have that old binary anywhere.

It'd be on the old Woody disk still, but I don't know where that is.

I figured I'd have to get some proper secure connection working.

First I tried setting "Use Secure Authentication" in Thunderbird, but that just told me that "The server does not support it. Disable it to use the server".

I didn't bother to try connecting over SSL on port 993, because I knew I hadn't configured imapd to listen on that port.

I googled around, but couldn't find anything particularly useful, in regards to setting up Secure Authentication.

With a tip, I went looking around the filesystem, and found /usr/lib/ssl/certs/imapd.pem, which contained a public key and an SSL certificate.

I googled "imapd.pem", and found this page, which was quite useful.

I already had most of the stuff done, openssl installed, new imapd, certificate generated etc. I had to work out what was still to be done.

I couldn't find a config file for imapd anywhere, I noticed the lines were already in the inetd.conf, specifying imaps, running on 993.

I switched Thunderbird to "Use secure connection (SSL)", and then tried to access my mail.

This time, unlike a year ago, or whenever I rebuilt the box, it came up and told me that the server wanted to create a secure connection, and send a certificate. It's just a self signed certificate that it must have created as part of the post install of the upgraded impad, I didn't bother to generate one, since it would just be self signed anyway..

I accepted the certificate, and then it prompted for my password. I gave it my password, and it connected. Hmm.

I don't know what the problem was last time then, I'm wondering if it was some sort of issue with inetd, that the imaps daemon didn't start, since I think I was getting connection refused errors, but that was at least a year ago, I don't really remember.

Monday, August 07, 2006

OK, so here's attempt 2 at configuring mythtv. I managed to find some documentation, surprisingly, at http://www.mythtv.org/docs, the bit I was interested in here.

However, before running myth-setup again, there's a few bits and pieces I had to do, mainly setting up the guide data feed etc. I found this page.

(Considering the nvidia driver install was mentioned as part of that documentation, maybe I should try reading the rest of it).

I downloaded tv_grab_au. I'm not sure if it's the one I want to use, because I know there's one that's been modified to work against the oztivo guide database, which I'd prefer to use.

I had some issues with sudo as the mythtv user, it would accept the password, but then not do anything.

Without tv_grab_au in place still, I ran the mythtv-setup again, and followed the instructions in the proper docs.

When it got to calling tv_grab_au, I got an error, as expected, but this happened before, and myth still sort of worked.

I would have been unable to configure it through vnc anyway, since I can't pass the alt+tab through vnc to switch to the terminal.

I discovered the sudo issue was because I hadn't added the mythtv user to the admin group, so it wasn't allowed to use sudo. I added mythtv to the admin group.

After that I installed xmltv (and the few other dependencies). I then went through and installed tv_grab_au as per the instructions.

I couldn't get a channel list though, because ~/.mythtv was empty, it didn't contain a file for me to link as the xmltv.conf file, and when I tried to list the channels, I got "ERROR: can't find DataSet for NSWReg - freesd".

A bit of googling, apparently d1 don't generate a full weeks worth of data everyday, and that's the problem. Apparently if I run it tomorrow it will work. Hmm. I might try to find doco on using the oztivo guide server instead.

It also could be because "d1.com.au does not yet have programs for the SD or HD Digital broadcasts for most of the regional areas.", so I should have entered the analogue source.

I went back, and redid the video source, with the analogue source, and got some channels. I then had to create the channels manually, and the screens don't match the documentation, so I don't know what to do there.

I created 1 channel manually, tried to watch tv, but now, instead of the static I got last night, I now get nothing.

I give up for now, maybe attempt 3 will be tomorrow.

I setup an Ubuntu machine for a mate from work.

Installing was no problem, I partitioned the disk, setup the files, rebooted and it was all working (after discovering the BIOS was set to only boot from the DVD drive, and fixing that).

I then downloaded VMWare server, cool that it's now free, installed that, requiring the installation of make, gcc, and a few other bits and pieces.

I installed windows in that, and it was all working. That was all basic stuff that I've done before, so nothing was a hassle there.

After that, I decided to get the TV tuner card working, a "Fusion HDTV DVB-T Hybrid" (see it here).

I saw that the kernel was trying to load a driver for it (CX88), but it didn't recognise the card.

I did a bit of googling, and found a few useful pages, here, here, here, and here.

I decided that installing the proper nvidia driver would probably be a good idea to start. I ended up here, click on "IA32, latest version", and downloaded this (link will probably change, since the version is in it).

I then had to switch to a VT, stop GDM, make the download executable, and run it (as root). It went through, claimed to be building, compiling, installing etc.

I allowed it to modify the Xorg config file, tried to restart X, and found that it wouldn't work, the nvidia module hadn't been compiled.

I fiddled around for a bit, even tried rebooting, in case there was a kernel module that needed loading, but it didn't help, and then switched the original config file back, using the free nv driver.

I did a bit more googling, found that I might need the Xorg dev packages, so I installed those, and also the kernel source, and then went about reinstalling the driver package.

This time it worked, and X started up properly. The next morning however, when I booted the machine up, X wouldn't start. I had to manually unload and reload the kernel module, and then X started. I need to work out what's going on there.

I then went on to getting the TV card supported.

Following the instructions here, I downloaded the latest v4l source:

hg clone http://linuxtv.org/hg/v4l-dvb (after installing the required packages).

I then compiled that (make), which complained about mismatching kernel versions a bit, some of the software requires 2.6.16, and I was only running 2.6.15, but it still compiled. I installed it (make install), and after a reboot, it had loaded, and the card was supported, /dev/dvb/adapter0 existed, good.

I installed mysql, which I'd read mythtv required, and then installed mythtv. It came up and wanted the mysql password, which I hadn't set, so entered nothing, and it told me I had to run mythtv-setup as the mythtv user.

I fiddled around with the X persmissions (xhost +), switched to the mythtv user in a terminal (sudo su - mythtv), and then tried to run mythtv-setup, but it couldn't talk to X.

I set the display variable (export DISPLAY=:0) and then it was fine, and mythtv-setup ran.

Now I had no idea what I was doing. I hadn't read any install/config documentation.

I fuddled my way through, setting up things I thought should be set, and then got out of the setup. I hadn't set it all up properly though, because I had no guide data (tv_grab_au was missing).

I then worked out to start myth-backend, and then myth-frontend, and I tried to watch tv. It was a start, the screen filled with static.

I had no channels, and no tuning, but at least the tv card was giving a signal.

I found a page that told me I needed to "scan" the channels, but I had no scan command, hmm.

I decided to do a bit more reading, to try to work out how to tune the card, and ended up looking at this.

Ah, installing "dvb-utils" might help. I did that, and then found I had a scan command, as well as a bunch of files in /usr/share/doc/dvb-utils, example channel configs, and frequency lists.

I tried scanning a couple of the au ones, but didn't have any luck. I needed to know the local transmitter frequencies.

(In writing this blog, I found this page, which looks quite handy).

I ended up here, put in the postcode, (2320), and ended up getting a useful list of stations and frequencies. (here).

I grabbed one of the example channel lists I'd tried to scan, and edited it, replacing the frequencies with the local ones, ending up with lines like:

# ABC
T 592500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE

etc, for the 5 channels available. I rescanned, using that file, and it locked on, finding all the channels, radio channels, and generated a proper channels.conf.

I then used tzap to tune to the channels, and dvbtraffic to check that it was receiving an mpeg stream, I couldn't work out how to display it though.

I ran mythtv-setup again, and went through, thinking I could get it to source the channels.conf, but it didn't make any difference. I ran it up as before, and tried tuning the card manually, with tzap, but then realised that mythtv was sourcing from the analogue tuner.

I fiddled around in mythtv-setup again, trying to source from the digital tuner, but I couldn't work it out.

I decided to just try to work out how to test the analogue tuner. I found that mplayer can run a tv tuner card.

I installed mplayer, and after fiddling around with the parameter list a bit, found that something like:

mplayer -tv driver=v4l2:freq=79 tv://

would display somewhat of a picture. I had no idea what the analogue frequencies were, and I couldn't find a list of them anywhere, so I just randomly put things in there, 79/80 resulted in a black and white snowy picture, I'm not sure what channel it was.

At that point, I gave up. I decided I needed to do some reading, and setup mythtv properly.

Saturday, August 05, 2006

I decided to install the USB IR adapter I bought yesterday, and setup my phone.

What a pile of crap this adapter is. It came in a blue box, "USB to IRDA adapter for mobile phone users" it says on it, part number MI620.

Immediately upon taking the adapter out of the box, I noticed that the clip together nature of it wasn't very good, it was already falling apart.

I just pulled at the top a tiny bit and it came apart. The reason it felt apart is because the plastic clips are all squashed and broken, good quality manufacturing there.

I had a look in it, not much there, a couple of IR LEDS, a usb port, a chip, a crystal, not much else.

I put it back together, and then went to plug it in to my vmware machine.

Upon attempting to plug the adapter into the USB extension lead it came with, the adapter basically exploded, and the usb plug came straight off the pcb.

More poor quality manufacturing made obvious. The USB plug is supposed to clip onto the PCB, but the clips at the side weren't anywhere near squeezing onto the PCB.

I bent them in a bit, put the plug back on the PCB, resoldered it, and it was a hell of a lot better than when it was made. I clipped it all back together again, I think I'll have to superglue it together.

I carefully plugged it into the USB extension lead, made sure the vmware window was active on the pc, so that it would take control of the device when it was attached, and I plugged it in.

The 2k3 VM popped up, "new hardware found". I put the driver cd in my laptop, and copied the driver files across to the vm disk, I pointed the add hardware wizard thing at the files, and clicked through.

I didn't actually read the messages that were coming up, having installed drivers so many million times before, however this time I should have read them.

After clicking finish, a popup from the system tray said "an error occurred installing your new hardware". I checked device mangler, and it didn't show up as an extra port.

I rebooted the VM, no difference. I unplugged and replugged the adapter, and the wizard popped up again. This time I read what it was telling me.

When I told it where to get the driver from, instead of telling me it was installed, it was complaining that "a required section was not found in the inf file". Great.

I tried installing different drivers by doing it manually, installing a different version, but that just told me that the inf file wasn't "in the requested format" or something.

I decided to look for more drivers. This device seems to be based on the "Kingsun SF620" chipset, which seems like a fairly generic chipset, used in a bunch of these different adapters.

It doesn't have any linux support, bugger, there goes plan B, trying to find some phone software that runs under linux.

I managed to find a couple of other versions of the driver, apparently this chipset is also known as a "ww-600", but those drivers didn't work either, "Windows was unable to find the required software".

I also found another set of the same drivers I already from the CD that came with the device, these resulted in exactly the same errors, as expected.

I googled around, in regards to "the required section was not found in inf", and found mainly references to print drivers. I also found this page, about HP printers with the issue.

What a load of crap, it's like 50 pages of stuff to do to install the driver manually. Who the hell is going to do that?

I read through it all anyway, and found references to mucking around with inf files, restoring usb.inf, deleting infcache.1, I tried this stuff, it made no difference.

I noticed a compressed exe file with the drivers, I uncompressed it, and ran it, to see an error "error in sysdm.cpl missing entry:InstallDevice_RunDLL".

Great, so perhaps what this driver is trying to do to install doesn't work under 2k3., because M$ in their infinite wisdom have decided to change the API of the system control panel thing.

I decided to try replacing sysdm.cpl with one from another version of windows. A quick google only turned up one from NT4 SP6a, from 1999, hmm, great. I would have preferred from 2000, or XP, but we'll try this.

I downloaded that, backed up the existing sysdm.cpl, copied the NT4 one in (which asked me to overwrite one, hmm), and ran the command manually "rundll32.exe sysdm.cpl,InstallDevice_RunDLL" which resulted in the same error.

I then checked, and found that the file I had copied in wasn't the one running, it was exactly the same as the one I had backed up. Ah great, I know what's going on here, that retarded function that windows uses to replace your dlls if they get changed.

I really wish windows would just piss off and let me replace files, I know what I am doing (or at least I know better than it what I'm doing).

So now I needed to work out how to fix that, as soon as I deleted or replaced sysdm.cpl with a different one, windows just changed it back again.

I figured I could replace the one in the dllcache with the old one from NT4, and then just delete the one in system32, and windows woould retardedly replace it with the one from NT4, but alas no, it seems windows isn't as stupid as it looks.

It replaced the one in the dllcache with the "correct" (from 2k3) one (I have no idea where from), and then replaced the deleted one with the correct one.

I might just have to give in, and use the windows 98 box I built recently for recovering a hard drive, because 2000 wouldn't run as soon as the faulty disk was attached, but 98 didn't care, because it can't read ntfs.

That's real progress M$, when I have to use windows 98, because the stuff that comes out now just doesn't work.

------------

I found a webpage that detailed disabling the WFP/dllcache crap, and made the change to the registry, but then noticed that it says it requires a kernel debugger attached to the serial port. Hmm.

It also mentioned that codered used it, so perhaps it works without a debugger. After a reboot, it was still working, bugger. Codered must have done something else to disbale that check. Perhaps I should just infect the machine with codered.

I couldn't use sfc to make any changes either, telling me "You must be an administrator running a console session in order to use the Windows File Checker utility." Argh. Windows goes out of its way to annoy me.

I wrote a batch file, that deletes the 2k3 version of sysdm.cpl, copies the nt4 version in, and tests for the required function, but that didn't work. The file goes in, but as soon as I try using it, WFP replaces it.

I logged in locally, and I used SFC to change the cachesize to 0, and then purged it, thinking that might work, but again, no, the file still gets replaced, and that function still doesn't exist, though perhaps it didn't exist in NT4 either, and that's part of my problem.

I suppose I could always get some enjoyment destroying the adapter, and buying a new one that's not a complete pile of crap, and comes with some useful drivers.

------------

I even grabbed the sysdm.cpl from XP, and made my batch file load that in, but the InstallDevice_RunDLL function still didn't exist. Maybe that exe is for ME/98, and I'm wasting my time trying to get it to run on anything based on NT.

Friday, August 04, 2006

I went to the computer fair, and bought more ram for my laptop, and a USB IR adapter, so I could setup my new phone.

I got scammed on the memory, I had to buy DDR1, as opposed to 2, since it's all my laptop will support, and the DDR1 was actually more than DDR2.

I paid $180 for 1gb of DDR1, the DDR was only $155. I also bought a USB IR adapter for $19.

I wasn't sure about the memory, I was half thinking that I got scammed, told to buy DDR1 by the woman only because it cost more, however when I got to installing it, and removed the existing 256MB that was in there when I got the laptop, there's a sticker under it, saying "DDR1 ONLY" in huge letters. Hmm, nice place to put it though.

I installed the new ram, and the laptop booted up fine, said something about "the amount of system memory has changed", and then continued to boot.

My laptop seems to work a bit better, with 1280MB of ram, instead of 512MB. This is the most this laptop supports, so I'll be upgrading the laptop the next time I need more ram.