Radio's Next Generation: Radii

See how Linux can be used to prototype a sophisticated Internet appliance.

where $radiiStn{$curBand}{$choice}{name} is a hash that is indexed by way of the band index and the choice index. It contains the necessary selection information: display name (used here), station URL and its band.

Once the operator clicks the select button, the PIC sends an s message. In response, the system updates the LCD to the new station name and signals XMMS to play the new stream, again using Perl's system command:

system("setlcd",
       $radiiStn{$curBand}{$choice}{name});
system("/usr/bin/xmms",
       "-p",
       $radiiStn{$curBand}{$choice}{station});

Configuration Using XML

The Radii application is configured using a simple XML input file:


<?xml version="1.0"?>
<Radii>
  <station url="http://66.54.65.226:9022">
    <band>OLD TIME RADIO</band>
    <name>AM 1710 Antioch</name>
  </station>
  <station url="http://205.188.234.38:8040">
    <band>Celtic</band>
    <name>CelticGrove.com 24/7 Celtic/Irish</name>
  </station>
  .
  .
  .
</Radii>

The XML configuration file can be read using the XML::Simple Perl module.

my @station;
my %radiiStn = ();
my %bands = ();

my $file = 'stations.xml';
my $xs1 = XML::Simple->new();
my $doc = $xs1->XMLin($file);

foreach my $key (keys (%{$doc->{station}}))
{
    $band = $doc->{station}{$key}{band};
    $url  = $doc->{station}{$key}{url};
    $name = $key;
    $bands{$band} += 1;
    $radiiStn{$band}{$bands{$band}}{name} =
       $bands{$band}.":$band: ".$key;
    $radiiStn{$band}{$bands{$band}}{station} = $url;
}

This code utilizes Perl hashes for the required band and station information. Band information, including name and number of stations, is kept in the bands hash. Station information, such as name, URL and band, is kept in radiiStn hash.

See the on-line Resources for the URL of a site with the complete script and other associated software, along with details on how to build the hardware.

Conclusion

Radii demonstrates how Linux can be used to prototype a complex consumer device quickly and cheaply. As the iPod revolution takes hold and satellite radio becomes more popular, Radii-like devices inevitably will change the way radio is broadcast and received all over the world.

Rapid prototyping does not require particular hardware, sets of tools or languages. It's not about finding the best solution; it's about getting it done quickly using the available resources. That pool of resources is vast when it is FOSS on Linux. Keep your eye on the goal while you sort through the potential building blocks. Tweak as necessary, and then glue it all together with your language of choice.

We configured our laptop to boot to run-level 3, full multiuser mode. After the laptop boots, we start Xvfb, set our DISPLAY variable, start XMMS and start the Radii application. The startup sequence is:


% Xvfb :1 &
% export DISPLAY=:1.0
% xmms &
% radii.pl

Then we hide the laptop and enjoy the radio that we call Radii.

Resources for this article: /article/8537.

Dan Rasmussen (dan@retro-tronics.com) is a Senior IT Specialist for IBM and holds a BS in Math from UMass/Amherst and an MSCS from RPI. He has been working as a software engineer and IT consultant for nearly 20 years. Dan is also an avid collector of vintage electronics.

Paul Norton (pddknorton@charter.net) spent his early career with large corporations, including Xerox, Litton Industries and Pearson. For the last 20 years he has worked exclusively with small companies, several of which were start-ups. His main business focus is establishing operations and strategic management of product and market development. He has a three-pronged education in technology, humanities and business, holding an MBA from Brunel University in West London. He has worked extensively in Europe and the United States.

Vice President of Product Marketing at Tatara Systems, Jon Morgan (jamncl4@yahoo.com) has more than 18 years of marketing, technical and management experience in the telecom and data communications industries. Most recently, Jon was Director of Product Management/Marketing for Appian Communications, Inc. Prior to joining Appian, Jonathan held various management positions at Fujitsu Network Communications (FNC). Prior to Fujitsu, Jonathan spent seven years at Bellcore. Jon holds a BSEE from Washington University in St. Louis and an MSEE from Rutgers University.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Woah, love the idea of this.

