Image of grog
Greg's computer video recorder project
Greg's diary
Photo index
Greg's home page
Network link stats
Greg's other links
Copyright information
Main multimedia page
Multimedia packages page
Groogle

This page describes the fun I have had setting up a computer as a video recorder. See the main page for an overview.

Inevitably, I make mistakes. As I gain experience, I realize these mistakes; rather than just correcting the text, I prefer to leave the original statement and add a clarifying comment: if I have made a mistake, others might do the same.

Yes, this page is done in chronological order. I hate reverse chronological order. The latest entry is here.

Saturday, 18 September 2004

Started building a CVR machine. Basic hardware and software are:

Which software?

MythTV

MythTV on FreeBSD overview page
MythTV on FreeBSD download page. I chose MythTV first simply because I had found some people on IRC who use is. Installation on a virgin system proceeded like this:
  1. Install the Xorg X packaged.
  2. Unpack the MythTV tarball to /usr/ports/multimedia/mythtv/ and try to install. After a lot of dependencies, it died:
    c++ -c -pipe -Wall -W -O3 -march=pentiumpro -fomit-frame-pointer `freetype-config --cflags` -fPIC  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DPREFIX=\"/usr/local\" -DMMX -DUSING_IVTV -DUSING_XV -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/local/share/qt/mkspecs/freebsd-g++ -I.  -I/usr/local/include -I../libmyth -I..  -Idvbdev -I../libavcodec -I/usr/local/include -I/usr/X11R6/include -o RTjpegN.o RTjpegN.cpp
    RTjpegN.cpp: In member function `int RTjpeg::b2s(int16_t*, int8_t*, uint8_t)':
    RTjpegN.cpp:136: error: ISO C++ forbids cast to non-reference type used as lvalue
    RTjpegN.cpp:145: error: ISO C++ forbids cast to non-reference type used as lvalue
    RTjpegN.cpp:174: error: ISO C++ forbids cast to non-reference type used as lvalue
    RTjpegN.cpp:186: error: ISO C++ forbids cast to non-reference type used as lvalue
    RTjpegN.cpp:203: error: ISO C++ forbids cast to non-reference type used as lvalue
    RTjpegN.cpp:224: error: ISO C++ forbids cast to non-reference type used as lvalue
    RTjpegN.cpp:234: error: ISO C++ forbids cast to non-reference type used as lvalue
    RTjpegN.cpp:241: error: ISO C++ forbids cast to non-reference type used as lvalue
    *** Error code 1
    
    Stop in /src/FreeBSD/ports/multimedia/mythtv/work/mythtv-0.15/libs/libmythtv.
    *** Error code 1
    

    Looking at the code was edifying:

     /* ci must be 0 */
     if(bitoff != 6) {
    
          (uint8_t)strm[co]= bitten;
          co++;
    
     }
     goto BAUCHWEH;
    
    HERZWEH:
    

    I wonder how that ever worked. In any case, fixed it and at least got it to compile.

  3. Talking on IRC suggested that I should first install some other ports (so why aren't they dependencies?). This is when I learnt of the MythTV on FreeBSD overview page.
  4. As suggested in the FreeBSD overview page, installed MySQL server and the updated textproc/p5-xmlt ports.
  5. Return to building the MythTV port. The same problems crop up (as you'd expect). Removed the casts and tried again.
  6. Finally it builds.

Configuring

MythTV comes with a setup program called mythsetup. You'd think it is more like mysterysetup: when you run it, it creates a full-screen window which swallows the mouse cursor and which doesn't respond to most keys. In fact, you need the space bar and the cursor keys (which it sometimes uses to move in the opposite direction).

Video tuner card

I'm currently using a low-end BT 878 card, and it seems that MythTV doesn't really expect that. I'm still working on that, but the documentation suggests that any card supported by X4L (Linux) should work. That doesn't help much, of course. FreeBSD has a kld called bktr which handles these cards, and which recognizes them:
bktr_mem: memory holder loaded
bktr0: <BrookTree 878> mem 0xdddfe000-0xdddfefff irq 17 at device 6.0 on pci0
bktr0: [GIANT-LOCKED]
bktr0: Unable to allocate 1310720 bytes of memory.
bktr0: Unable to allocate 3555328 bytes of memory.
bktr0: Card has no configuration EEPROM.  Cannot determine card make.
bktr0: Pinnacle/Miro TV, Temic PAL I tuner.
The memory allocation errors look ominous.

Display card

The Xorg server recognizes the card without problems and builds a configuration file that shows only one output. Some others, noticeably Daniel O'Connor, have reported success with the Nvidia drivers, so I installed them (/usr/ports/x11/nvidia-driver). After installation, Xorg generates exactly the same configuration file as well. Reading the instructions (notably README and README.Linux) helped, and rather to my surprise, I was actually able to get it to run two displays under X after applying the following changes:
--- xorg.conf.orig      Sun Sep 19 20:48:58 2004
+++ xorg.conf   Sun Sep 19 21:27:57 2004
@@ -1,6 +1,7 @@
 Section "ServerLayout"
        Identifier     "X.org Configured"
-       Screen      0  "Screen0" 0 0
+       Screen      0  "Screen0"
+       Screen      1  "Screen1" rightOf "Screen0"
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
 EndSection
@@ -42,11 +43,21 @@
 EndSection

 Section "Monitor"
-       Identifier   "Monitor0"
+       Identifier   "Alfaskop"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
+       HorizSync    31.0 - 36.0
+       VertRefresh  50.0 - 160.0
 EndSection

+Section "Monitor"
+       Identifier   "TV"
+       VendorName   "Monitor Vendor"
+       ModelName    "Monitor Model"
+EndSection
+
+# Primary monitor for, well, monitoring.
+# Connect a low-res monitor such as the ancient alfaskop to this one.
 Section "Device"
         ### Available Driver options are:-
         ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
@@ -64,7 +75,7 @@
         #Option     "NvAGP"                    # <i>
         #Option     "IgnoreEDID"               # [<bool>]
         #Option     "NoDDC"                    # [<bool>]
-        #Option     "ConnectedMonitor"         # <str>
+        # XXX Option     "ConnectedMonitor"  "CRT, TV"         # <str>
         #Option     "ConnectedMonitors"        # <str>
         #Option     "TVStandard"               # <str>
         #Option     "TVOutFormat"              # <str>
@@ -105,17 +116,29 @@
         #Option     "XvMCUsesTextures"         # [<bool>]
         #Option     "HorizSync"                # <str>
         #Option     "VertRefresh"              # <str>
-       Identifier  "Card0"
+       Identifier  "Control"
        Driver      "nvidia"
        VendorName  "nVidia Corporation"
        BoardName   "Unknown Board"
        BusID       "PCI:1:0:0"
+       Screen          0
+EndSection
+
+# Second device: TV
+Section "Device"
+       Identifier  "Video
+       Driver      "nvidia"
+       VendorName  "nVidia Corporation"
+       BoardName   "Unknown Board"
+       BusID       "PCI:1:0:0"
+       Screen          1
 EndSection

 Section "Screen"
        Identifier "Screen0"
-       Device     "Card0"
-       Monitor    "Monitor0"
+       Device     "Control"
+       Monitor    "Alfaskop"
+       DefaultDepth 24
        SubSection "Display"
                Viewport   0 0
                Depth     1
@@ -139,6 +162,20 @@
        SubSection "Display"
                Viewport   0 0
                Depth     24
+               Modes   "640x480" "800x600"
        EndSubSection
 EndSection

+Section "Screen"
+       Identifier      "Screen1"
+       DefaultDepth 24
+       Device     "Video"
+       Monitor    "TV"
+       Option "ConnectedMonitor" "TV"
+       Option "TVStandard" "PAL-B"
+       Option "TVOverScan" "1.0"
+       SubSection "Display"
+               Depth     24
+               Modes   "800x600"
+       EndSubSection
+EndSection

Later installed mplayer on teevee. Installation went OK, but getting it to run is a different matter. As in the past, I had trouble. Display across the network is impossibly broken, and for some reason I couldn't get it to work at all on the local (monitor) display :0.0. The message was:

SwScaler: using unscaled Planar YV12 -> BGR 8-bit special converter
BGR not supported, please contact the developers
FATAL: Cannot initialize video driver.
FATAL: Could not initialize video filters (-vf) or video output (-vo).

After a fair amount of discussion on IRC, and with help from google, found out the problem: this is mplayer's inimitable way of saying “I can't use an 8 bit display”. After setting the default depth for the display to 24 bits, it worked fine. What a pain! The diffs above include setting the default bit depth (for Screen0).

Friday, 31 December 2004

Daniel O'Connor has been writing or collecting some software too. Here's his frame grabber software. It's not clear how much (if at all) he has changed it.

Friday, 25 February 2005

Spent some time trying to copy some DVDs. They had been recorded on my flaky Digitrex DVD recorder, and it couldn't play them back. I had already noticed that computers did a better job, and mplayer on FreeBSD plays them with no problems beyond its emetic user interface.

Today I decided to play them in the Apple—after all, that's what it's supposed to be good for. It's always difficult to guess what to do to play something, since there's no documentation, and obviously I don't have any “intution”, but after a while it became clear that there was no DVD player software installed on the machine. Finding out why that was so, and what to do about it, was a nightmare.

The pitiful excuse for documentation told me that it was installed automatically if the hardware was present, and how to detect if a DVD drive was connected to the machine. In the latter case, you'd expect the instructions to read “examine the drive and see what's written on it”, but instead I was taken through a maze of twisty little menus, all different, with the intention of finding whether the system thought it did in fact have a DVD player. The instructions didn't go as far as to say how you could tell, but everything seemed to indicate that the system did in fact agree that the hardware was installed.

OK, then, it should be simple enough to find the package and install it—I thought. In fact, another tiring search of the installation media showed nothing obvious; later somebody pointed out that it was in the directory "//Volumes/Mac OS X Install Disc 1/System/Installation/Packages/Essentials.pkg" (how I hate these stupid file names with spaces in them!). Tried to install that, but since I had in the meantime upgraded the system, it refused to install. Somebody sent me a “Stuffit” (what an appropriate name!) archive, but for some reason there was an incompatibility there, and I couldn't install it. After three hours I gave up. Apart from being incredibly frustrating, I'm always left wondering whether the problem is with the Apple machine or with me: millions of customers can't be wrong. I suspect that a generation of using menu-driven software has taken its toll, and vendors expect you to understand it, like they expect you to be able to read and write. It's a pity, though, that they've chosen such a horribly difficult and hard to use paradigm.

Sunday, 27 February 2005

What a day! All I wanted to do was to play a DVD on some computer. I failed.

First I continued with the Apple. Since I couldn't find a way to install the Apple DVD player program, installed VLC instead—once I had worked out how to do that. The instructions suggest that you drag part of the archive into the /Applications directory. It took me 5 attempts to get it to go there. When I did, I couldn't work out how to start it. It seems it hides some stupid image in the “task bar” at the bottom of the screen, and some undocumented mouse click brings it to the foreground. When I did, I couldn't get it to recognize the DVD (“no DVD present”; is it talking about the medium or the drive?). Inserting a pre-recorded DVD caused a delay (and no indication that anything was going on), followed by the disk being ejected. After searching in the the help, found a hidden menu to specify the action to take on DVD insertion, and set that to start VLC. No difference. Round about now I decided that there might be something wrong with the DVD drive, but it mounted data DVDs perfectly. Removed the drive and took at look at it: “Macintosh PowerBook G3 Series 2X DVD-ROM Module”. My best guess now is that the drive really doesn't support video DVDs, but there's nothing in the appalling excuse for documentation that mentions this possibility.

While working with the Apple, also upgraded to the latest version of MocOS X. In the process, it disabled my uControl keyboard remapping, not that that was so serious: it works very badly, leaving the Control key locked on after pressing. The result is that the next time I type a d at the beginning of the line, the terminal window disappears. But now it didn't do anything: it had been disabled and refused to load. It did offer to find a new version for me, and told me, yes, there is a new version. No offer, help or instructions to replace the version. I'm continually baffled by how bad this stuff is.

Gave up on Apple and tried installing VLC on eucla, my FreeBSD laptop. Once again ran into this bug:

automake15: configure.in: installing `./compile'
autom4te259: cannot lock autom4te.cache/requests with mode 2 (perhaps you are running make -j on a lame NFS client?): Operation not supported
I had seen that before. It means that you have to install from a local disk. After that, got it installed, but when I started it, I got a whole series of this kind of error message:
VLC media player 0.8.1 Janus
(:7025): GLib-GObject-WARNING **: cannot register existing type `PangoEngineShape'
** (:7025): CRITICAL **: file pango-engine.c: line 86 (_pango_engine_shape_covers): assertion `PANGO_IS_ENGINE_SHAPE (engine)' failed
Reinstalled pango, after which the program started with the following message and empty menus:
libdvdnav: Language 'en' not found, using 'ÿÿ' instead
libdvdnav: Menu Languages available: ÿÿ
At this point, decided that Linux might be better. Tried booting eucla under Linux: I had installed Fedora Core 2 on it last August, but now it wouldn't boot with some obscure error message. Since there had been problems with the X configuration anyway, decided to install Fedora Core 3. The first time tried an upgrade, with the result that, after nearly an hour, the reboot failed with a “Kernel Panic”—where do they get that name from? It looks more like a kernel halt to me, with no information about where it happened. Did a clean install and was rewarded by X still not being able to recognize the hardware. I have no idea why: the same software installed out of the box on FreeBSD last July.

