Greg
animals language
brewing multimedia
food and drink music
fiction health
opinion gardening
photography general
technology history
Stones Road house politics
Greg's diary
February 2007
Translate this page
Select day in February 2007:
Su Mo Tu We Th Fr Sa
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28
Select month:
2006 Sep Oct Nov Dec
2007 Jan Feb Mar Apr
2007 May Jun Jul Aug
Today's diary entry
Diary index
About this diary
Previous month
Next month
Greg's home page
Greg's photos
Network link stats
Greg's other links
Copyright information
    
Groogle

Thursday, 1 February 2007 Echunga
Top of page
next day
last day

How I hate working on multimedia code! Somewhere there's something wrong with the navigation information that I'm outputting, but how do I find out where? The obvious thing to do would be to use gdb to look at the structures as they're output. But what structures? DVDs are full of them, but most of the code doesn't use any structure declarations; instead you end up with things like:

  result = (buf [0] & 0x18) << (24 + 3);
  result |= (buf [0] & 0x03) << (24 + 4);
  result |= (buf [1] & 0xFF) << (16 + 4);

What does that mean? Good code has comments, but that doesn't help gdb much. When I look at this kind of code, I'm torn between “fixing” it to use proper structure declarations and just testing it. Today did a bit of both, very half-heartedly, and as a result had no results by the evening.

On Saturday I'm leaving for a trip to Gippsland to visit my father. I won't have normal computer access, so decided to set up my laptop for PPP connections; but it seems that FreeBSD hardly supports any laptop modems any more, and my Dell Inspiron 5100 doesn't seem to have any support. One of the down sides of free software, I suppose.


Friday, 2 February 2007 Echunga Images for 2 February 2007
Top of page
previous day
next day
last day

Into town today to talk with Geoff Richmond, my tax advisor. Suddenly it seems that getting older is an advantage: starting on 1 July I'll end up with a surprising number of tax breaks.

Then to pick up Yana, taking a look at her computer on the way. It's an Apple, running MacOS X, and it has no trouble with modem support, once the phone line is connected.

In the afternoon, Yvonne reported a strange mail bounce:

<ers@mubo.de>: host mail.mubo.de[192.109.53.125] said: 553 5.1.8
    <ers@mubo.de>...  Domain of sender address yvonne@lemis.com does not exist
    (in reply to RCPT TO command)

Nonsense! But I checked with whois and discovered that my domain registration had expired yesterday. Why didn't I get a reminder? In the past I've had reminders 60, 30 and 15 days in advance, but this time there was nothing. Managed to renew the domain—for one year only: I'm very dissatisfied with that service, and I'll need an explanation about why I wasn't informed.

Quiet evening. Yana had thought that she could find a comet, so outside in the dark on the verandah. No comet, but it was calm and warm, unusual here.


Saturday, 3 February 2007 Echunga –> Melbourne Images for 3 February 2007
Top of page
previous day
next day
last day

Off on the first leg to Maffra early enough today, without any particular problem—until my mobile phone reported low battery. I had planned for that, of course, and plugged it in to the car charger. Nothing happened. Stopped in Tailem Bend and confirmed that the fuse for the cigarette lighter had blown. Put in a new one, connected up and—it blew again! Damn. And because it “didn't make any sense”, I hadn't brought the mains charger, so now we're dependent on Yana's phone.

Decided to take the long way to Melbourne, via Mount Gambier and Warrnambool, like we did in October 1985. On that occasion we had left Adelaide at midday and were in Melbourne for a dinner invitation at 20:00, admittedly a bit of a stretch. Today we had left at 10:00, so decided to go via the Great Ocean Road and see the 12 Apostles.

Just outside Kingston SE, hit road works: 2 km of 25 km/h limit with nothing happening. At the other end, found a grader and a woman holding a “STOP” sign. Got out, asked her why they had to put the 25 km/h limit so far in advance. She told me that they were allowed to do it—apparently that was enough justification. Got back in the car and waited for her to turn the sign; instead, she started shouting obscenities at me. It gradually became clear that she wanted me to drive on, but she was still holding the “STOP” sign. Pointed that out to her—more obscenities—and just before I could get a photo of the whole stupid scene, she turned it around.

At the other end, they had people waiting for me wanting to know why I had been so abusive. Explained the situation, and they calmed down (and explained the length of the limit: the grader moves pretty quickly). But why do they have humans to hold signs? Traffic lights must be a lot cheaper.

Stopped off in Mount Gambier for lunch (“Red Rooster”—an experience, not to be repeated) and another view of the Blue Lake, this time living up to its name:


This should be blue-lake-4.jpeg.  Is it missing?
Image title: blue lake 4          Dimensions:          3504 x 2336, 1088 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 Saturday, 3 February 2007, thumbnails          All images taken on Saturday, 3 February 2007, small
Diary entry for Saturday, 3 February 2007 Complete exposure details

 

On to Warrnambool, where it became clear that our timing was out: left there at 17:45. We had told Audrey we would be in Melbourne at 17:00, and that was still 2½ to 3 hours away. Decided that we would have to give the Ocean Road a miss, and headed straight into Melbourne, getting caught up in traffic works on the way, so we finally arrived at Audrey's place just before 21:00. How did we manage it 3 hours faster in 1985?


Sunday, 4 February 2007 Melbourne –> Maffra –> Briagolong Images for 4 February 2007
Top of page
previous day
next day
last day

Up long after Audrey and Yana, and was rewarded with bacon and eggs—just what we needed before an early lunch in town. Off then to central Melbourne, which Yana had never seen, and ended up in the Victoria Market, for me the first time since I was a kid. Not the way I remembered it: most of the stalls were junk, and my recollection is that it used to be foodstuffs. I suppose it's different during the week.

