Search This Blog

Wednesday, January 7, 2009

Preface - Joining the Android revolution


Last year, I joined the Android open source revolution as a user. I took a difficult and controversial decision. I bought the G1 phone. Many people call it the T-mobile G1 phone, but I like to call it the HTC G1 phone, to give credit to the actual phone manufacturer. Agreed, it couldn't have happened without Google sponsoring the Android platform and creating the Open Handset Alliance. T-mobile got exclusive rights to the marketing of the very First device to run the Open source android platform and got a sweet deal for itself. It even convinced many people to buy the data plan.

I am sure a lot of people thought that they had to get the data plan to make the phone even work. Well, that was true, but only for the very first power up of the phone. Once it had registered the google account for the phone, it didn't really care if it had the data plan or not.

I bought the G1 through Ebay (unlocked). After utilizing Microsoft Cashback Livesearch feature with Ebay, I got a sweet deal for $375, including some accessories. Back in Nov 2008, I got a 25% cashback! A week later, Microsoft announced that they would give instant rebates, instead of delaying the cashback for 2 months via Paypal, as originally announced.
Later, I learnt that Tmobile also sells the unlocked handset to customers for $399 without contract, although its not openly said so. So if you are thinking of getting it from ebay/amazon, try hammering a Tmobile representative at a store. It might be worth getting it from Tmobile and make them liable (just in case the handset develops some issues).

After playing with the G1 Phone for a while, I thought it was a worthwhile investment for me, as I was able to get on the internet anywhere with the data plan. K-9 Email (just released a more stable version yesterday) and AIM IM (continuously improving) work well on this RC30 revision of the platform now, and honestly, that was all I needed to work efficiently; effectively, I had bought my independence.

The Android Market/Application Store


One of the most fascinating selling points of the android platform is the Market, which is in Beta stage till 15th Jan 2009, which effectively means that all applications are free on it. (The Pacman game is the lone exception, I guess). There are some very creative people out there who are developing applications left and right. I remember that when I got hooked to the market, I would check out the market almost every night and try out new programs.
This was also the time when I logged a lot of bugs/enhancements through http://code.google.com/p/android/issues/entry website. It was quite concerning to see that this website was not very much publicized, though. I guess Google wanted to keep it quiet till the Beta stage was over.

Streamfurious - Great potential


When I first played the StreamFurious application, I was fascinated at the various radio stations that I could play. It also set me thinking as to what was shoutcast/icecast in the first place.
On doing a bit of Googling, I came across some posts and youtube videos of how to build a shoutcast server, which seemed lucid enough.

http://www.frihost.com/forums/vt-15354.html - This is the one I used for my shoutcast server
http://wizardskeep.org/mainhall/tutor/shbroad.html -- this one has screenshots

http://www.youtube.com/watch?v=c1leou1vqE4 - This is a good video for Linux installation (recommended for stability)

This morning, I had some free time on my hands and decided to look into creating my radio station. I only used the first link, http://www.frihost.com/forums/vt-15354.html, and I was up and running with my station within 1+ hour (includes discovery and trial/error time). Now thats really OPEN technology.

Apparently, there are a lot of FREE shoutcast servers on the internet, and the most popular of them seem to be WINAMP's shoutcast plugin (from winamp.com) and the shoutcast server from shoutcast.com.

How does it work..


Come to think of it, the technology itself is quite simple, after all the abstractions and implementations.

The actual audio track is played in Winamp. Winamp, in turn, has a plugin, which talks to another Shoutcast streaming service (installed through the Shoutcast server). The Shoutcast service talks to the shoutcast.com servers for registration/status etc. and makes the audio available to internet users.
The entire flow could be depicted as:


Winamp (play audio here) --> Winamp shoutcast Plugin --> Your Shoutcast Server <--> Shoutcast.com

/\

|

Internet users (Shoutcast clients)

In addition, I had to enable port forwarding in my home router for port 8001 for 192.168.0.2 IP, so that external users could talk to my shoutcast streaming server.

Some Setup considerations..


One thing to note here is that I had to wait for an hour or so before my station actually got registered with shoutcast.com and was showing up in the search.
It seems that when the shoutcast server log shows this message, the registration can be assumed to done:

I think this is the right log message to look for the station registration..

<01/07/09@12:09:28> [yp_tch] yp.shoutcast.com touched!
<01/07/09@12:19:37> [yp_tch] yp.shoutcast.com touched!

Another thing to mention here is that the upload speed of the internet connection on your shoutcast server matters and would be key to decide what encoder setting you would use. If you expect N concurrent users and you arebroadcasting at 24kbps encoder setting, then your overall upload requirement is (N x 24) kbps at any time.

shoutcast-log

You got to make sure you can sustain that upload bandwidth. Even with 24 or 48 kbps, you get pretty good results. The default number of maximum users is 32, which is not bad for experimentation over cable modem internet speeds.

shoutcast-encoder-freq