Gave up on Linux and returned to FreeBSD. It was fairly obvious that some of my ports were out of date. Running portupgrade did nothing useful, so with the help of pkg_info -r found the dependencies (all 74 of them!) and removed them, then started reinstalling them. By the time I went to bed I had got as far as multimedia/ffmpeg:

texi2html -monolithic -number ffmpeg-doc.texi
env: perl: No such file or directory
gmake[1]: *** [ffmpeg-doc.html] Error 127
Just a missing dependency. But it's really getting beyond a joke just trying to build ports nowadays.

Monday, 28 February 2005

The Apple DVD player problem has a solution. Spoke to the bloke who sold it to me on IRC:
-> *vendor* I'm having difficulty playing DVDs on the PowerBook.  Any ideas?
*vendor* I think you'll need to be running OS9 for DVD playback - at least that was the
         only way I could make it work
-> *vendor* Hmm.  Interesting.
*vendor* The PB has hardware accelleration for DVD decoding but Apple only elected to
         support it under OS9
-> *vendor* Ah.
-> *vendor* Nice for them to document that, isn't it?
*vendor* I didn't use it much, ended up getting a "real" DVD player
* -> vendor: groggy notes that Apple doesn't seem to think much of documentation anyway.
*vendor* Yes, it's one of those documented by omission sorts of things
-> *vendor* OK, I'll give up then.
-> *vendor* In general, I find MacOS X to be impossibly badly documented.
*vendor* Sorry, I didn't think to mention that at the time
*vendor* (DVD playback, not OSX documentation :)
-> *vendor* No worry.  It serves its purpose.
*vendor* Yeah, it is a bit light on for a "power" user
* -> vendor: groggy notes that some purposes are to be a bad example.
OK, this is an old machine (4 years), so this is all water under the bridge. I suppose it upset a number of people at the time, though. But, as I said on IRC: the documentation, such as it is, doesn't mention the possibility that some DVD drives are not supported under MacOS X.