Luc's picture

Woah, love the idea of this. There are quite a few stations I like to listen to that are forgien so obviously don't boradcast within a few 1000 miles of where I live. This would be a great way to listen to them around the house. So when does production start?

Great Prototype

Dave's picture

A very interesting article. Your prototype now allows you to show people the concept,something they can get their hands on.

Never OO embedded devices

James's picture

Gentlemen,

On the surface, your homespun project looks impressive. However,
as an embedded expert, your 'project' demonstrates everthing
wrong with many if not most product development efforts.
1. OO programming for embedded devices, is doom to failure
for a variety of reasons: security, maintainance, portabilty
but mostly costs.
2. You project could be implemented on a $5 x86 embedded CPU, avoiding
the pc mobo and the PIC all together. You have to have hardware and
firmware engineers minimize the hardware design before you start
coding.
3. Features that are missing are killers. Traditional AM/FM radio
support must be added, using a chip that costs a few dollars so as
to attract the tradition radio market. Upon using the AM/FM radio
features, as a comfortable commodity, you can then attact them
to Internet radio. NTP and the ability to filter out commercials
over traditional AM/FM broadcast would make your product much more
financially viable.

I could go on and on, but I hope you start to see clearly. The
problem with product development, is it starts with expertise
in hardware and firmware. Embedded linux is fantastic, but, you
never, never, never use a distro espcially pocket PR or Fedora,
as all of that excess baggage wastes critical resoures and leads
to unstable products that are expensive to maintain.

Last, if you are going to build embedded products, LEARN ASSEMBLER
mixed in with ansi C. Leave OO on the destops, where it belongs..

sincerely,
James Horton, BSEE, MSCS PE.

Some do and some talk

K2TQN's picture

I think this is a great project just as it is. It's a great new idea and it has been implemented. I put them in the same league with Bell, Edison, the Wright Brothers, Marconi, DeForest, Mauchly and Eckert, Woz and Jobs, and all the others who forged ahead and were first!

Of course everything can be improved, but they did it, and did it first.

Congratulations.

John Dilks, K2TQN
Personal Computing Pioneer (1976)

I agree completely if this were a final product

Dan Rasmussen's picture

Hi James,

You are universally correct in your assesment of the device as a final product and I am glad your brought it up. One of the points of the article that may not have been made well is, as a prototype, our primary goal was to minimize effort/cost get it done as quickly as possible.

Had we done all of the things you mentioned, it would have taken much much longer than the month or two that it did take (and much of that time was spent soldering). Prototyping is extremely important in the development of any software or system and we needed to have a prototype to have any hope of getting funded and this was it.