Also, remember that the lower your encoder settings, the more people can connect to your radio station. Know that BBC UK streams audio at 24kbps, so its not bad to use smaller settings. (but then they must be having a cluster of shoutcast servers and multiple relay server too, I'm guessing).

I started off with 24kbps first, but later switched to 64kbps to experiment with downloading speeds for StreamFurious. Also, I was using Comcast High speed Internet with download speed of 3.5mbps and upload speed of 1.5mpbs (speedtest.net would tell you).

Mantra Pushpam @ Atlanta - My Radio Station


mantra-pushpam

I always wanted to listen to Vedic Mantras/Chants whenever I wanted to. Thanks to Open source technology (shoutcast), Google, HTC, Tmobile and ebay, now I am able to play Vedic chants/Mantras on the G1 phone through StreamFurious client.

shoutcast-server-running

All I had to do was click on http://71.204.14.23:8000, click on Listen tab and the browser redirected the request to Streamfurious, which then added the station through the listen.pls file and buffered media upto 2mb before playing the streaming audio. Now, I was on an EDGE connection, so it took a while for the buffering to happen. On 3g Networks, it should be even faster.
Note that Streamfurious does not have the capability to add a radio station manually as of now, but if you go to the source URL of a streamcast server and click on Listen, the default browser is smart enough to redirect the request to Streamfurious. That's how I'm getting around it for now.

For the iPhone users..


For the iPhone users, there are FlyCast (FREE! Very cool article here: http://cybernetnews.com/2008/09/16/free-iphone-app-streams-music-in-the-background/) , iRadio and Shoutcast radio applications that came out in the market. I am still having my iPhone friends try this out.
Here is a very good article on how to listen to Shoutcast radio stations using iTunes.. http://cybernetnews.com/2008/10/23/cybernotes-add-shoutcast-radio-streams-to-itunes/

Another good article with Video review is at http://www.appvee.com/t/shoutcast-radio

For them BlackBerry users..


For the Blackberry power users, FlyCast works well for them. Information on how to download and install FlyCast is available at http://www.blackberryforums.com/aftermarket-software/158658-flycast-download-links.html

When the installation dialog comes up, click "Set Application Permissions" and then click "Download". On the configuration screen, change the "Connections" and "Interactions" settings from "Custom" to "Allow". Press "Back" and then "Save". The application will download and install. If you have a Bold - Run "FlyCast" from the Downloads folder

If you have a Curve - Run "FlyCast" from the general "Ribbon"

You have have to register here - FlyCast - Now your smartphone is complete, then  log in from your BB.

FlyCast has set up a support site for iPhone and BlackBerry users. Please visit FlyCast Forums Index page for tips on getting the most from FlyCast on your BlackBerry.
Additionally, You can also run audio streaming through the Slacker application, as seen here : http://blog.laptopmag.com/video-hands-on-with-slacker-application-for-blackberry

StreamFurious Vs AntPlayer


When I tried running the station again later today with StreamFurious (version 0.0.6), it started deleting the buffer first (which it was not recycling -- seemed like a bug for sure. I wrote to feedback@streamfurious.com about this and did not get any response from them). The deletion of the buffer resulted in timeouts and not a very good user experience. This forced me to look for more alternatives in the android market for playing shoutcast streams.

Through http://www.howardforums.com/showthread.php?t=1468651, I found AntPlayer, which seems to be more mature in terms of finding stations (the search feature actually works) and also a good buffer recycling mechanism.

On day 1, I had better success with AntPlayer for some reason. However, on the subsequent days, at random times, StreamFurious seemed to work better than AntPlayer. Actually, AntPlayer seemed to hang while buffering totally, while StreamFurious did not seem to repeat the buffer deletion syndrome anymore. (It COULD have to do with the fact that I had restarted the shoutcast server a couple times on the first day itself).

A caveat with StreamFurious seems to be that it uses up the battery very quickly. Also, it seems StreamFurious is getting more publicity in the market due to the keyword Stream in its application name.

http://mantra.podzone.org:8000/listen.pls - Making the radio station URL  user friendly and Pnemonic to memory


Since I am running this station from my home on a regular Dell latitude D630 laptop on Windows XP and Comcast Cable internet (behind a Netgear router), the actual external IP would change from time to time. I wondered: How could I make the radio station's URL independent of the IP?

Then I remembered that a long while back, I had used free DNS services provided by dyndns.com. DynDNS has many paid services, but you can associate an IP to some predetermined domains (you get to choose the sub-domain though) for FREE.

So I created a free account on dyndns.com and associated my shoutcast server's external IP 71.204.14.23 (got through http://www.Whatismyip.com) with mantra.podzone.org.

update-for-mantra-podzone-org1

Whenever I would have to reset the internet connection or restart Windows, the external IP would change. To re-associate the latest external IP, I would simply go to https://www.dyndns.com/account/services/hosts/ and assign the latest IP (it detects the external IP auto-matically) to mantra.podzone.org. This way, the users do not have to remember anything, but  http://mantra.podzone.org:8000/index.html.

If you click on the Listen subtab, the browser should be able to open the listen.pls (playlist) file with a suitable application on the mobile OS.

You've got to utilize the power of free stuff on the internet.

Network utilization Stats..


Now, I was also interested in the network utilization stats on my wireless network due to shoutcast broadcast per user. When I played the station through streamfurious on my G1 phone, i monitored the local wireless network interface's bandwidth usage (11mpbs maximum bandwidth) and got this graph:

wireless-bandwidth-usage-from-task-manager

As you can see, it was using less than 1% of 11mbps bandwidth per mobile user.

Feedback welcome


If you found this article helpful and would like to discuss/express your views, please do leave a comment and we can discuss over web/email.

Thanks a lot for your time to read this article!

No comments:

Post a Comment