Google Andriod : Open?? – Part 2

This is a continuation of the Part 1 of discussion on Google Android.

So will we be able see Android on the iPhone, the Nokia N95, or even the Motorola RAZR cellphones? Herein lies the biggest misconception about Open OSs.

Open-source really means that the source code of the OS is available for ALL to be used. So we can read it, port it, re-compile it, program it on some device and do whatever we want with it. But it doesn’t mean we can run it on ANY cellphone. The restriction is not the SW but on the HW. To understand this, we have to look at how Cellphones work.

Cellular networks, on which all cellphones run, require a specific signaling protocol to be used to talk to them (Baseband communications). These protocols include layers of security, error correction, and meta-information to ensure usable communication quality for all. There are also many security mechanisms built into these devices so that users will not be able to spoof as other, or Hijack a signal, or spam the cell tower, etc. And thus, many cellphone OSs (more on this later) till this date have been Closed. That way nobody will be able to “hack” their way into the phone by reading the code and do something nefarious.

With hackers getting better equipped, many cellphone manufacturers started having heavy “chain-of-trust” security mechanism in the cellphone to ensure that nothing else except their own, valid, (and hence not doing anything nefarious) code runs on it. The idea here was to have each component validate and ensure that the next component can be trusted before handing control to it. And this whole chain is “anchored” in some HW, so that every time the cellphone powers on, HW will ensure that the 1st component (say like a BIOS) is valid before start it, and the BIOS will ensure the validity of the OS and so on and so forth. Hence it’s very difficult to run any code on modern day cellphones other than what has been “blessed” by the manufacturer.

Furthermore, these signaling protocols have a strict real-time requirements, and thus need an OS which support Real-Time scheduling to handle this signaling. Linux inherently does not support Real-Time scheduling (There are variants of it which do, like RTLinux, etc) and so it can’t be used to do the Baseband communications. And thus most cellphones will have multiple OSes running together. An Baseband OS (or a Modem) and your usual “SmartPhone OS”. And these two need to talk to each other in order to work and place and receive calls, data, etc. So the “SmartPhone OS” needs to know how to talk to the “Baseband OS”. This is not as easy as it seems, as many times the Baseband OS is propriety and generally Closed to prevent any tampering by the user, especially since many security mechanisms (like Subsidy Lock in the case of the iPhone) are implemented by the Baseband OS.

Hence, there are two problems in getting Android running on any generic phone. 1. Does the HW even allow some other OS image to be programmed and run on the phone? 2. Can Android talk to the Baseband OS and use the phone side of things.

In most phones the HW will only allow the original OS to boot, and no one knows what/how the Baseband OS works and how one can communicate with it. And this is why I feel it will be very difficult to see Android running on other phones, without the HW manufacturer themselves supporting it explicitly.

So is Google Android Open? Surely!! But that doesn’t mean you’ll see it running on an iPhone close to you anytimes soon..

Advertisements

Google Andriod : Open?? – Part 1

This is a two post discussion on the Google’s Android OS.

Android

There has been much furor recently, about Google’s new Embedded Operating System “Android“. The biggest reasons for the attention are the clout of Google as a player in the IT industry, and the fact that the Operating System (OS) is completely Open-sourced. So let’s look at this “Open”ness of Android and a few misinterpretation people have about it.

Google has basically picked up the Linux Kernel, which itself is under the GPL License (Open-source), modified it to work on Embedded systems, and added their framework on top of it.  This frameworks allows users to easily develop application which can run on the cellphone. The idea is once you write an app using this framework, you will be able to run it well on all products which have Android ported to them, a very Java-esque premise. And not surprisingly, most of this functionality is exposed to the developer through “Java”.

Android itself will be release under the Apache License where applicable and under the GPL elsewhere.(Another interesting side note here, is that since the Mobile Edition of the popular Sun Java Virtual Machine, is not completely Open-sourced, Google went ahead and generated their own Virtual Machine and will be Open-sourcing it under the Apache License. You can read more about this here).

