2014-09-08

HPV Vaccines Not Proven To Be Unsafe, Or, In praise of the Wise Sages Goldacre and Harford...

We were passed the following link and asked for thoughts. We have a child who is of age to join the NHS HPV Vaccination programme:


Summary of Objection

If we take what's asserted in this link, and combine it with the important numbers it doesn't provide to give total population information, the numbers given in this link suggest your child might be 10 times safer after taking the vaccine than she would be if she didn't. 

This evidence is in direct conflict with the conclusion the link itself wishes to portray of a drug of questionable efficacy and safety.

Background to the Objection


Thanks to years of reading popular science writings, and in particular thanks to Ben Goldacre's Bad Science and Tim Harford's work on the Radio 4 show More or Less, I am no longer able to read such links without at least a cursorial attempt to work out what's not being said.

I could tackle the material in a visceral, emotional way, based on what we know of the context of the link and it's material, especially in reaction to the source country's known political and anti-vaccination movements. But in a poor imitation of the two Sages I venerate above, let's try some Science and Statistics instead...

Analysis of the article's assertions


The core arguments made to support the (simplified) conclusion "Gardasil is Bad, M'Kay?" in the article are:
  • 30,000 adverse effects reported for takers of the vaccine in about 7 years, of which:
  • 1600 were serious or life-threatening, 
  • 136 people who took the vaccine subsequently died.

These are scary numbers. BUT we're missing vital context:
  • How many people were vaccinated with the drug?
  • What is the chance of someone dying during the appropriate period anyway?
Because the source link came from the US, I'm going to assume for the rest of this work that all figures will apply to the US only. I'm not convinced my source materials (I'll embed links) are entirely consistent in this, but I'm fairly happy that my numbers will be in the right order-of-magnitude, and I'll try and prove that this is Good Enough to come to some supportable conclusions.


Let's start by answering the "background radiation" question: Given this Vaccine is aimed at girls between about 12 and 20, what's the chance of a girl of this age-group dying of any cause?

  • This link suggests a "background rate" of 11 deaths per 100,000 for under-20s in the US. But that's boys and girls. Let's say the rate is about 5 girls per 100,000, per year.
  • The US census estimate an average teenage population of 42 Million (boys and girls) between the ages of 10 to 20 
We can then multiply the two together:
  •  (21,000,000 / 100,000) * 5 = about 2,160 female deaths per year.
And, just to be clear, we'll call this the "background rate" - it's deaths from all causes, averaged out across the whole US (interestingly, go look it up, most of these will be from car accidents even though they massively favour testosterone=infused boys. Why aren't we making a fuss about Our Precious Children driving these lethal steel boxes? But I digress).

This doesn't make the 136 deaths linked to Gardasil over 7 years doesn't sound too bad after all, when compared to the expected 15,000 females killed from all causes over that time-span. But let's be rigorous, as we don't yet know the percentage female population given the drug. We can put a lower-boundary on this, though, in order to decide when to start worrying:
  • 136/7 = ~20 deaths per year linked to the vaccine
  • 20/2160 = 0.9% of annual deaths
...So, even without tackling the central problem with the statement "20 people per year taking Gardasil die" (which is, to be clear,  that no-one's attempting to prove whether those deaths have anything to do with the drug), we can be fairly confident that if we discover that Gardasil is given to more than about 1% of the female target population, the death rate is unaffected by the drug. So we need more numbers.


 Wikipedia says 57 million doses were given in roughly the same timescale as the adverse reports, which gives a reasonable upper bound on the number of girls affected. We need to add to this that the standard drug regime has been 3 administered doses per person over a 12-24 month period, so we can estimate that:
  • 57,000,000 / 7 / 3   = ~2,700,000 girls given the drug per year
I should be clear that this number is not geographically-bounded, and it's not absolutely clear whether those doses were all administered, vs just manufactured and/or distributed. But it's what we've got to work on. 

At any given time, the female target population aged 10-20 in the US is about 20,000,000 so we can estimate that about 13% of the female population has been being (fully) vaccinated (note: the Wikipedia link referenced above states that about 33% of girls in the US are currently receiving at least 1 dose, so we've immediately got a conflict of information). 

All of a sudden, this turns the study on it's head. Let's do the sums:
  • We know the chance of an average girl dying in the US, per year, is about 1 in 20,000
We can now calculate the chance of a girl taking the vaccine dying as:
  • 1 / (20 / 2,700,000) = about 1 in 135,000
Or, in other words, according to the material given in the link itself, my child is around 10 times less likely to die after being given the vaccine than she would otherwise.

But my analysis is flawed, because without evidence I've asserted all doses administered to US Girls.  Let's assume only half the doses went into the arms of US girls. This doesn't change matters much: it only means my beautiful daughter is 5 times less likely to die with the vaccine than not. If only 10% of the doses were administered to US girls, then without anything else changing we can still say the drug's not affected the chance of your child being killed this year.

And that in itself is a very simplistic view, because it's based on an assumption that 90% of the doses of the drug went either unused or into the arms of girls from other parts of the world who we've implicitly assumed have a 0% death rate, which is patently false. And we've already got information that suggests the number of vaccinated kids in the US is much higher than my 13% figure so the error could very well go the other way making my kid even safer than I've calculated...

All of which is to say that my analysis is, I am happy to confirm, wrong. But it's probably not more than an order-of-magnitude wrong, and even if that's the case my central refutation of the source material stands.

Conclusions


At this point, I've done enough Science and Statistics to stop worrying about what the article's trying to tell me, because it's clearly not being backed up by sufficient facts to make it's argument robust. I probably ought to tackle the "incapacity rate" number (1,600 over 7 years) to strengthen my case, but I just can't be bothered: The central thesis of the link is that I should be scared of giving my daughter this vaccine because it might do her harm, but the "facts" it quotes to support that thesis suggest the exact opposite. I see no reason to believe it's assertions over serious harm are just as flawed.

But let me be absolutely clear: I'm not suggesting that the HPV Vaccines are some sort of wonder-drug that magically improve your kid's chances of survival, and I'm not going to make any assertions of the efficacy or safety of the drugs concerned. All I've sought to do is to tackle the fundamental gaps present in the information presented by the source link and see if they can be supported by available evidence, and my conclusion is that they can't, and that the authority of the assertions made and conclusions drawn by that article are therefore, at best, questionable.

All I'm trying to suggest is that you should take the claims made in the source link with a VERY large pinch of salt and back them up with a decent review of other materials when making your decisions. 

2014-07-14

London to Brighton Night Ride 2014 - Trip Report

Anyone who's been tracking the Twitter and Facebook updates I've been making probably has most of this, but I thought I'd put it all down in one place for my own reference purposes...


Motivation

Since Patricia did the L2B day ride in 2011, we've had a bit of a family thing going for supporting the BHF London 2 Brighton rides. I did the day ride in 2012 (and wrote it up here), we both did the day ride in 2013 with friends (and didn't really enjoy it due to the traffic), and I did the Night Ride last year with a friend and really enjoyed it. 

So I was keen to do it again - so keen, in fact, that I signed up last September, although that was after a couple of beers and enthusiastic blather in a hotel bar with friends and colleagues. Take it as a sign of my enthusiasm and not poor judgement.

I was initially hopeful to get a crowd doing it this year, but for various reasons that never happened. This wasn't really a spirit damper but it did change the character of the ride for me.

Preparation

I've got two modes of preparation for bike rides: Just Sufficient (2012) and Far Too Much (2013). This year fell somewhere in the middle, due to the nasty weather at the start of the year, some minor illness and one or two bouts of laziness on my part. But for the last couple of months I've been out at least once a week, I've done a couple of 50-mile rides to prepare (never quite satisfactorily; they were very tiring and at the limits of my endurance), and thanks to a good friend's encouragement I've even done some off-road cross training. 

I've also gotten off the fence and made a couple of investments in the bike. The first was to get some SPD clip-on pedals. These things are fantastic - just as everyone has been telling me for years - and if you've never tried a ride without tying your feet to the bike you don't know what you're missing. Hills become easier and faster to climb, power can be put down more evenly around the pedal stroke, and you run the risk of collapsing in a heap every time you come to a stop thanks to forgetting to unclip. They're great!

The second change was to get some better lights. I've dithered between the light-of-a-thousand-suns offroad type and just something sensible and long-lived. Since I've done and hope to do a bit more commuting on the bike, being sensible won out and I got a nice set of LED USB-rechargeable lights that throw out a decent beam at the front and blink forever on the back. 

Finally, as a bit of a last-minute change, I bought a new seat for the bike last Tuesday. I've had trouble with my seat for years, it's not so much the ho-ho-ho razor-blade-not-saddle effect as that the geometry caused cramp and numbness in various parts of my thighs and...other areas... after a long ride. I dithered in the bike shop for quite a while wondering whether to go big on a hi-fallutin' gel seat, but in the absence of any advice or ability to try out, I went for another cheapo seat with a noticeably thinner profile on the grounds that a *change* is as good as an *improvement*.

Pre-Start

Gary the Gerbil smiles for the camera
One of the things that I find hard to grapple with is that you've got a whole normal day before you start your preparation for the ride. So I took youngest swimming (as normal), then we all went out to see her perform in the local Dance School's show, then I came back and had a bit of a lie down, we played with the gerbils a bit, all had dinner, then they went out to a party and I got on with packing my stuff. I didn't leave home until 21:00, which frankly is about the time I'd be looking for a bit of telly before bed on most nights.





This year's pre-departure shot
I got the train up to Waterloo, as before, with the bike and as before I was joined at Woking by another couple heading to the start line. It was their first time at it and they seemed nervous. We didn't talk a huge amount but we shared some concerns about the weather forecast and wished each other well.

I was also astonished and delighted to find I'd gotten some responses to my initial tweets from the train from my old friend John who couldn't ride this year but was spending the weekend in London, with a bike. He offered to see me at the start line - south side of Tower Bridge, an offer I couldn't and wouldn't want to refuse.


Start-Line Selfies
The ride from Waterloo to Tower Bridge was as odd as I expected, although there was more (vehicular) traffic than I was hoping for. I'm not a fan of city riding and at night it's not a favourite thing to do. I have respect (some) for those that do it regularly but even on that short 2.5Mile trip I came across red-light jumpers, and one memorable girl on a bike with no helmet and no lights weaving between the buses and taxis. We don't do ourselves any favours on the roads with this sort of thing, do we?


John at the Start Line




Got to Tower Bridge OK and eventually rendezvoused with John. Fantastic to see him and have a catch up - we last met at Xmas and he's had a lot going on in his life. Even better to have someone to distract me from the pre-start nerves. It's not that it's a particularly sporting or high-tension event, but there's always an element of excitement and no matter how well organised there's always going to be some confusion and chaos at the start line. Having someone to share it with was a big help and I'm very grateful.

First Section

John snuck around the side of the start line as I crossed it at about 23:45 and met me on the main road, so we cycled together north over Tower Bridge and across to Southwick Bridge. We said goodbye there and he headed off to Islington, while we went over the bridge and headed south. 

This whole section was new to the ride this year - last year we started at Clapham Common - and I have to say I thought it was a mixed success. It's a much nicer start and gives a grand sense of occasion - how much closer to central London could you get? and riding over Tower Bridge was an experience, but they don't stop the traffic so (for my part) it was spoilt a bit by dicing with buses heading up to Tower Gateway and beyond. It was also here that I realised what everyone else knows about clips - you'll spend a hell of a lot of time getting your feet into and out of them in traffic, sometimes in a hurry. 

Once we turned South the navigation settled down a bit but the traffic didn't, and the section between Southwick Bridge and Clapham Common was too full of riders and traffic, with each slowing the other down, to be too much fun. At the Common, though, we picked up last year's route which took us off the main road and down some quieter residential areas which provided some relief. By the time we rejoined the bigger roads we'd spread out some and weren't interfering with traffic so much which made the ride much more relaxing. When it's pub chucking out time in London Town this is a blessing. And the cheers - some no doubt heartfelt - from revellers heading home after a good night out was at least entertaining.

There's not a lot to say about the first section beyond this, although I've only really described the first 1/2 of it (to about 10 miles). The second part is through suburbia and is well lit on roads getting quieter as the night progresses. There's a bit of a sting near the end, as the last 3-4 miles are fairly constantly uphill. As with previous events I'm amazed how quickly people start getting off and pushing even at this fairly early stage. There's nothing steep that requires a Granny Gear, but having spent a bit of time recently looking at bike options and gearing I'm beginning to see it's possible for a fairly average person to be persuaded into purchasing something only a fully-enhanced Lance Armstrong could get up a serious hill, so my previous scorn for such sights is abating a bit. Anyway, be that as it may, there ought to be some satisfaction in knowing that by the time the first rest stop is reached at the 20 mile point you've climbed to the highest point on the route and, logically, it's all downhill from here....


The weather had held out so far, but as I put in a 20-minute water, coffee and (why not?) hot dog stop the drizzle started to fall. It was hard to tell the effects at first, because I'm a prolific sweater and it was also quite humid, but my clear specs misted up very quickly on the stop and everything got too damp to use for cleaning. 

Luckily, after only 90 minutes or so riding, I was fairly fresh (as fresh as one can be at 01:30), so instead of sticking it out and getting cold, I cut my losses and pressed on. Plenty of other people had the same idea so we headed out to the second section in a bit of a peloton.

Second Section

The second section's the part of the ride where bits are put between teeth, knuckles are down, and Serious Business is engaged. In theory it's an easy drag without many hills, but in practice it's where England's Green and Pleasant Rolling Countryside starts to show. This year, however, it was totally overshadowed by a nasty accident at the bottom of a hill. I can only speculate on cause, but at the bottom a long descent to a T-junction where we needed to turn right, someone had had a very nasty fall, and when I got there the Ambulance and Police were in attendance. I caught the second half of a 30-minute road closure while they scraped the chap off the road. It's an odd and slightly de-humanising feeling: along with 2-300 other riders, you're feeling sorry for the fellow while at the same time wondering whether they're going to get a move on so we can get riding again. It's not a nice thing. 

It also changed the character of the section completely, because when they re-opened the road it was like a second mass start, and the rest of the section was spent in crowded company with a bunch of riders all trying to re-group with their friends, break free from the masses in a sprint, or just generally remain oblivious to all that's going on around them and act like a rolling road-block. It would be great to say this mass riding represents the best of cycling - common spirit and purpose, all united in a single goal - but as on other rides I've done it's quite the opposite; it seems to bring out the worst in everyone. I did manage to keep my mouth shut and not express these Grumpy Old Man feelings, but it had an effect.

Still, the advantage of this section is that the roads are as quiet as they'll ever get, and meeting traffic in either direction is a rarity and not a hazard. This together with the constant pacing effect of other riders meant progress to the second stop at 35 miles felt fairly rapid. I got there at about 03:10, which was roughly as expected once the stoppage is taken into account.

Last year's ride was saved, for me, at this point by John's bringing out of some pre-made sandwiches.
Second Service Area - Cheese & Marmite Sandwiches can do this to a man...
It's the worst time of the night - it's been dark forever and there's no sign of morning, you're only just over 1/2 way, and fatigue's kicking in. So this year I prepared by making myself some sandwiches to bring, and had the John Ford Memorial Cheese & Marmite Sandwich of Hope washed down with another large gulp of water and some flapjack. I also got chatting to some fellow riders - one chap had just left a group of 4 who'd spent an hour correcting a navigational mistake which saw them get as far as Redhill before finding a friendly taxi-driver to put them back on the right track (that'll count big on the total mileage front but won't help their finish time!), and I had a very fun chat with a lady who'd only agreed to do the ride again to help out her friends who were practicing for the Ride London 100 and, at the time of our meeting, were no-where to be seen somewhere behind her clearly not quite as prepared as they'd thought...

She also said something quite insightful which I'd only unconsciously noticed - the riders this year (although there appeared to be far more of them) seemed more serious, and there was a distinct absence of novelty bikes like we've seen on previous rides. Maybe it was the weather (which, once again, decided to wait until I'd stopped before starting to rain), maybe the start-venue change, but the ride had a more serious character than before.

Third Section

The lady also vocalised what I was feeling, which was that the 3rd section ahead of us is the worst of the night, what with the timing, the fatigue and the fact that there's so many miles still to go. But it was clear that we'd never manage it stood around at a rest stop so I packed up my things and decided better behind me than in front...

In terms of height profile, there's only one half-decent hill on this section and it's reasonably close to the start when one ought to be freshest (for locals: it's the hill heading out of Crawley towards Balcombe past the M23). At that time of day it takes more epic proportions, though, and there were a fair number of walkers. I could tell I was feeling it too, because I hit bottom gear for part of it, and there's no way that hill is less than a 3rd gear climb on a normal day. 

The rest of the section features more of that lovely Rolling English Countryside posh southern poets love to write about; they should try riding it in the pre-dawn dampness of a sunday morning after 40-odd miles of roads before they wax so lyrical is all I want to say, as the constant shifting up and down gears to slog up one slight rise whilst taking maximum advantage of the downslope on the other side gets very waring. Just once I'd like to do a ride that's *actually* flat for a good distance, rather than just appearing to be so on a profile map in relation to everything else on the journey...

Thanks to the 6-7 miles added to the front of the ride, this was also the point in the ride where I started to feel a bit down about progress. Last year, John & I got to the final service area at 04:00 just as it was starting to get light. This time around, I was out on the roads as this happened and it ought to have been joyful to ride into daylight but I couldn't help feeling I was letting the side down by being slow. Rational thought was hard to come by, partly because I knew what was coming ahead of me and wasn't feeling up to the challenge, and partly because it'd become wet enough to warrant removal of my clear glasses which really weren't helping with seeing anything.
Still another 17 miles to go, and fairly knackered

I rolled in to the 3rd Service Area outside Burgess Hill at the 50-mile point at about 04:40 to find a large crowd of people all looking like I felt, and there's some consolation to be taken in shared misery! A cup of hot coffee, a sit-down, a mars-bar, some flapjack and a good long ponder of the world passing me by helped recover my body and spirits somewhat.

Final Section

However, we all knew what was coming either by reputation (for the first-timers) or from bitter experience for those of us who'd done it before. So after a good 1/2 hour break, back onto the bike to join a noticeably slower-moving, more tired group heading onto the final section. I was a bit disconcerted at this point, because I'd worked out the ride distance as 60 miles, meaning we should have had 10 to go, but the marshals were cheerily shouting "Only 17 miles to go!" at us. Time would prove they were right and I was wrong, so serves me right for reading straight-line distances off a Garmin route as definitive, I suppose.

Dawn's joys were dampened by the weather. I'd been hoping for an earlier start, reasoning that if I'd got away at 22:30 I'd arrive at the hill either while it was still dark (and I wouldn't see it), or I'd catch sunrise at the summit. In the event, I could barely see where I was going thanks to the mist and rain so I guess I got part of my wish.

I should probably explain better. The (day) London to Brighton ride is (in)famous for being fairly easy for the first 50 miles, then throwing everyone over a long, steep hill (Ditching Beacon) only 10 miles from the end when you're nice and tired. It's a proper Nemesis of a hill, the highest point of *that* ride, and a genuine excuse for a slow walk and push of the bike up for about 1/2 the riders of that event. 

The Night Ride doesn't go up Ditchling Beacon (it'd be an accident blackspot if the road's aren't closed to other traffic like they are on the day ride), instead it finds another way over the South Downs about 5 miles further west, up a peak called the Devil's Dyke. It's not as high as Ditchling (as I've mentioned: peak altitude for the night ride actually comes at the 20 mile mark, over the North Downs well inside the M25), but it's a lot longer and a lot sneakier, coming in 3 distinct sections with a bit of downhill between each. Last year I knew nothing of this, so put my all into each of them thinking their sub-peaks were the heights. It's not helped by the fact that there's about a mile of descent (about 1/3 of the total so far climbed) between the 2nd and 3rd sections, and the final climb back up to the peak is the steepest bit.

It was nice in the run-up to the hill to find that there were people out already to support; the bell-ringers and shouts of encouragement from the sparsely-spread cars were really appreciated. But they didn't help with my mental state, which (this time around) knew what was coming. As with last year, it was around the 3rd stop that we also started to see the first returners - those for whom a night-ride TO Brighton isn't enough and who are now well into their return journey. I respect and admire these people for their stamina and spirit, but I wish they'd chose a different route back for their effect on my morale.

So I arrived at the hill with legs of lead, a bum on fire, and dripping wet. Not the best mental state to be in. Resigned as I was to my fate, I couldn't get upset with those passing me on the right even though I envied every one of them their legs. For my part, I passed but one rider on the hill, and plenty of walkers. As mentioned, I'd say 50% of day riders walk Ditchling Beacon but either the hill's easier (and I'm making a scene of it) or the riders are hardier on the night ride and the proportion is much lower - no more than 20% of people were pushing up the hill (although plenty stopped for a break at each mini-summit). Some of these look at you - as I would - with pity or envy in their eyes as I huffed, puffed, dribbled and swore my way past them, but most smile and offer words or shouts of encouragement and represent all that is good in people. Thus I reached the bottom of the 3rd climb in no good state, and with my head firmly DOWN to avoid seeing what was ahead of me. I reached bottom gear in the quickest time I've ever managed, and plugged at it. I really, truly, felt I couldn't make it despite being shouted at not only by those walkers I past but also by the riders passing me, and I was making more noise panting for breath than the Flying Scotsman made on it's record-breaking run. But, bit by bit, I got up the hill. I can distinctly remember looking up ahead of me at my lowest point, thinking perhaps to find a spot I could dis-engage feet and dismount, to find I was at least 3/4 of the way up and in sight of the summit, uttering an unprintable stream of self-encouragement and vowing to make it. And I did, and it was glorious. I'll win no prizes for my ascent, not even "most shabby rider to make it" as I'm mediocre in all things, but a funny thing happened to me immediately I recognised I'd made it to the top.

The summit of Devil's Dyke is at the 60-mile marker on the ride, and my GPS tells me I got there at 06:20. Last year's ride was about 60 miles total, and John & I finished at 06:11 after starting at 23:55. So this needs to be the definitive reckoning: I was slower this year than last. But my Strava Trace of the event shows a slightly different picture, as I was faster over the first half of the event and tapering off badly towards the end. This matches my feeling of the event; I was struggling quite hard towards the end and much closer to being out of reserves than I remember feeling last year. Having said that, Strava tells me I was only 39 seconds slower up the hill than last year, which is a surprise; I'd have expected minutes.

It probably also explains my behaviour from the summit on the long, long winding descent to the finish, where waves of relief and emotion kept washing over me, causing the disturbing sight (to anyone close by) of a middle-aged man riding a bike at 20MPH down residential streets whilst intermittently bawling and sobbing uncontrollably. It persisted past the finish line, and accounts for my appearance in the obligatory finish-line selfie:
Bit of a mess at the finish line

Apres-Ride

There was a cracking spirit at the finish line - I've got nothing but respect for the DJ who'd been at it for hours and yet whose encouragement made every last one of the finishers feel great about what they'd done. And there was a surprisingly big turn out - at 06:45 - of people there to wave and cheer. That, too, was appreciated by everyone cycling along Madeira Drive. 

I had a brief chat with a lass heading back to the train station. She'd found it tough going and she'd previously been a sporting rider winning events. Mind you, she admitted she'd done little preparation and was relying on previous experience and fitness to get through it. I could have told her from my 2012 experience that this wouldn't be good enough, but we all learn these lessons the hard way.

Plan A for the post-ride had been to crash out on the beach for an hour or two, perhaps a little snooze to recharge the batteries, and then leisurely ride home. Plan A was toast, and I'm going to blame the weather which was wet and surprisingly windy. So instead I opted for a sit-down at a cafe, a full English, and a re-think. I've never enjoyed a meal more and it disappeared far too quickly. Unfortunately, in my post-bacon daze I'd failed to consider that I was sheltered from the worst of the elements and so I made the decision to try a little ride to Worthing and see how I felt.

So, an hour after finishing the night ride, I saddled up and started to head west. And, as it turned out, straight back into the wind which I'd not noticed had provided a big boost to the final sprint along the seafront towards the finish-line. So while I quite enjoyed the first few miles into wind - smiling and waving and enjoying the disbelieving can't-believe-I've-done-it looks on the faces of the riders still heading towards the finish - I can tell you that in that state a full english breakfast with tea wears off at Shoreham-by-Sea, pretty much going past the airport. Any thoughts of making it further home than that disappeared at that point, and I must have looked a strange sight to those bikers who were just getting out for their sunday constitutionals as I rather slowly made heavy work of a seafront ride to Worthing.

I got the train from there, and ended up sharing a carriage with 3 other riders of the event who'd done it for the first time and were heading back to Portsmouth. I greatly enjoyed sharing the experience and swapping tales with them, and getting a second insight into the event. They hadn't done a BHF ride before but had plenty of experience on other rides, and the tales of organisation and relative enjoyment of the various organisers gave me much to think about. 

After a very long wait at Havant for a connecting train, which tested my abilities to remain conscious, I finally rolled up to my front door just after 10:00. To find a normal common-or-garden Sunday under way; youngest lounging about reading the Beano in her pyjamas, eldest still in bed, and my Dearly Beloved slowly going out of her mind trying to herd the offspring into doing *anything* with the day. I didn't help - I dismounted, discharged the contents of my various pockets and rucksack, disrobed and collapsed in bed for a couple hours longer than I'd planned. I'd like to say that sorted me out, but frankly the rest of the day was a wash-out, for which I'd like to apologise to my long-suffering family.


Thanks

And on that note, it only remains to say thank-you to everyone who's sponsored me, to everyone who's commented or sent their kind words of support, and to my friends and family who once again have put up with my distraction and obsession with preparing for and riding in this event.

The sponsorship page for the ride will remain open for a little longer, so try Clicking Here if you'd like to see it.

2014-01-02

Buy a Smart TV. Or Make your own that does more for less?

(I'm not the first to write on this subject, I won't be the most informative either, but I need to get back into the habit of semi-technical writing so excuse this indulgence...)

New Year, New Minor Project

My father, bless him, decided a bigger TV was in order. He decided to get one that fits into the category "Smart TV" and, I won't deny, it's a clever box which can stream from internet and local network sources a variety of content provided the usual boxes are ticked about compatibility, codecs etc etc...

His estimate was this added a premium of £50-100 on top of the "dumb" TV cost for the same size. But insists the choice was down to picture, size of screen, thinness of frame. And I believe him...

Anyway, this freed up their old TV for which no in-house use could be found. So we brought it home with us. Now, what to do with a 32" 2007-vintage LCD...

Motivation, or Prime Cause

Back in the day, this section would have read "Because I can". But I'm getting older and (even) lazier these days, and even though something's ostensibly cool I still need to see some personal value before attempting - the range of stuff available today exceeds my goldfish-like attention span and, mayflower-like, expires before I can get around to it. That's enough cliched metaphors.

We've got a MythTV box next to the lounge TV, and have had it for 6 years. The biggest vote of confidence I can give it - and a mark of it's utility to the household - is that I haven't dared upgrade or replace it since a one-off upgrade in 2009, such is it's value. Nearly everything we watch is through the Myth box - one of my proudest parenting achievements is that the kids pretty much only get to see Adverts when they stay over with grandparents. Doesn't say much for my parenting skills, but at least I picked a winner with the Myth box.

However, the kids are older and we're down to about an hour a day when we can watch stuff WE want to watch without their comments or interference. Bit of a problem when it's a 2-hr Swedish Jumper Documentary masquerading as a crime thriller. 

As it's Myth'd, we can watch - separately - on our computers. But it would be nice to have a second spot in which we can BOTH watch something together, away from the kids...

Open Source Solutions

As an admitted casual dabbler in these matters (as I said, I've had no need to pay attention to the field since 2009...), I've been aware that XBMC has been around, and a sort-of competitor to my beloved Myth for quite a while. You won't travel far on t'internets looking for open-source media centre solutions before XBMC is mentioned, and you'll come across it far more frequently than Myth. 

Actually, the two solutions complement each other and take opposing approaches. Myth concentrates on bottom-up - being an excellent recorder, archiver, file manipulator box with (subjectively) a weaker front-end user interface. XBMC concentrates on being the best possible playback solution possible, with (subjectively) weaker capture and management capabilities. 

So rather than being competitors, per se, it makes sense for the well-equipped home network to have one of each (or, more likely, a MythTV server capturing and collating video, and a network of XBMC front-ends playing it back). 

This fits from a cost & power perspective too: a Myth box needs some horsepower (mainly for transcoding though - capturing video streams is fairly lightweight these days), plenty of storage and some expansion capability to host capture cards etc. XBMC, on the other hand, is a close approximation to the classic Thin Client model, needing modest hardware for playback & the user interface, and only enough storage to hold the OS and some metadata about the content available on the network. 

Enter Raspberry

Most intriguing of all are the results of the experiments of the hoards of bedroom coders with their Raspberry PI boxes. This is a remarkable little box - the power of a 8-9 yr old desktop machine combined with the hackability of a 80's era ZX Spectrum all at a (let's face it) disposable cost of £25 a pop (i.e. cheap enough that when you do make one go "pop" and release it's magic smoke because of a mis-wired GPIO experiment, you won't be sobbing for too long before managing to afford a replacement). 

Even better than this, the wonderful geeks have turned the whole thing into a pretty-much plug-and-play solution. I shall document it pretty fully here:

Build Your Own Smart TV

The ingredients:

  • A TV. Preferably with a HDMI socket, so something newer than about 2005 or so in a LCD format would be preferred. Bonus points if the manual mentions CEC or the manufacturer-proprietary renaming of such (VIERA Link etc etc).
  • A RaspberryPI. Model A or B will do, B probably works a bit better (more memory) and would be mandatory if you're intending to use a wired ethernet connection.
  • SD Card. 4GB minimum, 8GB or up preferred
  • USB WiFi Dongle. If you're not going to use wired Ethernet, that is.
  • HDMI Cable. 1M or less preferred. Substitute with RCA if TV has no HDMI, but then you'll need to do something about Audio too.
  • (Recommended) A 2-a 5V power supply for the Pi. You may be lucky and be able to use a USB output on the TV to power the Pi, but (certainly for a Model-B) a dedicated power supply is much more reliable especially when using a USB Wifi dongle.
  • (Optional) A TV Wall Mount Kit. Best for space saving installations.
  • (Optional) A case for the Pi. Not required, but recommended - some of the components on the Pi are vulnerable to being knocked off or damaged by mis-handling.

Minus the TV and wall-mount kit, the parts required should be around £50 (Total manifest for a Model-A kit with all optional components, from RS linked above, comes to £52) - less if you've got spare bits already like SD cards and various cables. This is around the "Smart TV Premium" level, not bad for DIY component solutions in this day of mass-manufactured discounts.

I also note that if you're intending to play back "native" recordings from MythTV obtained via FreeView / FreeSat recordings (i.e. in MPEG2 video format), you'll want to obtain a hardware decoder licence (MPEG2 Licence Key) for your Pi from the RaspberryPI shop. This will add £2.74 to the parts cost.

The Recipe:


  1. Take the SD card from the Pi and insert it into the nearest available computer. 
  2. Go to the New Out Of Box Software (NOOBS) Download link of the Pi site, and get a copy of the latest offline installer (~1.38GB, so get a grown-up internet connection to help you with this step. Alternatively try the net installer - "NOOBS Lite" - for smaller size, especially as we're going to only use a fraction of the software for our solution )
  3. Follow the instructions to format the SD card and put NOOBS onto it.
  4. Plug the Raspberry PI into the TV, attach the USB dongle and a spare USB keyboard (only needed during build & configuration). 
  5. Insert the SD Card into the PI, attach power, and wait
  6. At the prompt, select to install OpenELEC
  7. Reboot into OpenELEC & configure for your local environment. I'd recommend doing an update (System -> OpenELEC -> Update) to get the latest updates first, then doing configuration
  8. Don't forget to do a library scan to pickup metadata about what's on your network. Not absolutely required (you can select by file) but makes the interface so much nicer and quicker to navigate.
  9. Follow the instructions on the XBMC Wiki to configure MythTV as a Backend to XBMC

That's about it, really. I've elided a few details you can find for yourself, especially using the XBMC Wiki, as they'll be installation dependent but as a reference I got through steps 1-9 in about 90 minutes elapsed attention-span (omitting some longer delays for download time), and ended up with the following installation working well (see below for limitations and caveats) with about 8 hours total effort (3 of which were fitting the wall-mount kit for the TV):

For the Avoidance of Holy Wars...

NOOBS includes 2 Media Centre solutions. Firstly there's a full-fat XBMC install at pretty much current specs, about 2GB space required. I tried this, it seemed to work OK but the Pi add-ons (in particular the Web Browser) didn't sit right with me. After trying one - the Web Browser - I was unable to reboot the Pi back into XBMC because it'd cocked-up one of the boot loader files. This, along with the rather long boot times for XBMC, persuaded me to instead try the RaspberryPI-optimised OpenELEC build of XBMC which is also included in NOOBS.

For my money, it's lighter weight (therefore better fitted to the Pi), boots faster, and has all the features I can see myself wanting from a front-end, so whatever I've lost from the full-fat XBMC I won't miss. It's also survived several test "pull the plug" reboots of the Pi so far (a scenario tailor-made for SD card corruption). Your mileage may vary, choose as you will.

Controlling the Pi

One point I've missed so far is how to control XBMC once you're all installed. Several answers are available.

  • The worst option is to keep the keyboard fitted. Even if you've got a wireless keyboard (or a bluetooth one with dongle), I wouldn't recommend it - XBMC does work and everything can be selected from a keyboard, but it's just not made for it. 
  • Probably the cheapest if not most effective solution is to use the TV's own remote control. If your TV supports CEC, you should be able to use it to control XBMC as there's a CEC module built in. Despite my TV, Pi and Remote all claiming to support this (via Panasonic's "VIERA Link" rebranding), I've been unable to do so. I suspect either a non-compliant HDMI cable or (more likely) the TV's too old to properly support the full protocol.
  • For those of a hacker bent, there are GPIO-based IR Blaster solutions for the Pi to use existing or dedicated remote controllers
  • But by far the coolest option is to use either an iOS or Android Smartphone to obtain full control.  Both the official iOS XBMC App and the official Android XBMC App act as (very) smart controllers over your WiFi network, allowing search and direct selection of media from the app to playback on XBMC. 
If you don't like the official apps, others are available particularly on Android. The Yatse app works particularly well on my Nexus 7 tablet, for instance.

Caveat Implementor

One point I've omitted to mention so far is that as it stands it's all great and everything works with one exception: Because my Myth box is so old (v0.21), although XBMC can connect to it, find what channels it's got, what's recorded and what's scheduled (and also, presumably, schedule new recordings although I've not tried it) there's one limitation:

It won't play anything back from the Myth box. I can find it, select it, but when I look at the log I see the XBMC box is asking for recordings that the Myth box is refusing to admit exists. Ditto for watching LiveTV. I suspect a mis-match in protocol versions solved by upgrading the Myth box, but it'll be a while before we attempt that.

(I can't just upgrade Myth as the box is so back-level even apt-get update fails with unknown / retired repositories. So it'll need a re-build. Which will mean losing the database and all the recordings. Of all the Xmas stuff. So I'll need to transcode them first, or convince the family to watch them and delete them. Either of which will take at least a month....)

Ah well. In the meantime, there's always the ability to run BBC iPlayer on it...