Radio-4-Matic - part 1 - introduction
posted in Electronics by Cargo Cult on Monday January 7 2013
So, there have been vague hintings at a Raspberry Pi project I've been building. It's been functional for a while in its time-travelling lunacy - but first, what the hell is it?
Something one encounters in these western United States of America is the lack of BBC Radio 4. Or rather, the lack of proper live Radio Four, the excellent iPlayer Radio providing invaluable on-demand capability. "But Adam," I hear you cry, "you can already listen to live BBC radio over the internet! Why can't you use that?"
Timezones. It's live radio, but all the timing is wrong. Namely, the written-in-stone Radio 4 schedule must not, under any circumstances, be allowed to become misaligned from the rising and the setting of the sun. How could anything (or anyone) remotely British even think of operating normally if the Friday evening comedy gets broadcast on Friday morning, or if the Book at Bedtime arrives early in the evening? Or heaven forbid, if Woman's Hour escapes from its usual 10am ghetto?
So, short of removing both the North American continent and the Atlantic Ocean in order to make Seattle a suburb of Plymouth, we're going to have to take the existing internet radio streaming and add a timezone-busting delay. Oh, and then wrap the whole thing in a suitably middle-class casing complete with a Royal warrant of appointment. Luckily, we moved west of the Prime meridian, so we can get away without using actual time travel.
Cue the Radio-4-Matic.
Outwardly, it looks like a typical old British radio, permanently tuned into Radio 4. At 6pm, it provides the Six O'Clock News. Only the 6pm is Seattle-time, not London-time. Waking up can be accompanied by the Today Programme. All very civilised.
Hardware-wise, it's an eBay-acquired 1970s Roberts transistor radio, containing a bog-standard 256MB Raspberry Pi running Raspbian (actually, this exact Pi helped Raspbian get going). The radio has been modified so that the LW, MW and SW buttons provide line-in audio from the Pi's analogue audio-out - VHF still operates as a conventional radio (currently tuned to NPR, no less). Purists may be relieved to hear that hardware modifications to this vintage radio involved snipping one racism-carrying wire from the AM tuner before soldering in two others. Should be completely reversible in about ten minutes, including time waiting for the soldering iron to heat up. I originally intended to replace everything except the speaker, but after discovering how easy it was to pipe in new audio, and how awesome it sounded, I simply didn't have the heart...
Software-wise, it operates a slightly-illicit transatlantic SSH SOCKS tunnel, with the faintly-dodgy get_iplayer and rtmpdump grabbing the radio stream, piping data to ffmpeg for remuxing the AAC-compressed audio from FLV into ADTS. This gets stored on the Pi's SD card as timestamped .aac files, with the basically-ubiquitous mplayer used for playback, started with an appropriate delay - with all of the previous utilities marshalled together with a hideously hacky script written in ... PHP. Stop laughing. Non-blocking file IO and POSIX process management in a command-line program written in PHP? Ohyes! I'm going to rewrite in Python at some vague point in the future. But it's already super-resilient against any particular subsection choking, dying or getting stuck. It'll also probably cope with daylight-savings changes. Probably. It also doesn't record things unnecessarily, such as the World Service overnight.
It's still rather hacked-together (I'm waiting for a USB WiFi dongle to arrive, along with a 12V power supply and a DC-to-DC step-down power supply, to remove all the wires hanging from the back) but it's most definitely functional, and useful. The end result will be a radio and nothing but a radio - except one with this magical eight-hour delay...
I'll be documenting the precise hacks involved, both software and hardware - but for now, it's nice to actually describe this thing!
I'll also eventually get round to fully documenting the Timelapse-o-Tron™ one day, too...
Edit 2013-01-09: Now with part 2, hardware!
Edit 2013-01-11 (just): ... and part 3, software. Phew.
Edit 2013-01-12: ... and a surprise appearance on Radio 4 itself. Eek.
Edit 2013-06-30: ... a somewhat belated upgrade to make the whole thing run on mains electricity. Blinking heck batteries last a long time in 1970s hardware.
Sunday Things - urbex edition
posted in Links by Cargo Cult on Sunday January 6 2013
What would we do without intrepid photographers infiltrating abandoned buildings? Probably have to go infiltrating more of them ourselves, of course.



Bonus Someone's GPU Is Melting corner:
2 comments - article now closed for commenting
Sunday Things - end-of-the-year edition
posted in Links by Cargo Cult on Sunday December 30 2012
Last article of 2012! At this rate, I need to extend the archives to split things into separate years - fifty articles in just over six months? Not bad going...



Bonus Audio Extravaganza corner:
- The Infinite Monkey Cage - how did I completely miss this? Science and comedy from BBC Radio Four, with my usual allergy to Brian Cox relieved thanks to Robin Ince and guests mercilessly taking the mickey.
- Ambient background noise in the International Space Station - in space, no-one can hear you do pretty much anything. I SAID, NO-ONE CAN HEAR YOU DO ANYTHING. NO, ANYTHING. YES. SIGH. via
- Doctor Who theme as you've never heard it before - stick with it. Somehow, it keeps getting worse.
no comments - article now closed for commenting
Sunday Things - post-apocalyptic, pre-Newtonmas edition
posted in Links by Cargo Cult on Sunday December 23 2012
So, the Mayan apocalypse turned out to be deeply disappointing - and the anniversary of the birth of Sir Isaac Newton isn't quite upon us. Ignoring calendrical differences for the latter, obviously. So what else do we have?
The Sunday Things.





Bonus Merry Christmas! corner:
no comments - article now closed for commenting
Sunday Things - experimental aeronautical edition
posted in Links by Cargo Cult on Sunday December 16 2012
A Sunday Things with a cohesive theme! That's not space! But lots of weird-looking planes instead, courtesy of Wikipedia's list of experimental aircraft. Here are a few picks:






Bonus Yet More Funny Planes corner:
- SNECMA Coléoptère - tail-sitting, dangerously French wonder. Even more dangerous - the prototype for this prototype.
- Antonov A-40 - a Soviet attempt at strapping wings on to a tank. No, really. Trust the Ukrainians to lift giant heavy objects into the air...
- Vought V-173 - a flying disc! The annoyingly-low-resolution underside view looks like an incredible alternate future...
1 comment - article now closed for commenting
24 comments - article now closed for commenting