So there are two important aspects of Android, which the community at large is excited about. The comprehensive (erm, maybe not so much) and open sourced APIs, or libraries, for the developers to make their applications. And the OS itself which is open. And these two are NOT the same. The benefits arising from these are also NOT the same, and in fact not at all related.

An Open API for App development allows the community to add new functionality to the libraries given by Google. For eg. “Display refresh API takes too long to execute? No worries, we can look at the code, and optimize it and generate a new library which is faster and use that”. More realistically, sometimes it helps to look under the hood into the libraries and API to see exactly what they are doing to be able to use them wisely and properly.

The Open-sourced OS itself is a whole different ball game. OSs, especially Embedded OSs, are generated to run on specific Hardware, a specific platform, for eg. an ARM9 or an PowerPC, or an x86 processor. And a specific operating system image will not run on another platform unless it is compiled for it.  So having an open OS will allow the community to make ports of Android to various platform. We have already seen this with the port of Android to the N810 HW, and cellphones or mobile devices are not the limit. In the latest episode of Tekzilla, Patrick Norton talks about how Android would also be useful in Set-top Boxes, and all other Embedded devices which require user interface.

Also, an Open-sourced OS will allow the community to hack, fix, tune and tweak the OS to make it do whatever they want. Things like enabling new functionality, protocols, supporting new peripherals, or improving the performance for certain types of applications, etc.

So the golden question is, will we be able see Android running on the iPhone, the Nokia N95, or even the Motorola RAZR cellphones? Herein lies the biggest mis-conception about Open OSs.

Check out Part 2 of this article for the rest of the discussion on Google Android and Cellphone OSs.

Hak5 <3 Rev3

So recently my favourite videocast.. well one of my favourites, Hak5 joined the Revision3 network.. WOOT!!

Now they release weekly episodes with more hacking and l33t stuff.. So here’s to the Hak5 guys..

Trust Your Technolust!!..

Indulging the glutton within..

Since Dad is in India, Mom and I decided that it was time to indulge the gluttons in us… So we had..

1. Lebanese Food at El Sheikh on Tuesday

I was inspired by the outing Rinaz et all went to, so we decided to go to El Sheikh.. We just had 3 starters (Hummus, Mossaka’ah, and Falafel) and we were almost full. And they had ran out of Baklava. So we decided to roam around looking for it.. Finally we found some at Alaturka. I had Baklava and mom had mint tea, which she thought was really good.

2. Home-made Pizza on Thursday

Home-made pizza just rocks. Especially when mom and I bake together.. So on Tuesday we decided to have Pizza for dinner..

Vegetable Pizza

Vegetable Pizza

Pine-nuts and Olives Pizza

Pine-nuts and Olives Pizza

We made a couple with loads of vegetables, and one with just pine-nuts and olives… as I like it.. But I forgot to put parmiggianoon on it.. :( ..

3.  Durians on Friday.

Since it’s Durian season, we decided to eat Durians on Friday. I joined mom after work to eat Durians at at the shops near Aljunied MRT. Now, I am no Durian expert. I don’t understand anything in Durians.. When the guy showed me the split durian to check if it was OK, I just said yes and started gorging it down.. Hahahaha.. Who cares about the subtle differences, they all taste nice.. :)

4. Pasta on Saturday.

So what do you do when you have left over pizza toppings?? Why? Make pasta sauce out them of course!  That’s what we did. Mom made a nice hearty vegetable Pasta sauce on Saturday, while I was roaming around NDP taking photos.. There’s something you can’t beat in a simple tomato-vegetable pasta topped with parmiggiano..

5. Tacos on Sunday.

We found some Taco shells while shopping groceries last week, and we decided to make Tacos for dinner on Sunday. Vegetarian of course.. I made fresh salsa, and mom made beans.. It was kinda burrito+taco+nachos mix thing we had.. Wasn’t anywhere near authentic.. but tasted damn good.. :)

Chip of the old block they say.. I am sure you can guess where my love of cooking and eating different types of food came from..

Ambar..

Ambar pe milte hain qadmon ke nishaan tere hi, har shaam.
Khidki pe likhe kooi, oo uus kii boondon se tera naam.

Na khelo sanam
Tere hi hai hum