Then walked around town a bit—another recollection of bygone days was the public library, which I used to frequent nearly 50 years ago. Again, I didn't recognize much, in this time I suspect because they had completely rebuilt the interior, taking over the old museum in the process.

Then to the West Lake restaurant in Little Bourke St. for some Yum Cha. Not bad, but not cheap either.

Finding our way out of town was not as easy as I thought; they had blocked off Victoria Parade, and the resulting traffic down Punt Road was terrible. Took us half an hour to find our way to the freeway entrance.

Uneventful trip down to Maffra, where we found my father—he has aged a lot since I last saw him nearly 2 years ago: he is less mobile, his eyes are worse, and he has other problems as well. In general, not a pleasant development.

Freda came in only shortly later, and we set off to Briagolong in two cars. Had a pleasant afternoon and early evening, spent on the verandah, something that we can't do too often at home because of the wind. Freda tells me that she does it almost all year round. Enough reason to consider moving here.

Took Dad back to Maffra, then back to Gill and Kline's house (next to Freda's) and spent some time talking before going to bed. My father's condition is giving everybody cause for concern.


Monday, 5 February 2007 Briagolong, and around Images for 5 February 2007
Top of page
previous day
next day
last day

Anther load of bacon and eggs this morning, this time cooked by Yana and myself. Freda has a thermostatically controlled electric frying pan, which on the face of it should be a great advantage over a flame, but in practice the thermostats in such devices have too much hysteresis. With a good, fast reacting system it might be a completely different matter.

Then with Freda to Maffra to talk to Dr. Baker, my father's GP, who gave us the results of a recent CAT scan and much to ponder. Then picked up my father for lunch—his walking is improving, anyway—after which Freda returned home and I set off round central Gippsland looking at the landscape. Maybe it was the high temperatures which started today, but it wasn't that impressive. Did a circle via Heywood, Traralgon, Rosedale, Longford and Sale back to Briagolong. Stopped off at the information office in Traralgon, where a very helpful person (Gerry? Glen?) gave me much more information that we got in Ballarat. In Rosedale saw an estate agent who actually had properties that might more or less fit our requirements, and there's also a big forest (Holey Plains state park) that looks like it would be suitable for riding. The area is also well irrigated—even now there are a number of relatively large rivers coming down from the High Country.

Dinner with Gill and Jasper in the evening—Kline was busy at a rehearsal and didn't return until later.


Tuesday, 6 February 2007 Briagolong –> Echunga Images for 6 February 2007
Top of page
previous day
next day
last day

Off home this morning, stopping first in Maffra to say goodbye to my father, then to look at the area round Lake Glenmaggie, of which I had seen a nice photo on an estate agent's prospectus yesterday. The reality looks a bit different:


This should be lake-glenmaggie-5.jpeg.  Is it missing?
Image title: lake glenmaggie 5          Dimensions:          2816 x 2112, 512 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 Tuesday, 6 February 2007, thumbnails          All images taken on Tuesday, 6 February 2007, small
Diary entry for Tuesday, 6 February 2007 Complete exposure details

 

Then on home through Melbourne, noting the times from leaving the South-Eastern Freeway:

Time Km Location Distance from last Speed
12:12 433.76 Toorak Road Exit
12:24 439.24 Bridge Road 5.48 27 km/h
12:32 441.50 Punt Road 2.26 17 km/h
12:44 445.74 Grattan St house 4.24 18 km/h
12:46 446.49 Flemington Road 0.75
12:57 452.03 Western Highway 5.54 29 km/h
13:04 Stop to refuel, leave at 13:12
13:20 462.13 Hume Freeway 40 km/h
13:31 475.63 Western Freeway 74 km/h
Total 41.87 35 km/h