Saturday, 5 March 2005

Managed to take it easy again today and watch some DVD+RWs (on a DVD player). The recording quality was marginal, and it reminded me that I still can't watch a DVD on any of my machines. Tried it with eucla, on which last weekend I had installed Fedora Core 3. In the meantime I had got X to work, so followed up on Tim Stoakes' suggestion that yum would do a better job of handling dependencies. It didn't get that far:
# yum install emacs
Traceback (most recent call last):
  File "/usr/bin/yum", line 8, in ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 51, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 133, in getOptionsConfig
    self.conf = yumconf(configfile = yumconffile, root=root)
  File "/usr/lib/python2.3/site-packages/yum/config.py", line 227, in __init__
    self._doFileRepo(fn)
  File "/usr/lib/python2.3/site-packages/yum/config.py", line 299, in _doFileRepo
    doRepoSection(self, repoconf, section)
  File "/usr/lib/python2.3/site-packages/yum/config.py", line 313, in doRepoSection
    mirrorurls = getMirrorList(mirrorlist)
  File "/usr/lib/python2.3/site-packages/yum/config.py", line 390, in getMirrorList
    fo = urlresolver.urlopen(url)
  File "/usr/lib/python2.3/site-packages/urlgrabber/grabber.py", line 427, in urlopen
    return default_grabber.urlopen(url, **kwargs)
  File "/usr/lib/python2.3/site-packages/urlgrabber/grabber.py", line 555, in urlopen
    return self._retry(opts, retryfunc, url)
  File "/usr/lib/python2.3/site-packages/urlgrabber/grabber.py", line 527, in _retry
    return apply(func, (opts,) + args, {})
  File "/usr/lib/python2.3/site-packages/urlgrabber/grabber.py", line 554, in retryfunc
    return URLGrabberFileObject(url, filename=None, opts=opts)
  File "/usr/lib/python2.3/site-packages/urlgrabber/grabber.py", line 703, in __init__
    self._do_open()
  File "/usr/lib/python2.3/site-packages/urlgrabber/grabber.py", line 747, in _do_open
    fo, hdr = self._make_request(req, opener)
  File "/usr/lib/python2.3/site-packages/urlgrabber/grabber.py", line 823, in _make_request
    fo = opener.open(req)
  File "/usr/lib/python2.3/urllib2.py", line 326, in open
    '_open', req)
  File "/usr/lib/python2.3/urllib2.py", line 306, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.3/urllib2.py", line 491, in <lambda>
    lambda r, proxy=url, type=type, meth=self.proxy_open: \
  File "/usr/lib/python2.3/urllib2.py", line 498, in proxy_open
    if '@' in host:
TypeError: iterable argument required
This is on a machine with nothing special done to it. I wonder what causes that. In any case, after over a week I'm still no closer to watching DVDs on a computer.

Sunday, 6 March 2005

Five years today since I joined Linuxcare! Times have certainly changed.

Did some more investigation of the problems I had been having with yum yesterday. After some googling, it seems that it was related to the environment variable HTTP_PROXY. It seems that yum will talk to a proxy if it's set. That's a hell of a way to report an error with the proxy, though.

Reset that and I got a different error message:

=== root@naan (/dev/pts/2) /src/BLFS/Blockpool/trunk/blockpool 58 -> yum install emacs

You have enabled checking of packages via GPG keys.  This is a good thing.
However, you do not have any GPG public keys installed.  You need to download
the keys for packages you wish to install and install them.
You can do that by running the command:
    rpm --import public.gpg.key
For more information contact your distribution or package provider.
Again, no information about where to look for help. After some searching I discovered a file /etc/yum.conf with the following line in it:
gpgcheck=1
That seeemed straightforward enough, so I commented it out. No change. Changed 1 to 0. No change. Then I found a directory /etc/yum.repos.d with lots more files, many with the same line. I suppose that's where I should be loading the public key, but I couldn't be bothered. Commented them out and I was finally able to start my install of Emacs: The problem is, I already had Emacs installed, and yum didn't seem to notice. Not only that, like the Sorcerer's Apprentice I found that it insisted on continuing no matter what I did. Hitting ^C only provoked it to retry: I had to kill the window to stop it. Strangely, though, it didn't happen when I tried the same thing on a different system running Fedora; the difference may be that the first one was running GNOME.

The problem is, I couldn't install vlc like that:

=== root@eucla (/dev/pts/6) /src/Linux/tarballs/vlc 5 -> yum install vlc
Setting up Install Process
Setting up Repo:  base
repomd.xml                100% |=========================| 1.1 kB    00:00
Setting up Repo:  updates-released
repomd.xml                100% |=========================|  951 B    00:00
Reading repository metadata in from local files
base      : ################################################## 2622/2622
updates-re: ################################################## 709/709
No Match for argument vlc
Nothing to do

real    0m14.779s
user    0m3.024s
sys     0m0.367s
=== root@eucla (/dev/pts/6) /src/Linux/tarballs/vlc 8 ->
It seems that every time you run yum you need to wait these 15 seconds before it comes up with anything of interest. Presumably the repo needs to be set up to handle this kind of installation, and VLC isn't set up. Following the instructions at that link, I downloaded the Fedora tarball and tried:
=== root@eucla (/dev/pts/6) /src/Linux/tarballs/vlc 2 -> rpm -U * --force
warning: a52dec-0.7.4-7.1.fc3.fr.i386.rpm: V3 DSA signature: NOKEY, key ID e42d547b
warning: package libmodplug = 1:0.7-2vlc was already added, replacing with libmodplug <= 1:0.7-3vlc
warning: package libpostproc = 1.0-0.11.pre5.1.fc2.fr was already added, replacing with libpostproc <= 1.0-0.12.20041025.1.fc3.fr
warning: package vcdimager = 0.7.20-1.1.vlc was already added, replacing with vcdimager <= 0.7.20-3
error: Failed dependencies:
        libcdio.so.0 is needed by cdinfo-0.71-0.i386
        libiso9660.so.2 is needed by cdinfo-0.71-0.i386
        libcdio.so.0 is needed by libvcd-0.7.20-3.i386
        libcdio.so.0(CDIO_0) is needed by libvcd-0.7.20-3.i386
        libiso9660.so.2 is needed by libvcd-0.7.20-3.i386
        libiso9660.so.2(ISO9660_2) is needed by libvcd-0.7.20-3.i386
        libcdio.so.0 is needed by vcdimager-0.7.20-3.i386
        libcdio.so.0(CDIO_0) is needed by vcdimager-0.7.20-3.i386
        libiso9660.so.2 is needed by vcdimager-0.7.20-3.i386
        libiso9660.so.2(ISO9660_2) is needed by vcdimager-0.7.20-3.i386
        libcdio.so.0 is needed by vcdimager-libvcd-0.7.20-1.1.vlc.i386
        libcdio.so.0(CDIO_0) is needed by vcdimager-libvcd-0.7.20-1.1.vlc.i386
        libiso9660.so.0 is needed by vcdimager-libvcd-0.7.20-1.1.vlc.i386
        libiso9660.so.0(ISO9660_0) is needed by vcdimager-libvcd-0.7.20-1.1.vlc.i386
        fribidi is needed by vlc-0.8.1-1.i386
        libfribidi.so.0 is needed by vlc-0.8.1-1.i386
        libsysfs.so.1 is needed by vlc-0.8.1-1.i386
Well, that seems par for the course. So can yum help me fix these missing dependencies?
=== root@eucla (/dev/pts/6) /src/Linux/tarballs/vlc 7 -> time yum install libcdio
Setting up Install Process
(usual messages and 15 second delay omitted)
No Match for argument libcdio
Nothing to do
Say what Tim will, yum doesn't seem to be even a useful tool in solving dependency issues; maybe better documentation will help there. Instead, took a look at the Rpmfind.net site and found a number of packages. But they still need to be installed :
=== root@eucla (/dev/pts/6) /src/Linux/tarballs 13 -> rpm -i libcdio-0.70-1.i686.rpm
warning: libcdio-0.70-1.i686.rpm: V3 DSA signature: NOKEY, key ID e01260f1
=== root@eucla (/dev/pts/6) /src/Linux/tarballs 14 -> rpm -U vlc/*rce
warning: vlc/a52dec-0.7.4-7.1.fc3.fr.i386.rpm: V3 DSA signature: NOKEY, key ID e42d547b
warning: package libmodplug = 1:0.7-2vlc was already added, replacing with libmodplug <= 1:0.7-3vlc
warning: package libpostproc = 1.0-0.11.pre5.1.fc2.fr was already added, replacing with libpostproc <= 1.0-0.12.20041025.1.fc3.fr
warning: package vcdimager = 0.7.20-1.1.vlc was already added, replacing with vcdimager <= 0.7.20-3
error: Failed dependencies:
        libcdio.so.0 is needed by cdinfo-0.71-0.i386
(etc)
=== root@eucla (/dev/pts/6) /src/Linux/tarballs 16 -> rpm -U libcdio-0.70-1.i686.rpm
warning: libcdio-0.70-1.i686.rpm: V3 DSA signature: NOKEY, key ID e01260f1
        package libcdio-0.70-1 is already installed
=== root@eucla (/dev/pts/6) /src/Linux/tarballs 17 -> rpm -q libcdio-0.70-1.i686.rpm
package libcdio-0.70-1.i686.rpm is not installed

I tried again with --force, but it made no difference. One more failure for Linux.

Finally rebooted eucla and tried mplayer again. It seems that in the last week or so I blew away a number of dependencies, but after reinstalling the latest version, it worked. Not exactly a success: I've used mplayer before, but found it to be inadequate. Still, after two weekends I can now watch my DVD, sort of.

Monday, 7 March 2005

Things have been keeping me pretty busy for the past two weeks, and today I spent nearly all the day catching up on things that I had left behind as a result. Didn't even finish.

This DVD stuff is making some progress, but it's slow. Yesterday Yvonne rented some DVDs from Blockbusters, but we had difficulty watching them: they looked like they had been used as paperweights for sandpaper. Today spent some time trying to copy them so we could watch them at all. The good news is that the DVD drive was able to read them. Burning a new DVD was more of an issue: people told me that burncd doesn't support DVDs, so I had to install the dvd+rw-tools port and run a program with the the incongruous name growisofs. First, though, it seemed appropriate to format the DVD+RW disk I was going to use with dvd+rw-format (how I hate these complicated names!). Running that was less than edifying:

=== root@teevee (/dev/ttyp2) ~ 3 -> dvd+rw-format /dev/acd0
* DVD±RW/-RAM format utility by <appro@fy.chalmers.se>, version 4.10.
:-( unable to open("/dev/acd0"): Inappropriate ioctl for device
Looking at the operation with ktrace showed:
 40005 dvd+rw-format CALL  ioctl(0x3,CAMGETPASSTHRU,0xbfbfdc80)
 40005 dvd+rw-format RET   ioctl -1 errno 25 Inappropriate ioctl for device
It seems that I needed SCSI emulation, the atapicam device. Built a new kernel and booted it, but it appeared to make no difference. It seems that atapicam just adds a device to the existing one, so after installing it my DVD burner was visible as an ATAPI device at /dev/acd0 and as a SCSI device at /dev/cd0. I was able to burn a DVD+RW; but the DVD player could hardly read it at all. Back in eucla (a different machine with a different drive) I was able to read in the DVD and compare it to the original: no difference. But I couldn't play it there either. I suspect that there's some issue with the way the data is written to the DVD that makes it difficult to read. This material is really a minefield.

Tuesday, 8 March 2005

In the evening more work on multimedia. I was able to get teevee to display multihead on a TV and a monitor, not for the first time, but that was about all. For some reason, mplayer was installing without the GUI. After some experimentation with the Makefile, discovered that, though it's documented that you can use it with gtk version 2, the build doesn't support it. It doesn't complain; it just doesn't build gmplayer. While experimenting with that, discovered that this time I wasn't able to get mplayer to do its thing:
=== root@teevee (/dev/ttyp6) /home/grog 1 -> mplayer dvd://1
MPlayer 1.0pre6-3.3.3 (C) 2000-2004 MPlayer Team
CPU: Advanced Micro Devices Athlon 4 /Athlon MP/XP Palomino (Family: 6, Stepping: 2)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

Playing dvd://1.
Reading disc structure, please wait...
There are 2 titles on this DVD.
There are 22 chapters in this DVD title.
There are 1 angles in this DVD title.
DVD successfully opened.
MPEG-PS file format detected.
VIDEO:  MPEG2  720x576  (aspect 3)  25.000 fps  7500.0 kbps (937.5 kbyte/s)
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
AC3: 5.1 (3f+2r+lfe)  48000 Hz  448.0 kbit/s
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, 16 bit (0x10), ratio: 56000->192000 (448.0 kbit)
Selected audio codec: [a52] afm:liba52 (AC3-liba52)
==========================================================================
vo: X11 running at 800x600 with depth 24 and 32 bpp (":0.0" => local display)
vo_xvmc: X-Video extension 2.2
vo_xvmc: X-Video MotionCompensation Extension version 1.0
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 576 (preferred csp: Mpeg PES)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
VDecoder init failed :(
Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b
Selected video codec: [mpeg12] vfm:libmpeg2 (MPEG 1 or 2 (libmpeg2))
==========================================================================
Checking audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 48000 hz, little endian signed int
AF_pre: 48000Hz 2ch Signed 16-bit (Little-Endian)
AO: [oss] 48000Hz 2ch Signed 16-bit (Little-Endian) (2 bps)
Building audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
Starting playback...
VDec: vo config request - 720 x 576 (preferred csp: Planar YV12)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.

FATAL: Could not initialize video filters (-vf) or video output (-vo).

Exiting...  (End of file)
=== root@teevee (/dev/ttyp6) /home/grog 2 ->
At first that looked like what happened to me last time, but on examination it wasn't the same thing after all.

What frustration! Watched the remainder of our flaky DVDs on eucla, the Dell laptop.

Wednesday, 9 March 2005

Continued work on upgrading echunga today. Getting the scripts together is more work than I thought.

Later, spent more time looking at the multimedia issues. Tried to repeat yesterday's problems with mplayer, but now it works:

VDec: vo config request - 720 x 576 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [xv] 720x576 => 1024x576 Planar YV12
aspect: Warning: no suitable new res found!
aspect: Warning: no suitable new res found!
aspect: Warning: no suitable new res found!
aspect: Warning: no suitable new res found!
New_Face failed.  Maybe the font path is wrong.  2 ??% ??% ??,?% 0 0
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
About the only thing I can think of is that one of the attempts to install gmplayer last night led to the correct CSP being loaded. Further investigation revealed the problem with the fonts: it needs the /usr/ports/multimedia/mplayer-fonts port as well. It seems that the reason it's not installed automatically is because the (theoretical) possibility exists that the system might be running TrueType fonts instead. The possibility is theoretical because it's not configured to use them, as I discovered when I installed them. Installed mplayer-fonts and things looked better.

The next hurdle was the display format. For some reason, instead of setting the display to the standard PAL-B/G format of 720x576, it set 640x480. Investigating/var/log/Xorg.0.log showed that it didn't even try 720x576, presumably because (why?) it didn't have a mode line for 720x576. Spent some time looking for the PAL standard documentation to get the correct parameters for the mode line, and discovered that it appears to be too old to find documentation online. Found one at ETSI, but it related to wide-screen modifications of PAL to run 16:9. Also found other stuff at ITU, but nothing giving me the signal parameters. In the meantime, people dragged up things that were obviously wrong:

<Darius> ModeLine "720x576PAL" 15.125 720 770 842 968 576 579 607 625 Composite Interlace
Well, at least the scan totals look right, but the frequency is wrong: it should be 15.625 kHz. How do people get things that wrong? Still, it might be a basis for something that could work.

Also did some investigation of why the signal was so bright. Dragged out my old HP 1740A oscilloscope (must be 25 years old) and compared the video card output with the tuner output from a VCR and confirmed that the signal frequencies were correct (and that the HP was still correctly calibrated, something I'm sure I can't say about my Tektronix 555). The voltage levels were also roughly the same, but the white background of the X display made the overall level very different. To be investigated further.

Thursday, 10 March 2005

So today was the day, and I finally bit the bullet and upgraded echunga to the “new” (last September) motherboard and FreeBSD 5.4 prerelease. I had reason to be so careful. The first set of issues were with rebuilding the hardware:

Finally got the machine up and more or less running. The next step was to get X running. echunga has been running 3 monitors for several years now, and traditionally upgrading X has been a matter of trial and error, the error usually involving the system freezing and requiring the Big Red Button to continue. Modified /etc/fstab to not mount all non-essential file systems, and played around. It looks like the old Matrox G400 (also five years old) has finally had its day. It's a dual-headed card, but the second output had a maximum resolution of 1024x768, so I've never used it, and I couldn't find a way to get it to work with any of the four PCI cards I had at my disposal. Instead ended up with three identical SiS cards:

(--) PCI: (1:7:0) Silicon Integrated Systems [SiS] SiS315PRO PCI/AGP VGA Display Adapter rev 0, Mem @ 0xb0000000/28, 0xdf000000/18, I/O @ 0xc000/7
That seemed to start up quite well, so put the machine back in my office and connected up the monitors. The displays were rather surprising: :0.0 should have been 1920x1440, but came up as 1600x1200. :0.1 was the other ways round: it should have been 1600x1200, but came up as 1920x1440. This is the old iiyama monitor that has been dying for at least 2 years now, and it was getting a bit fuzzy. To my surprise it was sharper at 1920x1440 than at 1600x1200. Later testing showed that it wasn't the monitor at all that was so fuzzy, but either the cable length (I had relocated the machine, so didn't need so long cables) or the display card.

Still further investigation showed that the SiS cards aren't that spectacular: though they have 32 MB of memory, and even 2048x1536 at 32 bpp would only need 12 MB memory, the AGP card has a maximum pixel clock of 220 MHz. The PCI cards are identical, but one claims 195 MHz, the other 390 MHz. I suspect a bug in Xorg (6.8.1) here, but also noted problems with the second card when running at 1600x1200 in 24 bpp mode, so decided to put in a new nVidia card that I had bought last week. It claims a 350 MHz maximum clock, more than I need, and with that I was able to (finally) reinstate my X configuration.

Well, almost. When I restarted X I was unable to connect any clients at all, neither the window manager nor local or remote:

AUDIT: Thu Mar 10 17:42:37 2005: 23324 X: client 3 rejected from IP 192.109.197.1
AUDIT: Thu Mar 10 17:42:37 2005: 23324 X: client 7 rejected from IP 192.109.197.145
AUDIT: Thu Mar 10 17:42:37 2005: 23324 X: client 6 rejected from IP 192.109.197.134
No indication of why, but when I stopped the server I got a message (now lost) indicating an inability to lock ./Xauthority. After further investigation discovered that the issue was because I had mounted /home read-only. After that, got things working normally.

The rest of the system still wasn't working too well, though. For some reason kernel PPP dialled and made a phone connection, but then dropped the connection before establishing a network connection. Hopefully I'll have DSL in the near future; in the meantime, started user PPP, which worked without problems.

Well, without immediate problems. I then had significant delays with DNS lookups, and I couldn't get reverse lookups done, though echunga is the primary name server for the zone. Further investigation showed that ppp had apparently overwritten my /etc/resolv.conf file. I'll have to find a way to stop it doing that.

After that, there wasn't much left to do (nor time to do it). Mail is still not running, but it's only a backup MX, so that shouldn't be an issue. The web server came up relatively well, but my own pages (http://www.lemis.com/grog/) were inaccessible. It seems that something's different with Apache version 2, which is what I installed. That was enough for one day, though.

While waiting for fsck, also had time to look at the TV scan stuff. The following mode line seems to do the trick for PAL:

Section "Monitor"
        Identifier   "TV"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
        HorizSync    15.625
        ModeLine     "720x576" 15.125   720 768 840 968  576 592 607 625   Composite  Interlace
EndSection
I'm not out of the woods yet, though. Now mplayer detects the size and enlarges it:
Starting playback...
VDec: vo config request - 720 x 576 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [xv] 720x576 => 1024x576 Planar YV12
gmplayer then manages to position itself outside the screen. What a mess!

Friday, 11 March 2005

Finally put teevee in the HiFi cupboard, and managed to watch a DVD on the TV. I had probably the heaviest remote control ever: eucla, a Dell Inspiron 9100, which weighs in (according to Dell) at 4.05 kg. I ran x2x to directly control gmplayer on teevee:0.1, and—it worked! Even very well, within the limitations of gmplayer. One of the things that really annoy me about infrared remote controls is that they're not very reliable: the device often don't respond the first time. It wasn't until I used the laptop keyboard that I realized just how much that got on my nerves.

Next step is to get the tuner working and find an easier method of remote control.

Saturday, 12 March 2005

Another day spent chasing multimedia stuff, with little to show for it. My intention had been to get a BT 878 tuner card working. First I had to find out how to use the thing at all: there's a driver, but no program to go with it. It seems that the only clients are in the Ports collection. It turned out that I already had mencoder, which is part of the mplayer port; others suggested to me to use xawtv and fxtv. Tried both of them without success.

xawtv says “If all else fails, RTFM”. All else failed. The application came up claiming an impossible combination of standards, NTSC and Western European TV frequencies (NTSC isn't used at all in Western Europe), and I couldn't change it. So I read the FM and discovered:

NAME
       xawtvrc -- TV apps config file
SYNOPSIS
       /etc/X11/xawtvrc
       $HOME/.xawtv
So I created a file /etc/X11/xawtvrc and ran things. No change. Then I ran ktrace and discovered:
  5996 xawtv    NAMI  "/usr/X11R6/lib/X11/xawtvrc"
  5996 xawtv    RET   open -1 errno 2 No such file or directory
So I moved the file there and yes, it seemed to accept it, using PAL and Australian frequencies. But still no signal. About the only message I got was, once a second,
bktr: sigalrm
bktr: sigalrm
fxtv is less verbose and even more difficult to understand, but there was no obvious difference there. On a hunch, looked at the sysctls that relate to the driver and found:
=== root@teevee (/dev/ttyp4) ~ 42 -> sysctl hw.bt848
hw.bt848.card: -1
hw.bt848.tuner: -1
hw.bt848.reverse_mute: -1
hw.bt848.format: -1
hw.bt848.slow_msp_audio: -1
This all suggests that the driver isn't finding things. dmesg told me:
bktr0: <BrookTree 878> mem 0xdddfe000-0xdddfefff irq 17 at device 6.0 on pci0
bktr0: [GIANT-LOCKED]
bktr0: Card has no configuration EEPROM.  Cannot determine card make.
bktr0: Pinnacle/Miro TV, Temic PAL I tuner.
Strange that it first says that it can't determine what it is, then gives the information that should have shown up in the sysctls. More important, though, is the IRQ number. As it suggests, investigation shows that this motherboard has an IO-APIC:
ioapic0 <Version 0.3> irqs 0-23 on motherboard
So maybe we're not getting interrupts. The driver should complain, of course, but nothing would surprise me any more.

In the evening, watched another rented DVD, “The affair of the necklace”. This one was completely confusing: it had 18 “titles”, and the first had four sound tracks, English, French, Italian and American. The American track was the default, and it was a commentary about the film rather than the dialogue. As a result, I got the impression that it was not the main feature. Wouldn't it be nice to have a directory on the DVD to say what's what? It seems that the DVD manufacturers are going out of their way to be confusing. This has nothing to do with my software problems, of course, but maybe it's indicative of the general confusion in the industry.

Sunday, 13 March 2005

I had a number of multimedia things to do today. The big one was to get the tuner card working, but first there were a couple of other packages to try. One person recommended ogle, which installed with a minimal man page that didn't even give information on the key bindings (you have to fight through the XML in the man page for the config file to find that). There also seems to be no way to specify the device you want to read from (apart from setting it in the config file). The default was also incorrect, so I got:
=== root@teevee (/dev/ttyp2) /usr/local/share/ogle 5 -> ogle
libdvdread: Can't stat /dev/acd0c
No such file or directory
ERROR[ogle_nav]: faild to open/read the DVD
DVDSetDVDRoot:: Root not set
The man page made some suggestions that looked like they might work, but obviously there are different views on what constitutes a path name:
=== root@teevee (/dev/ttyp2) /usr/local/share/ogle 6 -> ogle -u gui /dev/acd0
FATAL[ogle_ctrl]: init_decoder(): path: /usr/X11R6/lib/ogle/ogle_gui
execv: No such file or directory
Finally I had to set it in the config file:
--- oglerc      2005/03/13 00:20:17     1.1
+++ oglerc      2005/03/13 00:59:03
@@ -14,7 +14,7 @@
       </defaults>
     </nav>
     <device>
-      <path>/dev/acd0c</path>
+      <path>/dev/acd0</path>
     </device>
   </dvd>
   <audio>
After that it worked, but I couldn't find a way to run it in full-screen mode. In general it doesn't seem to have as many features as mplayer, and also nothing that mplayer doesn't have, so gave up on it.

Edwin Groothuis had suggested using vobcopy, which copies data from file system mounted DVDs. It didn't work quite the way I expected. In the following, I've omitted most of the copious output:

=== root@teevee (/dev/ttyp5) /home/dvd 5 -> vobcopy -v
...
Successfully copied file /home/dvd/DOUBLEWHAMMY2-2.vob
# of separate files: 2

Copying finished! Let's see if the sizes match (roughly)
Combined size of title-vobs: 7722770432 (7365 MB)
Copied size (size on disk):  3861385216 (3683 MB)
[Error] Hmm, the sizes differ by more than 2000
[Hint] Take a look with MPlayer if the output is ok
This is nonsense, of course. I don't know where it gets the size of 7.4 GB, but it's obviously wrong:
=== grog@teevee (/dev/ttyp1) ~ 16 -> du -sm /cdrom
3785    /cdrom/
It seems to do this every time. On another occasion, I got:
DVD-name: DVD_VIDEO
Used the linux statfs
In freespace_getter:for /home/dvd/ : 110952919040 free
In freespace_getter:part1 54176230, part2 2048

Outputting to /home/dvd/DVD_VIDEO1-1.vob

[Error] error opening file /home/dvd/DVD_VIDEO1-1.vob.partial
Doesn't that look like Microsoft? “Error”! What error? It proved to be a permission issue, but why doesn't the program report it?

On the up side, I was able to view the results with mplayer. I had tried to do this earlier, but it didn't work: it seems that the copied images were corrupted. In other words, as long as there are no problems, vobcopy seems to do the trick. I wonder what I should use to copy the sandpaper paperweights that I rent from Blockbusters. Somebody recommended dvdrip, but that required installing multiple ports:

=== root@teevee (/dev/ttyp2) /usr/ports/multimedia/dvdrip 3 -> ls -lrt /var/db/pkg/
drwxr-xr-x  2 root  wheel  512 Mar 13 12:33 svgalib-1.4.3_4
drwxr-xr-x  2 root  wheel  512 Mar 13 12:34 texi2html-1.76_1,1
drwxr-xr-x  2 root  wheel  512 Mar 13 12:42 p5-XML-Writer-0.530
drwxr-xr-x  2 root  wheel  512 Mar 13 12:42 p5-Gtk-0.7009_1
drwxr-xr-x  2 root  wheel  512 Mar 13 12:42 gdk-pixbuf-0.22.0_3
drwxr-xr-x  2 root  wheel  512 Mar 13 12:59 gsfonts-8.11_2
drwxr-xr-x  2 root  wheel  512 Mar 13 13:02 sdl-1.2.8,2
drwxr-xr-x  2 root  wheel  512 Mar 13 13:02 ffmpeg-0.4.9.p1_2
drwxr-xr-x  2 root  wheel  512 Mar 13 13:25 glib-2.4.8
drwxr-xr-x  2 root  wheel  512 Mar 13 13:26 libltdl-1.5.10
drwxr-xr-x  2 root  wheel  512 Mar 13 13:26 libfpx-1.2.0.12
drwxr-xr-x  2 root  wheel  512 Mar 13 13:26 jbigkit-1.6
drwxr-xr-x  2 root  wheel  512 Mar 13 13:26 ghostscript-gnu-7.07_12
drwxr-xr-x  2 root  wheel  512 Mar 13 13:26 mpeg2codec-1.2_1
drwxr-xr-x  2 root  wheel  512 Mar 14 10:15 speex-1.0.4_1,1
drwxr-xr-x  2 root  wheel  512 Mar 14 10:15 libao-0.8.5
drwxr-xr-x  2 root  wheel  512 Mar 14 10:15 curl-7.12.3_2
drwxr-xr-x  2 root  wheel  512 Mar 14 10:17 vorbis-tools-1.0.1_3,3
drwxr-xr-x  2 root  wheel  512 Mar 14 10:17 pstree-2.25
drwxr-xr-x  2 root  wheel  512 Mar 14 10:17 p5-Storable-2.13
drwxr-xr-x  2 root  wheel  512 Mar 14 10:17 p5-GdkPixbuf-0.7009_2
drwxr-xr-x  2 root  wheel  512 Mar 14 10:17 p5-Event-1.02
drwxr-xr-x  2 root  wheel  512 Mar 14 10:17 ogmtools-1.4.1
drwxr-xr-x  2 root  wheel  512 Mar 14 10:17 mplayer-gtk-0.99.6
drwxr-xr-x  2 root  wheel  512 Mar 14 10:17 liveMedia-2005.03.11,1
drwxr-xr-x  2 root  wheel  512 Mar 14 10:17 fping-2.4b2
drwxr-xr-x  2 root  wheel  512 Mar 14 10:17 ImageMagick-6.2.0.5
drwxr-xr-x  2 root  wheel  512 Mar 14 10:17 dvdrip-0.50.18_2

As a result, and as the modification times show, it took nearly 24 hours to install, along with various mishaps.

As if all that wasn't bad enough, I have been experiencing hangs during POST on reboot. Finally it got to the point where it wouldn't find the disk at all. Further investigation showed:

  1. For the second time this week, I have a dying disk.
  2. In the Good Old Days disks died with head crashes or other mechanical issues. That seems to be the exception nowadays. They seem to die with electronics problems.

  3. On a hunch, I put the dead disk back in as a slave to a good disk. It worked! I'm guessing that the failure was in a place that isn't needed by slave disks. It's interesting in that connection how many drives fail on reboot after having run reliably for months. I wonder what functions are performed, and why they should be so difficult.

    With that success in place, tried the dead disk from old echunga, which died earlier this week. Unfortunately that didn't work: although it was set as a slave, the BIOS didn't even detect the master device. Maybe the drive was holding on to the bus.

Working on the tuner card was less fruitful. It turns out my card has a little-known tuner (the metal box at top left of the following photo):


https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20050313/big/tuner-card-1.jpeg
Image title: tuner card 1          Dimensions:          2048 x 1536, 528 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Sunday, 13 March 2005, thumbnails          All images taken on Sunday, 13 March 2005, small
Diary entry for Sunday, 13 March 2005 Complete exposure details

 

It has the clear marking TVF-8533-B/DF, for which I found a number of hits, many in this part of the world. “Pablo” describes how to set it up under Linux, but it's not clear how to convert those instructions to FreeBSD. Ran the card with video input mode from a camera, and that worked perfectly, so at least we've narrowed it down. Spent some time putting debugging code in the driver (after removing it from the kernel and changing it to a KLD), but didn't get any conclusive results.

Friday, 29 April 2005

Received what I had expected to be a Hauppauge PVR-250 card from ELX in the mail today. It's an OEM package, and it doesn't actually say what it is, but the accompanying documentation suggested that it was a PVR-150, and I later got confirmation that it is indeed a PVR-150: the supplier had switched without telling. I'm not sure that it'll make any difference, but the price is right. Now I have even more work to do over the weekend.

Saturday, 30 April 2005

The PVR-150 has another interesting detail: no remote control. That doesn't worry me, but it's worth noting. It probes like this under FreeBSD:
pci0: <multimedia, video> at device 7.0 (no driver attached)

=== root@teevee (/dev/ttyp0) /home/grog 3 -> pciconf -l  -v
none2@pci0:7:0: class=0x040000 card=0x88010070 chip=0x00164444 rev=0x01 hdr=0x00
    vendor   = 'Conexant Inc (Was: Globespan, ICompression Inc)'
    device   = 'iTVC16/CX23416 MPEG Codec'
    class    = multimedia
    subclass = video

Coincidentally, John Wehle posted the latest version of his PVR-250/PVR-350 drivers. Extracted them as described, but then ran into problems with the firmware. The instructions said:

  3) Place a current version of hcwpvrp2.sys from the
     Hauppauge drivers into /sys/dev/cxm.  Extract the
     the firmware by:

       # cd /sys/dev/cxm
       # cc -o cxm_extract_fw cxm_extract_fw.c
       # ./cxm_extract_fw hcwpvrp2.sys
Unfortunately, this file didn't exist. The .sys files on the CD-ROM were:
-r-xr-xr-x  1 root  wheel    26972 Nov 18 12:23 WinTV-NOVA-TMCE_2_102_22323_WHQL_signed/hcw88bar.sys
-r-xr-xr-x  1 root  wheel   142400 Nov 18 12:36 WinTV-NOVA-TMCE_2_102_22323_WHQL_signed/hcw88bda.sys
-r-xr-xr-x  1 root  wheel   307267 Nov 18 12:21 WinTV-NOVA-TMCE_2_102_22323_WHQL_signed/hcw88enc.sys
-r-xr-xr-x  1 root  wheel     8387 Nov 18 12:22 WinTV-NOVA-TMCE_2_102_22323_WHQL_signed/hcw88r9x.sys
-r-xr-xr-x  1 root  wheel    11719 Nov 22 12:20 WinTV-NOVA-TMCE_2_102_22323_WHQL_signed/hcw88rc5.sys
-r-xr-xr-x  1 root  wheel    14016 Nov 18 12:22 WinTV-NOVA-TMCE_2_102_22323_WHQL_signed/hcw88ts.sys
-r-xr-xr-x  1 root  wheel   128577 Nov 18 12:33 WinTV-NOVA-TMCE_2_102_22323_WHQL_signed/hcw88tun.sys
-r-xr-xr-x  1 root  wheel   579004 Nov 18 12:23 WinTV-NOVA-TMCE_2_102_22323_WHQL_signed/hcw88vid.sys
-r-xr-xr-x  1 root  wheel   131840 Nov 11 12:43 WinTV-PVR-150500MCE_2.0.18.22316_WHQL_signed/hcwPP2.sys
-r-xr-xr-x  1 root  wheel   814464 Sep 22  2004 WinTV-PVR-250_retail1_1_18_22266/hcwPVRP2.sys
-r-xr-xr-x  1 root  wheel  1433280 Oct 21  2004 WinTVPVRUSB2_22_73_22295_WHQL_signed/HCWUSB2.sys
cxm_extract_fw runs fine against WinTV-PVR-250_retail1_1_18_22266/hcwPVRP2.sys, but with WinTV-PVR-150500MCE_2.0.18.22316_WHQL_signed/hcwPP2.sys it says:
=== root@teevee (/dev/ttyp0) /usr/src/sys/dev/cxm 22 -> ./cxm_extract_fw hcwPP2.sys
cxm_extract_fw: decoder image not present
cxm_extract_fw: encoder image not present
I don't know anything about the content of these files, but it looks like I have a problem for the while.

Saturday, 4 June 2005

I haven't really been doing enough logging of this work. I recall climbing through the BT878 code on both FreeBSD and Linux a couple of months back, but I no longer recall where, or what exactly the results were. There was some stuff in the FreeBSD-multimedia list, but that didn't help.

First started to try to display data input via the composite video channels. Things aren't helped by the stupid error reporting:

=== root@teevee (/dev/ttyp6) /spool/Images 94 -> xawtv
This is xawtv-3.94, running on FreeBSD/i386 (5.3-RELEASE-p5)
no video grabber device available
=== root@teevee (/dev/ttyp6) /spool/Images 95 ->
Running ktrace showed some of the problem:
 64174 xawtv    CALL  open(0x8077520,0,0)
 64174 xawtv    NAMI  "/dev/bktr0"
 64174 xawtv    RET   open 4
 64174 xawtv    CALL  ioctl(0x4,METEORGSUPPIXFMT,0x80a200c)
 64174 xawtv    RET   ioctl -1 errno 12 Cannot allocate memory
 64174 xawtv    CALL  close(0x4)
 64174 xawtv    RET   close 0
 64174 xawtv    CALL  close(0)
 64174 xawtv    RET   close 0
 64174 xawtv    CALL  write(0x2,0x8074840,0x22)
 64174 xawtv    GIO   fd 2 wrote 34 bytes
       "no video grabber device available
       "
 64174 xawtv    RET   write 34/0x22
I'm not sure what was causing the memory allocation error, but rebooting it fixed it. I then found that I could display composite video under certain circumstances:

Trying fxtv didn't help much either. It managed to display something, but only with excessive delays, and it kept hanging.

Based on some of the input from the FreeBSD-multimedia mailing list, started playing around with the sysctls for the tuner, and finally got it to work! For future reference, the tuner is close enough to being an Alps TSBH1 that this got it to work:

=== root@teevee (/dev/ttyp3) /usr/ports/multimedia 52 -> sysctl -w hw.bt848.tuner=13; xawtv
hw.bt848.tuner: -1 -> 13
This is xawtv-3.94, running on FreeBSD/i386 (5.3-RELEASE-p5)
That didn't fix the confusion that xawtv has with the displays, of course, so off to look for something else, and ended up writing what became another web page about the packages I had tried and those that I might reasonably try. Didn't make any further progress in actually getting a usable TV display.

Friday, 10 June 2005

Into town this morning to present a (userland) debugging seminar to people at work at 10 am. Got there and found nobody else there; everybody was late, and two of the key attendees were off sick. In addition, I had asked for a reproducible and real bug in our software, but somebody had gone and fixed them all. Still, the presentation (more like a demonstration) went well, and there was a good level of audience participation.

Meeting in the afternoon, and we're still going over the same issues we were nearly 2 months ago. I suppose we've made some progress, but it should be much more.

Brought home the data projector, a Sony VPL-ES2, from work in the evening. I've been thinking about buying one, but first I wanted to find out what it's really like. A good thing, too: I found a number of things, some of them unexpected:

Tuesday, 28 June 2005

Finally got the new Panasonic PT-AE700E projector, and spent some time setting it up. It's not all roses: despite the specs, I couldn't get it to display normal a text mode display, and it requires a lot of padding either side of the image to display a complete image under X. I've frequently seen before that projectors do this (they cut off both left and right sides), but after using the Sony VPL-ES2, a cheap projector that handles just about anything you throw at it, I had thought it a thing of the past. With the PT-AE700E I had to modify the line timing significantly: at 1280 pixels per line (the default), the line total went from 1532 to 1660. In the process, with the help of xvidtune, I managed to get the display into such a state that I couldn't display it at all; the projector kept flashing it up for half a second and then turning off again for several seconds.

The projector wasn't the only thing that gave me problems: its native resolution is 1280x720, but the display card didn't handle that well, and added a lot of flimmering junk at the bottom, which I couldn't get rid of until I increased the line count to 736, so I finally ended up with the following mode line:

ModeLine    "1280x736"     99.00   1280 1392 1488 1660    736  737  740  776 +hsync +vsync
Presumably the corresponding “correct” mode line would be
ModeLine    "1280x720"     99.00   1280 1392 1488 1660    720  721  724  760 +hsync +vsync
I'll try that out when I have time to change the card.

Finally, mplayer appears to be Just Plain Broken when it comes to 16:9 displays. So many DVDs have 16:9 content, but there appears to be no way to display them on a 16:9 display with mplayer. There seem to be three possible settings: 16:9, 4:3 and 2.35. They don't work as expected: selecting 4:3 (the default) on a 16:9 display stretches the display horizontally to 16:9. Selecting 16:9 stretches it even further. In fact, I haven't found a way to get mplayer display correctly on a 16:9 display. The obvious display formats would be:

The only way I have found so far to get usable results is to get the projector to compress the 16:9 back to 4:3, thus counteracting mplayer breakage. Not exactly the reason I bought a wide screen projector.

Sunday, 26 March 2006

Sunday, 9 April 2006

Echunga

Following http://wilsonet.com/mythtv/fcmyth.php: For the SiS drivers for ceeveear, execute the following as root:

mkdir -p ~mythtv/sources/sis_drv
cd ~mythtv/sources/sis_drv
wget http://www.winischhofer.net/sis/sis_drv.o_xorg_gcc3_current.tar.gz
tar -xzvf sis_drv.o_xorg_gcc3_current.tar.gz
mv /usr/X11R6/lib/modules/drivers/sis_drv.o /usr/X11R6/lib/modules/drivers/sis_drv.o.orig
cp sis_drv.o /usr/X11R6/lib/modules/drivers/sis_drv.o
The directory http://www.winischhofer.net/sis/ contains a very large number of similarly named files, which firefox conveniently truncates. sis_drv.o_xorg_gcc3_current.tar.gz appears to be the latest version (i.e. not a static content).

At this point, things went wrong. /usr/X11R6/ has only one directory in it, bin. Fortunately, Fedora seems to do the right thing by locate (or maybe I was just lucky that it gets done Saturday night; I can't work out the format of the periodic cron scripts). It shows:

=== root@ceeveear (/dev/pts/2) /home/mythtv/sources/sis_drv 35 -> locate sis_drv
/ubuntu/usr/X11R6/lib/modules/drivers/sis_drv.o
/usr/lib/xorg/modules/drivers/sis_drv.so
OK, rewrite that script:
mkdir -p ~mythtv/sources/sis_drv
cd ~mythtv/sources/sis_drv
wget http://www.winischhofer.net/sis/sis_drv.o_xorg_gcc3_current.tar.gz
tar -xzvf sis_drv.o_xorg_gcc3_current.tar.gz
mv /usr/lib/xorg/modules/drivers/sis_drv.o /usr/lib/xorg/modules/drivers/sis_drv.o.orig
cp sis_drv.o /usr/lib/xorg/modules/drivers/sis_drv.o
Interestingly, though, that's still not the same name:
=== root@ceeveear (/dev/pts/2) /home/mythtv/sources/sis_drv 41 -> l /usr/lib/xorg/modules/drivers/sis_drv*
-rw-r--r-- 1 root root 597402 Apr  9 12:03 /usr/lib/xorg/modules/drivers/sis_drv.o
-rwxr-xr-x 1 root root 609444 Feb 13 05:53 /usr/lib/xorg/modules/drivers/sis_drv.so
=== root@ceeveear (/dev/pts/2) /home/mythtv/sources/sis_drv 42 -> file /usr/lib/xorg/modules/drivers/sis_drv*
/usr/lib/xorg/modules/drivers/sis_drv.o:  ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
/usr/lib/xorg/modules/drivers/sis_drv.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped
So which do we take? Took a look at Thomas Winischhofer's SiS chipset overview, which was instructive. ceeveear has:
02:00.0 VGA compatible controller: Silicon Integrated Systems [SiS] 315PRO PCI/AGP VGA Display Adapter (prog-if 00 [VGA]
)
        Subsystem: Silicon Integrated Systems [SiS] 315PRO PCI/AGP VGA Display Adapter
        Flags: bus master, 66MHz, medium devsel, latency 39, IRQ 5
        BIST result: 00
        Memory at d0000000 (32-bit, prefetchable) [size=256M]
        Memory at e5000000 (32-bit, non-prefetchable) [size=256K]
        I/O ports at c000 [size=128]
        [virtual] Expansion ROM at e4000000 [disabled] [size=64K]
        Capabilities: [40] Power Management version 2
        Capabilities: [50] AGP version 2.0
On further investigation, http://www.winischhofer.net/sis/sis_drv.o_xorg_6.9.0_gcc4_091205-1.tar.gz contains the file /usr/lib/xorg/modules/drivers/sis_drv.so, and it's the correct version of Xorg, so I'll go for that.

While doing that, decided to set up the environment a bit better. One thing I definitely need is a window manager that I'm happy with, and that's pretty much fvwm2. Found the RPM and downloaded it, and was then forcibly reminded of why I didn't like Fedora:

=== root@ceeveear (/dev/pts/2) /home/mythtv/sources 102 -> rpm -i fvwm-2.5.13-1.i386.rpm
error: Failed dependencies:
        libfribidi.so.0 is needed by fvwm-2.5.13-1.i386
        libreadline.so.4 is needed by fvwm-2.5.13-1.i386
        libstroke.so.0 is needed by fvwm-2.5.13-1.i386
        libXft.so.1 is needed by fvwm-2.5.13-1.i386

Spent a bit of time following up these references before it dawned on my that I was being silly. Some of these were missing simply because they were out of date. What I should have been doing was building from source—after all, when it comes to porting, I wrote the book. That worked relatively simply. Getting it to actually work was more complicated; I need to read more about GNOME.

At this point, the instructions became quite complicated, and I first need to read both them and the MythTV documentation to understand what needs to be done. The good news appears to be that there's a generic IR remote control application, which will make things much easier. But that's for another day. Tried installing xawtv, but again ended up with a maze of twisty little unfulfilled dependencies, all different. An attempt to build xawtv from source also failed, since I first needed to install the Xorg sources.


Greg's home page Greg's diary Greg's photos Copyright

Valid XHTML 1.0!

$Id: log.0.php,v 1.18 2012/07/07 06:23:07 grog Exp $