Dhadkaniye mere dil ki,
Puche re, tere dil se,
Ki such much kya hai tu duniya me?

Jab aaoge tum tab gaayenge hum
Sargam ye saje, tere sang sang
Is khwaab ko such kar ke hi jaana re

Raghu Dixit.

SMB2 Chatter..

I was walking around with the H4 during Social Media Breakfast 2 a few weeks ago…

Here is the chatter that was recorded…

I only got the 1st bit of the recording, the 2nd bit was corrupted.. :(

USB device Charging de-mystified.

Warning : Super technical, geeky post ahead!

I was watching Episode 52 of Systm, and Patrick was trying to hack/mod an iPod/iPhone connector to allow it to charge using various sources other than the USB port of your computer. He also wanted to get the line out audio from the connector to connect to any Audio System.

Aside : Systm has just revived into the awesome show it started as. Patrick did one on distillation, two on iPod/iPhone hacking/modding and possibly more coming up. Do watch it if you are interested in this type of stuff.

So, Patrick was able to power up and charge the iPod (a 5th Gen iPod, I believe) by connecting just the VDC and GND pins of the connector to a 5V supply (possibly a VCC pin on a USB cable) and GND respectively, the same did not work on the iPhone. Why??

USB

For this we need to look at USB’s electrical specs, especially the power sinking and supplying parts.

There are 3 classes of USB hosts and 3 classes of USB devices/functions defined in the specs. Hosts are devices like PCs, USB hubs, etc, which can connect to multiple devices and act as the “Master” in most transactions. Devices are “Slaves” in a USB connection. All cameras, phones, thumb drives, etc are considered as devices.

The power source and sink requirements of different device classes can be simplified with the introduction of the concept of a unit load. A unit load is defined to be 100 mA. A device may be either low-power at one unit load (100mA) or high-power, consuming up to five unit loads (500mA). All devices default to low-power. The transition to high-power is under software control. It is the responsibility of software to ensure adequate power is available before allowing devices to consume high-power.

So the 3 USB Host Classes are..

Root port hubs: These are directly attached to the USB Host Controller. Systems that obtain operating power externally, either AC or DC, must supply at least five unit loads to each port

Bus-powered hubs: Draw all of their power for any internal functions and downstream facing ports from VBUS on the hub’s upstream facing port. Bus-powered hubs may only draw up to one unit load upon power-up and five unit loads after configuration.

Self-powered hubs: Power for the internal functions and downstream facing ports does not come from VBUS. However, the USB interface of the hub may draw up to one unit load from VBUS on its upstream facing port to allow the interface to function when the remainder of the hub is powered down.

And the 3 USB Device Classes are..

Low-power bus-powered functions: All power to these devices comes from VBUS. They may draw no more than one unit load at any time.

High-power bus-powered functions: All power to these devices comes from VBUS. They must draw no more than one unit load upon power-up and may draw up to five unit loads after being configured.

Self-powered functions: May draw up to one unit load from VBUS to allow the USB interface to function when the remainder of the function is powered down. All other power comes from an external (to the USB) source.

So basically, there are hosts that can supply up to 500mA and devices which can sync up to 500mA. However, all hosts and devices will default to supplying and sinking (respectively) 100mA. And to switch to the high power mode, the device software (USB Stack) has to request the host to start providing 500mA. This request has to be done through the Default Configuration Pipe of the connection, using “SetConfiguration” USB Device Request. In this configuration, the value of maximum current, in mA, can be set. However, these requests go over the D+ and D- USB pins, since all data goes over those pins. And so, these pins have to be connected to allow the Device to request 500mA.

Now that explains why many times our devices just can’t charge over those USB Wall-Chargers, because they request and expect 500mA charging configuration, but since the USB Wall-Chargers are not “hosts”, and don’t have any micro-Controller or any USB Stack running, they cannot reply to these requests. For that matter, most of them, just like Patrick’s charger, don’t even have D+ and D- pins at all. And since the device can’t get 500mA, it can decide it can’t charge and stops.

So now, finally the question is, why can an iPod charge on 100mA (I have tried it using a USB Wall-Charger, it works), but the iPhone can’t.

The answer is simple, iPhone has a GSM radio for the cellular telecommunications. And GSM radios draw huge amounts of currents when they broadcast the data in bursts. So during these bursts, they may sink in the range of 70mA. So if you have a flat battery, and a charger providing only 100mA, and a radio sinking 70mA, only ~30mA is left for the other components including the touch screen and the backlight. Running on low current might cause many issues, especially on displays and touch sensors. So Apple must have decided to only charge the iPhone, (and in the case of low battery, allow it to boot-up), if 500mA configuration has been successful.

There you go, some interworking of USB and Charging on devices.. Drop me an email, or comment on this post, if you have any questions or queries about these things, and I will try my best to answer them..

It will be a cold day in Singapore…

It will be a cold day in Hell Singapore before I will use Windows again…

Rant aside, I went to participate in The REAL Singapore Freeze on Saturday. The idea is simple, all the participants randomly gather at a given location, which is communicated 1h before the stipulated time. And the participants have to freeze on the spot, doing whatever they are doing at the stipulated time for 5 minutes. And then, exactly after 5minutes (timed with synced stopwatches), just walk away like nothing happened… Absolute freeze though… No eye movements, no smiling, to blinking, and no breathing… OK I kid about the last two.

I liked the idea for it’s freshness and it’s tongue in cheek artistic sense. I mean after all it is a kind of performance art, but something different. There is something inanely artistic about freezing in a certain posture. It’s akin to a photograph, where a certain moment is captured in history.. OK enough of artsy stuff..

So finally, we were to freeze outside Ngee Ann City, at 430pm on Saturday. Freeze you say?? At that time, at that temperature, it was more of a Singapore Melt! But in the spirit of the event, we went ahead and melted there for 5 minutes.. It was fun, but being the extreme extroverts that Singaporean are, we only got a couple of stares and mostly murmur of the “crazy lah these people.. who ask them do this kind of stupid things… sure gonna kena mata already” type.

Overall, I thought it was well organized by Mission:Singapore, although the place and the time should have been considered. The place had another event happening, so the effect of “a whole square being frozen in time” didn’t come through, as we couldn’t even see other “freezers” (term copyrighted by hisham). Also, it was too early and too hot to do these things under the sun. I mean yes, we have had our bit of sun during PE lessons back in school, but that was enough wasn’t it??

Here are some videos of the event. The 3rd one covered our area.. :p

P.S. If you like this.. They have another event coming up.. Read more about it here

Audio geekout at Esplanade on May Day..

Last week, I got a chance to do something I have been wanting to do since the 1st time I stepped inside the Esplanade; stand behind their audio consoles! (warning! nerdy post ahead…)

Background

Thanks to references from by some family friends, I got a chance to “consult” the Esplanade sounds engineers during a concert last week. It was a North Indian (Hindustani) Classical Musical concert organized by Engage: Consumer Interfaces, an events organization founded by two (I believe) IIM alumni. Engage has been bringing many great artists from India to Singapore for concerts for the past few years.

This year, they invited Pt. Sanjeev Abhyankar and Dr. Ashwini Bhide-Deshpande for 2 separate concerts on two evenings, 1st and 2nd May as a part of the “Young Masters in Concert“.

Esplanade

I went a few hours before the concert for sounds checks. Now, if you have ever been backstage at Esplanade, you’d know that place is a freaking maze. There is no way anyone can figure out the place without a map. I did get lost.. a few times. Luckily, thanks to this pass, I had free access to the backstage for two days!

My access pass..

Sound Checks

The concert was held at the Recital Studio of Esplanade. The stage was just being miced up as I arrived. They were using a Sennheiser EW series wireless mic for the main vocals. A Sennheiser 441 for the Tabla, a Shure SM58 for the Harmonium and Shure SM57s for everything else form the electronic Tanpuras to the Manjiras. The Sound Engineer knew his Indian instruments and told me that he had chosen those mics on purpose, considering the sound of the instruments, the room and the atmosphere that was needed.

Leveling

Next, we did the leveling on the console. The console was a Soundcraft Vi6. Here are some pictures of it.

The Soundcraft Vi6

The Soundcraft Vi2

The console totally blew me away. The I/O capabilities are totally unheard of, and the control surface itself had 40 motorized fades, 5 Vistonics II touch screens, and loads of stuff I did not even know about. I was just too fascinated by the flying faders for the 1st few minutes to look at any other details.

The Vistonics II screens allowed the selection of any part of the signal chain, which then showed up on faders for detailed control. The Vistonics II touch screens also had knobs and buttons to do more settings. The configuration options were unbelievable and totally confusing. And finally it had an awesome glow in the darkly lit Recital Studio.

The levels for Pt. Sanjeev Abhyankar‘s concert were set too hot IMO. But he insisted on them. The classic sound engineer’s dilemma; Artist Expression or Audiences’ Ears? The levels for Dr. Ashwini Bhide-Deshpande concert were set nicely. Though she tended to move away from the mic, causing issues later during the concert.

After the sound check I went out for a break, and came back just before the concert itself.

Concert

All through out the concert, the Sound Engineer kept adjusting the levels and the gains for the various instruments by himself, and according my suggestion (which as my “job”). However, around 30mins in, he pulled up a screen using the Vistonics II touch screens for a effects processor module which he had placed in the signal chain. It was a reverb module from one of Lexicon’s effect processors.

Here are some shots of the screen.

The compressor module on the Soundcraft Vi6

The compressor module on the Soundcraft Vi6

The amazing thing about this module was the fact that it could use the current BPM information, which had to be fed in either using a know or tapping a button on the beat, to improve the reverb processing. It also had parameters like room size, room type and more to control the reverb effect. While the Recital Studio itself had been deadened using curtains and all, the reverb processor was being used to bring warmth to the sound..

Conclusion

Both the concerts totally rocked. Though I personally preferred Dr. Ashwini Bhide-Deshpande’s recital. Her voice, the music and the atmosphere was totally mesmerizing.

It was a great experience for me both from musical and technical perspective. Oh and I also got to share a car ride home  with Pt. Sanjeev Abhyankar :D.

I am hoping to do such stints again, and hopefully one day learn to professionally handle such consoles and mic such concerts…. It’s when great technology meets great music, the magic happens..

Stories for 65Bits episode 65.

This was published here because the Tech65 website was is down. These were the stories we covered during the live recording of episode 65 of 65Bits. The original post is here.


Class, this is your assignment for today. YOU have to read through all the stories below, and prepare for the discussion during tomorrow’s live recording. If you are unable to answer our questions tomorrow, you WILL BE made the the outstanding student (the student standing outside the class)…

We expect all students to be badly behaved, and participate in the discussions impolitely and rant about things… You will be graded on your performance.

1. April Fools Panks on the Interweb.

Engadget

Engadget vs T-Mobile (Apparently not a joke. More on that tomorrow.)

Blizzard

Tauren Marine

Pinata Loot

Bard Class Hero in WoW

Ping.sg’s “Whose pong is it anyway” game

iPhoneDev team

iPhone Dev Team quits.

2. Unlimited Tunes from Apple? Not So Fast

Rumors of a new music service appear to be just that

3. Vista Issues

Early adopter’s issues.

Nvidia driver issues.

4. Creative to sell company HQ for $180m

Creative will sell HQ building and rent it back to save $$

5. Creative Goes After Driver Modder

Creative stops distribution of home grown vista driver.

Driver author responds.

6. Eeee PC Updates: New models and SDK

New 9″ Eee PC wth touchscreen?

Eee PC SDK out soon.

7. Fari and Jerrick’s Experience at M$’s Xbox 360 Event.

Check out that Riff!!!

8. Byte of the Week : Adobe Photoshop Express

Photoshop on the Web!

___________________________________________________________________

For those who missed the other posts, the details of the live recording are follows.

65th Episode of 65Bits Podcast.

Date: Saturday, April 5, 2008

Time: 10:00am – 12:00pm

Location: Geek Terminal

Street: 55, Market Street (Near Raffles Place MRT, opp. Golden Shoe Complex)

City/Town: Singapore, Singapore.