The real nuisance is that there's a freeway connection from the South-Eastern Freeway to the Hume and Western Freeways. It's a toll road, which would probably still be worthwhile (I'd expect to save 45 minutes); but it doesn't have toll booths. You need to buy day passes in advance. What a crock!

This is a seriously suboptimal way, maybe. Six months later I found a much more direct way: not all the freeways are tollways, and in fact only about 6 km of the road needs to be off the freeway. Unfortunately, it was no faster. My guess is that the tollway would have saved a maximum of 15 minutes.

In Ballarat, decided to take an alternative route home, this time via Hamilton, which wasn't much longer. It also wasn't very interesting. Back home at 20:35 after doing about 1050 km for the day.


Wednesday, 7 February 2007 Echunga
Top of page
previous day
next day
last day

Spent most of the day documenting the trip and trying to catch up with my 3000 odd mail messages. One of them was the Bureau of Meteorology's monthly rainfall observations for January. I've already commented on their inaccuracy, but this takes the cake:

  MOUNT LOFTY RANGES (23C)
                              Rain (mm)      Rain Days   Decile
                             Obs  |  Avg     Obs | Avg
               Echunga       4.4    35.1       2     6      1
               Meadows      25.4    38.4       6     7      4

To the best of my knowledge, the BoM—incorrectly—reported no rainfall at all for Meadows in January. So this means that they have, at very least, corrected the situation, though I suspect 25.4 mm (exactly 1 inch) is too low. But they reported at least 39 mm in Echunga, above average, and the Mount Barker Courier reported 46 mm, apparently based on information from the Bureau of Meteorology; where did that go on this report?


Thursday, 8 February 2007 Echunga
Top of page
previous day
next day
last day

Spent a lot of time today researching my father's conditions. He has severe visual impairment, but he sees hallucinations, and people were concerned about his state of mind. Some years back I had read a book by V.S. Ramachandran called “Phantoms of the mind”, about how neurologists learn about the brain by observing people with brain damage. One chapter was dedicated to the Charles Bonnet Syndrome (pronounced the French way), which affects people with severe visual impairment, with or without damage to the visual cortex. It seems it's an attempt by the brain to fill in the lack of visual stimulus, and it's harmless once you recognize what it is.

More playing around copying MPEG-2 streams to DVD. One of the disappointing discoveries last week was that DVDs are not compatible with HDTV: the highest (PAL) resolution is 720x576. Looks like the best way to archive things is by simply splitting the MPEG stream into 1 GB chunks and burning a file system to DVD. Even so, most films won't fit onto a single layer DVD, but since they need to be copied back to disk to be played, I don't suppose it makes much difference. Started writing a chapter for a potential future book on how to burn multimedia data to DVD.


Friday, 9 February 2007 Echunga
Top of page
previous day
next day
last day

Yet another quiet day doing little. It's good to relax a bit. Burnt some DVDs—I still don't know how to change the resolution, but I'm sure there's something in my bag of junk.

Diane Saunders hasn't been feeling well lately, and today Yvonne went over and found her in very poor condition. Yvonne suspected a stroke and took her off to the Mount Barker Hospital, who couldn't diagnose the problem—which I suppose excludes a stroke—and carted her off to the Royal Adelaide Hospital. She was back home by the evening, but we still don't know what she had.


Saturday, 10 February 2007 Echunga
Top of page
previous day
next day
last day

Spent the morning finally reviewing papers for BSDCan 2007. There seem to be a surprising number of interesting talks; pity I won't be there. Apart from that, didn't do much. I have a lot of reading to catch up on, so started on that, but didn't finish.


Sunday, 11 February 2007 Echunga
Top of page
previous day
next day
last day

I've been contacted by Pierre Jammes, who has set up a web site DS in Asia about, well, Citroën DS (really D series) cars in Asia, and of course he was interested in my description of the Asia Trip. Spent some time updating my diary and otherwise documenting things, including my answers to his questions.

There's a new port out there, SipX, annoyingly called net/sipxpbx in the Ports Collection (to keep you on your toes, there's also sipxcalllib sipxcommserverlib, sipxconfig, sipxmediaadapterlib, sipxmedialib, sipxportlib, sipxproxy, sipxpublisher, sipxregistry, sipxtacklib and sipxvxml, all of which I think are dependencies. Why can't the main port just be called net/sipx? Decided to install it today, but didn't get far:

===== Sun Feb 11 12:55:52 CST 2007 on echunga.lemis.com: Make install
===>  sipxpbx-3.6.0 : Error from bsd.apache.mk.  apache13 is installed (or APACHE_PORT
is defined) and port requires 2.0+.
*** Error code 1

OK, it was probably time to upgrade from Apache 1.3 to Apache 2.2. Here's what I went through:

After that, try to install net/sipxpbx. The build fails with what looks like a valid error:

SIPXAuthHandler.cpp: In constructor `SIPXAuthHandler::SIPXAuthHandler()':
SIPXAuthHandler.cpp:172: error: no matching function for call to `ApacheHandler::ApacheHan
dler()'
/usr/local/include/apache22/apache_handler.h:50: note: candidates are: ApacheHandler::Apac
heHandler(const ApacheHandler&)
/usr/local/include/apache22/apache_handler.h:55: note:                 ApacheHandler::Apac
heHandler(ApacheServerRec*)
SIPXAuthHandler.cpp: At global scope:
SIPXAuthHandler.cpp:640: error: invalid conversion from `ApacheHandler*(*)()' to `ApacheHa
ndler*(*)(ApacheServerRec*)'

At this point, I gave up. This stuff should be easier.


Monday, 12 February 2007 Echunga
Top of page
previous day
next day
last day

Continued my work on the SipX port today; Martin Wilke sent me a patch which enabled me to build and install the port using Apache 2.2, and subsequently committed it. On the positive side, the install ended with a two page description of what to do to configure it. Here's the reality:

  1. Set up a mail user sipx in /etc/aliases:

    # Error messages from sipx
    sipx:           root
    

    newaliases gives an unexpected error:

    === root@echunga (/dev/ttyp8) /etc 47 -> newaliases
    postalias: fatal: open /usr/local/majordomo/aliases.majordomo: No such file or directory
    

    I haven't used majordomo for years, and it's not obvious where this is coming from. Run ktrace and discover that it's in /usr/local/etc/postfix/main.cf:

    alias_database = hash:/etc/aliases,hash:/usr/local/majordomo/aliases.majordomo
    

    This has nothing to do with SipX, of course.

  2. Create an SSL certificate. The instructions at that link say:

    mkdir $HOME/sslkeys
    cd $HOME/sslkeys
    /usr/bin/ssl-cert/gen-ssl-keys.sh
    
    gen-ssl-keys.sh will prompt for you for input including:
    
       1.  CA Common Name (DNS name for CA): Enter anything but NOT the DNS name of your server
       2.  SIP domain name: The domain name of your installation
       3.  Full DNS name for the server: Enter fully qualified hostname of your sipX server
    
    /usr/bin/ssl-cert/install-cert.sh
    

    The instructions aren't tailored to FreeBSD, of course. There is no directory /usr/bin/ssl-cert/; it's /usr/local/bin/ssl-cert/, which still looks wrong to me: should be /usr/local/ssl-cert/bin/. Once you find the script, it fills in most things for you; the only issue was the CA Common Name; the recommendations above prove to be confusing. What I got was:

    Identifying information for your private Certificate Authority (CA)
    
    CA Common Name (DNS name for CA) [ca.lemis.com] :
    
    Well, that's not my server DNS name, so I suppose it will do.
    === root@echunga (/dev/ttyp8) ~/sslkeys 44 -> /usr/local/bin/ssl-cert/install-cert.sh
    Checking the echunga.lemis.com certificate
    Installing ca.lemis.com.crt certificate as a trusted CA
    ca.lemis.com.crt -> /usr/local/etc/sipxpbx/ssl/authorities/ca.lemis.com.crt
    hashing /usr/local/etc/sipxpbx/ssl/authorities
    ca.lemis.com.crt => ed9cf9c3.0
    Installing the echunga.lemis.com certificate
    echunga.lemis.com.crt -> /usr/local/etc/sipxpbx/ssl/ssl.crt
    Installing the echunga.lemis.com private key
    echunga.lemis.com.key -> /usr/local/etc/sipxpbx/ssl/ssl.key
    Checking the installed certificate
    
      Your sipX SSL security is now configured.
    
      Your server certificate will expire Feb 11 01:50:52 2010 GMT.
    
  3. Next was DNS configuration, which on the Wiki is located in the middle of the build instructions. The good news is that the information is there; it caused me a lot of pain in my attempts to set up Asterisk.

  4. Setting up the web access (one of the great drawcards for SipX) was a surprise. From the instructions at the end of the install:

    You will also need to adjust your %%APACHEETCDIR%%/httpd.conf file.
            Ensure httpd runs as user sipx and group sipx.  Ala:
                    User sipx
                    Group sipx
            Change the document root to
                    DocumentRoot /usr/local/www/sipX/doc
            The <Directory > instance should match
                    <Directory "/usr/local/www/sipX/doc">
    

    That's impossible, of course. This is a real live web server. Instead, I did:

    === root@echunga (/dev/ttyp8) /usr/local/www/data 109 -> ln -s /usr/local/www/sipX/doc sipx
    

    There are also some changes to httpd.conf, including:

    Include /usr/local/etc/sipxpbx/httpd-sipxchange-common-ssl.conf
    Include /usr/local/etc/sipxpbx/httpd-sipxchange-common.conf
    Include /usr/local/etc/sipxpbx/httpd-sipxchange-configserver.conf
    

    That doesn't work too well:

    httpd: Syntax error on line 463 of /usr/local/etc/apache22/httpd.conf: Could not open conf
    iguration file /usr/local/etc/sipxpbx/httpd-sipxchange-common-ssl.conf: No such file or di
    rectory
    

    That's a semantic error at best, of course, not a syntax error. But the real problem is that the files don't exist; there are only vanilla versions with the suffix .in.

  5. Copy the .in files to the base name, and then re-start apache:

    === root@echunga (/dev/ttyp8) /usr/local/etc/sipxpbx 121 -> apachectl graceful
    Syntax error on line 30 of /usr/local/etc/sipxpbx/httpd-sipxchange-common-ssl.conf:
    Invalid command 'nokeepalive', perhaps misspelled or defined by a module not included in
    the server configuration
    
    Reading the file, I discover:
    # mod_ssl has problems with HTTP 1.1
    # Force browsers to use HTTP 1.0
    SetEnvIf User-Agent ".*MSIE.*" \\
                 nokeepalive ssl-unclean-shutdown \\
                 downgrade-1.0 force-response-1.0
    
Round about here I decide to give up:

This is most certainly not an “out of the box” installation.


Tuesday, 13 February 2007 Echunga
Top of page
previous day
next day
last day

Somehow I couldn't face the prospect of looking at Asterisk today, so turned my attention towards some issues I have with mplayer:

Did a bit of work on a more general on-screen display routine and tried to compile it. There's been a new release of mplayer since the last time I worked on it, and it no longer compiles at all out of the box: it seems that something has changed in the FreeBSD Ports Collection, and mplayer no longer compiles under releases as recent as 6.2-PRERELEASE. Frustration.

Chris Yeardley showed up in the evening for a couple of days.


Wednesday, 14 February 2007 Echunga
Top of page
previous day
next day
last day

Chris Yeardley is here, so we had to go out for a ride, despite the relatively high temperatures forecast. In fact, the temperature was only about 25°, and things weren't too bad, but Yvonne and Chris were both riding very young horses, so we went slowly and not very long.

It would have to be that I got a load of work (MySQL problems) to work on while Chris is here. Spent the rest of the day on them, but only got half way.

Di Saunders over for dinner; she's feeling better now after her problems last weekend.


Thursday, 15 February 2007 Echunga Images for 15 February 2007
Top of page
previous day
next day
last day

More work on MySQL today, mainly things like tuning and performance, things I've never looked at before. Fortunately there's a lot of documentation out there; most of it appears to be a matter of correlating the various suggestions.

The weather forecasts are as accurate as ever: no rain predicted for at least a week, and temperatures up to 40°. That didn't stop us getting rain, apparently out of a clear sky; the clouds developed later. The result was glistening rain:


This should be rain-3.jpeg.  Is it missing?
Image title: rain 3          Dimensions:          2112 x 2816, 1104 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 Thursday, 15 February 2007, thumbnails          All images taken on Thursday, 15 February 2007, small
Diary entry for Thursday, 15 February 2007 Complete exposure details

 


Friday, 16 February 2007 Echunga Images for 16 February 2007
Top of page
previous day
next day
last day

Chris left early this morning, taking La Tigre and Luna with her:


This should be loading-2.jpeg.  Is it missing?
Image title: loading 2          Dimensions:          2816 x 2112, 1776 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 Friday, 16 February 2007, thumbnails          All images taken on Friday, 16 February 2007, small
Diary entry for Friday, 16 February 2007 Complete exposure details

 

Now we're down to four horses, the fewest we've had in years.

Spent most of the day working on my system installation procedure, something I've been working on for nearly 3 years. The work on the Black Box has helped focus the effort, and now I have a make-based installation procedure that looks like it could work relatively well. The work was not helped by the failure of several ports to compile—and that on a virgin system.


Saturday, 17 February 2007 Echunga Images for 17 February 2007
Top of page
previous day
next day
last day

One of the surprisingly popular pages on my web site is my quick and easy beer page. I wrote it some time ago, and only recently—due to lack of time to do it right—tried it out. Of course there were lots of things I needed to change, including the fact that, for a first step, it was probably too difficult. Today split the page into two; the version on the original page is now about the absolute minimum needed to make a reasonable beer from the ingredients supplied in kits (notably, not fermenting at the positively idiotic temperatures—25° to 35°—that all kit manufacturers seem to recommend), and putting suggestions for improvement in a separate page.

After putting the web site up, monitored the hits. The hits on the base page continued at their usual rate, of course; the hits on the suggestions for improvement ran at less than 5%. That's sad, but it confirms that I was correct in going back to basics.

Apart from that, a little work on the system upgrade stuff. Still running into strange problems with the checkout. Left that for another day and watched TV.


Sunday, 18 February 2007 Echunga
Top of page
previous day
next day
last day

Finally had time to look at my mplayer mods today.. It took me all day:

What a pain! After all that, I didn't have any desire to continue. But I'm close.

So what do the changes do?


Monday, 19 February 2007 Echunga Images for 19 February 2007
Top of page
previous day
next day
last day

More work on the mplayer mods today. The problems with lirc proved to be due to the fact that they seem to have made some far-reaching changes in the new version of lirc, so clients that talked to the old version can no longer talk to the new one. They haven't fixed any of the problems I have seen, however; my patches applied with no problems.

Yana along this afternoon with her boyfriend Sundance. Spent most of the evening cooking:


This should be cooking-4.jpeg.  Is it missing?
Image title: cooking 4          Dimensions:          2816 x 2112, 512 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 Monday, 19 February 2007, thumbnails          All images taken on Monday, 19 February 2007, small
Diary entry for Monday, 19 February 2007 Complete exposure details

 
This should be cooking-3.jpeg.  Is it missing?
Image title: cooking 3          Dimensions:          2816 x 2112, 576 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 Monday, 19 February 2007, thumbnails          All images taken on Monday, 19 February 2007, small
Diary entry for Monday, 19 February 2007 Complete exposure details

 
Tuesday, 20 February 2007 Echunga
Top of page
previous day
next day
last day

Finally got as far as to build the mythtv port again; I've had a number of updates to make, but I first wanted a repeatable platform to do it on. At least I now have that for the software; to get it running properly, I need to put in a tuner as well. I have plenty of these—at the moment a total of 5, of which 2 run under FreeBSD. But they don't fit in the low-profile machine I have, so I'll have to do some hardware rearrangement first.

The weather forecast is its usual accurate self. For today, it was:

What happened was in fact a dry morning, then a thundery shower round here, to the south-east, in the mid-afternoon. Of course it caused multiple power failures in the process of which I discovered that yet another UPS has died. This is getting very frustrating, and this time took up enough time that I had to miss yet another board meeting of the ICT Council for South Australia.


Wednesday, 21 February 2007 Echunga
Top of page
previous day
next day
last day

Strangely, I now have five TV tuner cards available: two el-cheapo analogue ones, the Hauppauge PVR-250 from the Black box, and two DVICO DVB-T cards. Of these, I can currently only use one, one of the DVICO cards. For reasons already documented, the second identical DVICO card doesn't work properly. And FreeBSD doesn't have support for them, nor for one of the analogue cards. Decided to kill two birds with one stone and put the Hauppauge and the other “functional” analogue card, a BT 878 based card apparently called “TV Excel” which I thought I had got to work, after a fashion, about 2 years ago. FreeBSD's bt878 driver has improved over the years. Last time I tried, I had to find the tuner type manually; now the probe finds it.

That's about all that worked, though. Try as I might, I wasn't able to find any TV stations, no matter what card type I tried. It's not clear from my logs whether I was able to do so at the time, though I had thought so. In any case, I also have a project to move the pvr250 driver into the kernel, so tried installing that from the Ports Collection. That didn't work either: in the meantime, module builds have become more pedantic, and the code contains some const variables that get passed as parameters to system functions defined without const. Spent far too much time trying to find how the Makefiles decide to issue a -Werror flag to the compiler, but finally gave up and appended a -W-no-cast-qual flag to the Makefile. Then it built, and I just needed a new kernel, with the result that I didn't make any further progress today. Pedanticism makes for good code, but it can also certainly waste a lot of time.


Thursday, 22 February 2007 Echunga
Top of page
previous day
next day
last day

Some years ago I had a subscription to “The Economist” which included an email service. Due to complete brokenness on the part of their mail and DNS, I never got any of the service for which I had paid for, and they ignored my complaints. I didn't renew the subscription, and was left considerably disappointed with the company.

But it's not over! Today I got spam addressed to gregecon@lemis.com, an address that I only ever divulged to The Economist. Sent a message to their abuse department, but I doubt I'll get a response:

This spam has nothing to do with me, except for the fact that it claims:

> X-Postfix-Sender: rfc822; gregecon@lemis.com

This is a mail address that I have only ever used in connection with my subscription to "The Economist" in 2002-2003. The fact that the name has now surfaced suggests that you have somehow divulged this information to third parties. Please explain.

I have now disabled this address, though this doesn't stop third parties from abusing it. Please reply to the address above.

See http://www.lemis.com/grog/diary-feb2007.html#22 for a public discussion of this issue. I will also report whether you reply to this message or not. If you reply, please indicate if you do not want the reply to be published, and in this case why.

More playing around with the analogue tuners. Loaded the cxm driver for the Hauppauge card and ran scantv against it; again nothing was found. Tried various alternatives and got nothing, until I tried:

=== grog@tv2 (/dev/ttyp1) ~ 4 -> pvr250-setchannel -m 8 7
=== grog@tv2 (/dev/ttyp1) ~ 5 -> cat /dev/cxm0 > foo
^C
=== grog@tv2 (/dev/ttyp1) ~ 6 -> l foo
-rw-r--r--  1 grog  wheel  65638336 Feb 23 10:05 foo
=== grog@tv2 (/dev/ttyp1) ~ 7 -> file foo
foo: MPEG sequence, v2, program multiplex

mplayer confirmed that the content was a broadcast TV stream. So it seems that scantv doesn't understand the cxm driver, and in true multimedia tradition ignores any problems.

Moved on to trying to set up MythTV with the PVR 250. I never cease to be amazed. In the course of testing, discovered:

Discussed the matter on IRC; we're all agreed that most multimedia software is a complete pain. It's so tempting to write your own; but there's a lot of good stuff in mythtv, so it's difficult to know which way to go. As the Germans say, außen hui, innen pfui.


Friday, 23 February 2007 Echunga
Top of page
previous day
next day
last day

Did a bit of investigating the ioctl calls in the cxm driver, and quickly came to the recognition that they were, indeed, incompatible with MythTV. Investigated the possibility of adding them, and found the list (without comments, of course) in libs/libmythtv/videodev2_myth.h—all 57 of them, many referencing a struct v4l2_foo. Decided that that was too hard and moved on to confirm the installability of the package, in the process running portlint, which is supposed to check the correctness of a port. Some of the things it does are just plain stupid. It's clear that the sequence of declarations in a Makefile can have an influence on variables, especially when using constructs like ?=, but portlint considers the following to be a fatal error:

COMMENT=    MythTV is a homebrew PVR project
BUILD_DEPENDS=  qmake:${PORTSDIR}/devel/qmake \
        ${SITE_PERL}/${PERL_ARCH}/XML/Parser/Expat.pm:${PORTSDIR}/textproc/p5-XML-SAX-Expat

LIB_DEPENDS=    mp3lame.0:${PORTSDIR}/audio/lame \
        freetype.9:${PORTSDIR}/print/freetype2

There must be an empty line after the COMMENT definition. It also complains here that LIB_DEPENDS must come earlier in the Makefile (before BUILD_DEPENDS). But if you do that, it complains that BUILD_DEPENDS must come earlier. There doesn't seem to be any way to make it happy.

Later in the day heard from Stacey Son, the original author of the MythTV port. He confirmed that the cxm driver in its current form doesn't work with MythTV, and sent some patches. More work to do.

My mail to The Economist bounced: they don't have an abuse@ address. Searching the web page brought no useful contacts, so ended up spamming every address that wasn't obviously completely wrong, getting an automatic reply saying “your letter will be considered for publication”, and another one from the Asia-Pacific office apologizing for the inconvenience and promising follow-up. That's more promising, anyway.


Saturday, 24 February 2007 Echunga Images for 24 February 2007
Top of page
previous day
next day
last day

Spent some time today working on Stacey Sun's patch to the cxm driver. It's a couple of years old, and although it applied cleanly, it seems that one of the structures has changed. It contains the following line:

        const struct cxm_codec_profile *cpp;

...

                 codec->audio_bitmask = cpp->audio;

Unfortunately, there is no longer a member audio in struct cxm_codec_profile. Compiled anyway, but didn't get much tested.

It's been three months since our local BiLo supermarket was taken over by Coles. At the time I wasn't happy, but I thought I'd give them the benefit of the doubt. They've had that now, and have used up what good will I had left. Yesterday Yvonne bought some sausages labelled as “French Toulouse-style”. We should have been on our guard that they were sold for the barbecue—Toulouse sausages are typically used in cassoulet. It was clear the moment we opened the package that something was wrong, but it wasn't until I had grilled them that we found out how thoroughly disgusting the things are, a tasteless composition of gristle, cartilage and undefinable other meat parts with added “smoke” flavouring completely unrelated to the suacisses de Toulouse. You'd think they wanted to make the French look bad. A good justification for the actions in many European countries to protect place names from abuse elsewhere.

That's only one of the things we've had recently. On Monday Yvonne will return not only the sausages, but also some Feta cheese that tastes like polystyrene foam and rotten grapefruit:


This should be sausages.jpeg.  Is it missing?
Image title: sausages          Dimensions:          2816 x 2112, 608 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 Saturday, 24 February 2007, thumbnails          All images taken on Saturday, 24 February 2007, small
Diary entry for Saturday, 24 February 2007 Complete exposure details

 
This should be cheese-1.jpeg.  Is it missing?
Image title: cheese 1          Dimensions:          2816 x 2112, 400 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 Saturday, 24 February 2007, thumbnails          All images taken on Saturday, 24 February 2007, small
Diary entry for Saturday, 24 February 2007 Complete exposure details

 
This should be grapefruit.jpeg.  Is it missing?
Image title: grapefruit          Dimensions:          2816 x 2112, 736 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 Saturday, 24 February 2007, thumbnails          All images taken on Saturday, 24 February 2007, small
Diary entry for Saturday, 24 February 2007 Complete exposure details

 

We'll keep the coconut cream; although it's not marked as “lite”, it contains 50% more water than the cream I bought at Woolworths 3 months ago.

Coles clearly has the advantage of location, but is that enough? I'm really surprised how bad their products have turned out to be. In general foodstuffs have got much better in the last few decades.


Sunday, 25 February 2007 Echunga
Top of page
previous day
next day
last day

Had intended to take it easy today, but somehow that didn't happen. Instead, finally got hold of a new version of the Hauppauge driver and tried to install it on tv2, my current test box. It installed without too much trouble, but then paniced out of msleep with the message sleeping without a mutex. Strange message! We used to have the opposite problem. Tried to get a dump, but the system hung. How long has it been since I've been able to get a processor dump reliably? Once upon a time the command panic out of ddb would do it for you, then we had to issue a call doadump, but today the dump hung in each case.

Decided to set up a firewire debugging session, but that doesn't work either any more unless you have firewire compiled into the kernel. Another afternoon's work bringing the system up to date and building a kernel.

In the meantime, looked at a couple of other issues: on VOB files copied from DVDs, my version of mplayer always showed the elapsed time as being equal to the total time. Tried recompiling it, again running into strange issues with asm directives that took me some time to fix, and also issues with debugging symbols. Somehow things used to be easier. Once I got that done, the problem was obvious: a simple cut-and-paste-o.

Also looked at my record program, which I had written specifically for the Linux DVB interface. Now I can use the Hauppauge card, I needed to get it to work for that as well. That took surprisingly little time and worked—almost correctly—first time.


Monday, 26 February 2007 Echunga Images for 26 February 2007
Top of page
previous day
next day
last day

More work on the cxm driver today, and came up with a patch that worked around this strange feature in msleep. This is almost close enough for me to be able to put it into the source tree.

Back to play around with mythtv-setup, which frequently displays in incorrect colours on remote systems. It now recognizes the tuner and can set it up; but the setup is so non-intuitive that I didn't make it. Yet another day's work.

Also tried a couple of approaches to video editing. I had tried LiVES earlier, and it didn't compile. Now I got it to compile, but on starting and trying to edit an 8 GB MPEG of a TV programme, was presented with a warning that it's not optiimized for large files. That's an understatement: it calls mplayer to convert every frame to a JPEG. I don't have enough disk for that, let alone enough time.

Then tried Jahshaka, which ran a lot faster:

=== grog@tv2 (/dev/ttyp0) /spool/Images 3 -> jahshaka bridget-jones
preferences are ok...
QLayout: Adding QLabel/unnamed (child of QFrame/unnamed) to layout for QFrame/unnamed
QLayout: Adding QProgressBar/unnamed (child of QFrame/unnamed) to layout for QFrame/unnamed
QLayout "maindesktopLayout" added to QHBox "desktop", which already has a layout
QLayout "Form1Layout" added to QHBox "unnamed", which already has a layout
(many repeats)

It ignored the file name on the command line, of course, and when I selected “Load” it was clear that it also ignored the current directory, giving me /usr/X11R6/lib/jahshaka/media, in which it apparently really intends to store media data. I couldn't change the path name, though: when I moved the mouse cursor to the window, I got:

Segmentation fault: 11 (core dumped)

A gdb session shows a 43 frame back trace through the Qt libraries, starting with:

#0  0x29e6325b in parse_fontdata () from /usr/X11R6/lib/X11/locale/lib/common/xomGeneric.so.2
#1  0x29e634be in parse_vw () from /usr/X11R6/lib/X11/locale/lib/common/xomGeneric.so.2
#2  0x29e64062 in create_oc () from /usr/X11R6/lib/X11/locale/lib/common/xomGeneric.so.2
#3  0x28c1e914 in XCreateOC () from /usr/X11R6/lib/libX11.so.6
#4  0x28c1dd5c in XCreateFontSet () from /usr/X11R6/lib/libX11.so.6
#5  0x285d49f8 in getFontSet () from /usr/X11R6/lib/libqt-mt.so.3
#6  0x285d4cb5 in QInputContext::setXFontSet () from /usr/X11R6/lib/libqt-mt.so.3

Probably a configuration error, but somehow I just can't be bothered with this kind of mess.

On the trip to Victoria I had been concerned by some strange noises from the suspension of the Commodore. Today I finally jacked it up and took a look:


This should be commodore-2.jpeg.  Is it missing?
Image title: commodore 2          Dimensions:          2816 x 2112, 496 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 Monday, 26 February 2007, thumbnails          All images taken on Monday, 26 February 2007, small
Diary entry for Monday, 26 February 2007 Complete exposure details

 

What's that? A shock absorber? The rod obviously fits into the slot to the right, and it has come loose. Strange that we first noticed it after picking it up from the last service.


Tuesday, 27 February 2007 Echunga
Top of page
previous day
next day
last day

Mail from John Baldwin about the panic out of msleep today. He got me thinking. As dmr confirmed, the basic process synchronization primitives for UNIX have been sleep and wakeup since the PDP-7 days. A process initiates something and then calls sleep; the interrupt handler calls wakeup when it's done. The problem is that the interrupt handler might be so fast that it calls wakeup before the initiating process calls sleep, a classic race condition.

Traditional UNIX handles this situation by locking out interrupts until sleep is called. Here some code showing the paths traversed by the Third Edition vt driver (dmr/vt.c) dated 20 January 1973:

vtwrite()
{
    int c;
    int register count;

    while (cpass(&c) >= 0) {
        retry:
        for (count=0; count<10; count++)
            if ((VTADDR->csr&RQINT)==0) {
                VTADDR->buf = c&0377;
                VTADDR->csr =| RQINT;
                goto contin;
            }
        spl5();
        if (VTADDR->csr&RQINT) {
            vtflag++;
            sleep(VTADDR, VTPRI);
        }
        spl0();
        goto retry;
    contin:;
    }
}

Here the call to spl5 locks out interrupts of a priority lower than 5, presumably including the vt interrupt handler. The priority is dropped before the process is completely suspended. From ken/slp.c:

sleep(chan, pri)
{
    int s;
    register *rp;

    s = PS->integ;
    if(pri >= 0) {
        if(issig())
            goto psig;
        rp = u.u_procp;
        rp->p_wchan = chan;
        rp->p_stat = SWAIT;
        rp->p_pri = pri;
        spl0();
        if(runin != 0) {
            runin = 0;
            wakeup(&runin);
        }
        swtch();
...

The problem in FreeBSD is that we no longer use the spl method of interrupt lockout. Instead, we use mutexes. It looks as if it should be pretty easy to use the same method with mutexes, but it's not as simple as that: the spl approach required work only in the “top half” of a driver, since it ensured that the bottom half couldn't run during that time. With mutexes you need to hold them on both sides. I need to find where and how to document this effectively; certainly it shows that yesterday's “fix” for the cxm driver was no such thing, just a workaround for the assertion.

More work on getting MythTV set up today. Tried to revive the MythTV HOWTO page that I started on for Linux nearly a year ago and then gave up because it was so much pain. That page is very much Linux-related, so decided to make a separate FreeBSD HOWTO page. The good news is that it's much easier. Got as far as the mythfilldatabase step, which produced much output and ended with:

===============================================================
| Attempting to contact the master backend for rescheduling.  |
| If the master is not running, rescheduling will happen when |
| the master backend is restarted.                            |
===============================================================
2007-02-27 14:24:06.099 Connecting to backend server: 192.109.197.177:6543 (try 1 of 5)
2007-02-27 14:24:06.101 Connection timed out.
                        You probably should modify the Master Server
                        settings in the setup program and set the
                        proper IP address.

Further investigation showed that, though my port installs permissions for user mythtv on the local host, it doesn't (and shouldn't) install them for remote access, which for MySQL includes TCP access from the same machine. For security reasons you need to set that up manually. But as usual, the error message was completely wrong.

The next step was to get tuner data. The MythTV port depends on XMLTV, but for some reason that port doesn't include tv_grab_au port. Spent the rest of the afternoon making a port for that.


Wednesday, 28 February 2007 Echunga
Top of page
previous day

Still more work on MythTV today, mainly documenting what I did. I still don't really understand the internal connections; probably a diagram would help. Got as far as configuring a tuner input and confirming that it knew the correct channels, but on leaving mythtv-setup, I got a message saying “Your tuner is set to start on channel 3, which doesn't exist. Fix?“. I replied “Yes”, and it went away and did nothing for a while, but didn't fix it. I stopped mythtv-setup, restarted it and manually set the tuner to start on channel 28, which does exist. On exit, I got the same message about channel 3, and when I ran mythfrontend it also tried to set channel 3. Head-scratching time. I suspect that it's trying to use a different input.

Also had a couple of problems with the new driver:

wakeup_one considered harmful?

While thinking about the traditional sleep/wakeup synchronization model, it occurred to me that there's an issue with the newer function wakeup_one, which was introduced to deal with the thundering herd syndrome.

The problem with wakeup is that it wakes up all processes (or threads) seeping on a particular address. In the past, few processes slept on a specific address, but Internet servers such as web and mail servers have changed that. The problem we have now is that we could have hundreds or even thousands of threads sleeping on a particular address. When the event occurs, wakeup wakes them all, though only one thread can handle the event. The first thread to be woken grabs the event and processes it; the remaining ones are scheduled long enough to discover that there's nothing to be done, and go back to sleep. The overhead for hundreds of threads going through this cycle for every connection to a web server can be crippling, and has given rise to the term “thundering herd”.

There's quite a simple solution to this problem: if only one thread can handle the event, only wake one thread. That's exactly the purpose of the function wakeup_one, and it works well. Clearly there are situations where all threads need to be woken, but when multiple processes are waiting on a read on the same socket, for example, you don't need to do so.

There is an issue with wakeup_one, however: threads call sleep or msleep with an address of their choice. Typically this should be the address of a structure that they control, but the system places no restrictions on this. With wakeup, an address collision causes no problems beyond (usually slight) performance degradation: if a thread is woken and finds that the condition on which it is waiting hasn't been fulfilled, it goes back to sleep again. When the thread for which the condition is fulfilled is woken, it runs. This works even for bogus conditions where no thread is waiting.

With wakeup_one, things are different. It's first come, only served. In the same situation, if the chosen thread is not the one that is waiting for the condition, it ignores it as before. But the one that is waiting doesn't get scheduled: it hangs. Clearly the choice of wait address is much more critical for wakeup_one than it is for wakeup.

Currently the FreeBSD 6-STABLE kernel has 458 calls to wakeup and only 30 to wakeup_one. At some point, people will migrate more calls to wakeup_one, and there's a danger of hangs as a result. So I added the following text to the kernel man page sleep(9):

The wakeup_one function does not work reliably if unrelated threads are sleeping on the same address. In this case, if a wakeup for one group of threads is delivered to a member of another group, that thread will ignore the wakeup, and the correct thread will never be woken up. It is the programmer's responsibility to choose a unique chan value. In case of doubt, do not use wakeup_one.

So far so good, right? But there's been a surprising amount of disagreement in the FreeBSD project. It seems that I'm being alarmist, or pointing at theoretical cases which could never really happen. I suppose that would change if somebody were to write a rogue device driver that causes a denial of service in this manner.


Top of page Previous month Greg's home page Today's diary entry Next month Greg's photos Copyright information

Valid XHTML 1.0!

$Id: diary-feb2007.php,v 1.45 2011/04/13 02:51:25 grog Exp grog $