Had we received funding for the idea, the device was to include some of your suggestions and many other features not mentioned. Our fist technical task after receiving funding would have been to get it on an embedded system (we were considering Gumstix - http://www.gumstix.com - as the next step but not necessarly the final platform - we still had lots of work to do).

Prototyping is about getting something together that looks complete but doing it as quickly/cheaply/easily as possible. Optimization comes when you have the time/money/resources to do that. Some of that message may have been lost as the article went through its many revisions (We had to get rid of lots of words).

Thanks for the comments.

Dan Rasmussen

still pursuing the Internet Radio project?

Tracy R's picture

Hello .. I came across your article regarding your Internet Radio device while I was doing a search for exactly that type of product. If you (..or any one else out there) ever needs cheap(free!), quality labor designing this product, feel free to contact me any time (trcal_2000@yahoo.com). I have 20+ years in New Product Development for many different products. Let's do it!
Thanks,
Tracy R.

Assembler not always needed

Barton's picture

While I agree with most of your comments I don't think that assembly language is needed very often. I have done many embedded applications and very seldom need to fall back on assembly language. Even when doing DSP projects the C compilers are very capable of creating very optimized code. If one does need a little bit of assembly it can usually be added in line with a C extension like asm {} or the like. With DSP's one does usually need a little bit of start up assembly but it is only a page of code. Assembly language is hard to code, hard to maintain, and hardest still to port to other processors. When ever possible I try to make do with ANSI C. I agree that OO and C++ are usually overkill for an embedded application unless it has an OS to fall back on. An embedded system using one of the embedded Linux products could support OO if the project was real big. Most of the time however the embedded projects I work on don't need any OS and must fit into small spaces. PIC's and DSP projects for hardware control usually don't need the extra overhead of an OS.

Of course that's my opinion, I could be wrong.

next step ?

ben ciceron's picture

wow ! great.
let's find a linux friendly palmtop or mp3 player and we might have winner...

When and where, I'd buy!

Ed O&#039;Neil's picture

You've got a GREAT idea. Broadcast radio reception where I live isn't that great so a device like yours is very atractive. In the mean time, I will continue to use an inexpensive ($15-20) FM transmitter to re-broadcast from my PC to all of the radios in my home. You could intigrate something similar in yours so that the listener could roam the house and hear the same station. If you need a beta tester...

Retro Radio

Frank Daley's picture

There IS a market for something like this. Just look at the huge success that Chrysler had with their retro PT Cruiser:

http://www.chrysler.com/pt_cruiser/

There are even some interesting similarities between the two. Surely there is at least one VC company with some vision!!

Good luck, it would be a winner if it went to production.

Uhhhh. The PT Cruiser is a h

Anonymous's picture

Uhhhh. The PT Cruiser is a hacked Neon. Not in the least bit retro.

Internet radio and Music servers

Anonymous's picture

very interesting project, I was actually looking at some music servers that offer Internet radio, such as the musica from www.olive.us and the sonos from www.sonos.com , if end not purchasing a music server, and this product becomes a reality, I may end up getting one

One thing I didn't understand

Dave's picture

One thing I didn't understand was how the consumer uses it. It looks like they select a genre from the dial, then how does the radio know what stations to list? Does the user have to enter them somehow? Will it work wireless (using a hot spot)? Over-all it seems very cool!

Dave,

Radii

Dan Rasmussen's picture

Hi Dave,

Thanks for the positive comments. Possibly not explained well was that there is a genre dial and a turner dial. Twiddle the genre dial and the LCD will update to the new genre. Once you get the the desired genre, twiddle the station dial and the LCD updates with new selections from the genre.

Dan

XML station identification

Glider's picture

The XML configure script allows for the storing of radio stations.

I don't see where the authors allow for this lsit to be updated except for someone with command line access editting the configuration file. However I could see where it could be set up to populate radio stations from the web using an RSS feed or something similar.

Great article!

-G-

XML station builder script

Dan Rasmussen's picture

Hello -G-,

Yes, you are correct, there is no mention of how this file gets generated. If you take a look at the resources page it will lead you to a page that gives a little bit of an explanation but it goes like this: yes there is a script that will generate the xml config file (well, sort of, it still needs a bit of hand editing). It does this by querying a well known station list keeper (that actually limits your daily queries - based on IP). At the same site (http://www.retro-tronics.com/radii) You will also find a stale xml station file along with all of the associated source. The station gen scrip is not yet posted but everything else is. I need to clean it up a bit first.

Thanks for the positive comments.

Dan

script?

ken Scharf's picture

Well it's now December 27 and you STILL havn't put the station list generater scrpit up on your web site.

Also I have an optical encoder switch that has a push button switch built in. I can see rewriting the interface so the single dial could switch between 'bands' and 'stations' with the push button selecting which menu and making the selection. (quick push changes menus, long push makes selection.)

Well written and inspiring. A

jh's picture

Well written and inspiring. Almost makes me regret having become a software-only geek :-)

Great Job!!

Richard Kut's picture

Wow! Great job! Any plans on selling some of these to guys like me?

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix