March 2017
« Sep    


A release in time

Yesterday was a milestone release for the project I’m currently working on. Releases are always fun and there are a lot of interesting stories about them.

My domain, which revolves around multimedia on embedded devices like smartphones, tablets, Video Conferencing and Surveillance equipment, STBs & OTT boxes etc, has very frequent product releases and updates, which means really tight deadlines. Slipping deadlines are unacceptable. Product releases have to happen as fast as possible, before competition can release a similar product. There are also hard  deadlines at shows, factory lines that have been blocked etc etc.

This means, almost every release is going to be a Slogfest. You can do your best to plan for it and account for everything, but you will still end up in a slogfest situtation. Usually, every release is a mad dash to the end, trying to squeeze in a few more bug fixes, ensuring all functionality is complete, documentation is clean etc etc.

Usually the customers are based out of the U.S. This means their morning would  be night here in India. That means an extra day for us. Also releases are usually planned for a monday morning: gives you two extra days over the weekend, and of-course all day monday.

Some people cheat by promising a release on a Friday: Well Friday “implicitly implies” Friday evening. And my dear American friend, you will leave early on friday, you need to head out for your camping or fishing or whatever trip. SO, since you are not going to be around on a friday evening, or the saturday or the sunday, lets have the release ready for you by Monday morning.

On the other hand, the timezone buffer is missing with the South East Asians and Europeans. Here, there’s only one resort, the dreaded “Night Out” or “All Nighter” or working the entire night.

Now nobody likes to pull off a all nighter. The guys who really have a miserable existence here are the testers. They need to wait out and while away time, while the developers complete their work, then do the sanity tests, wait for another round of bug fixes and complete verification of the release packages. Somehow, the testers still manage to be cheerful and excited. They are amongst the happiest people you will ever find.

Anyway, some projects do not have that QA net. The sleep deprived and caffeine crazed developer needs to do the release himself. And in such situations, mistakes are made: the package fails to build (err, forgot to checkin a bunch of files), the device won’t boot (err, the rootfs is missing all the dev nodes), the documentation doesn’t make sense (oh crap, its from the last release)….

Sometimes schedules are so tight that people end up camping in the office for weeks on end: no weekends, no holidays, no showers (….), sometimes no going home for days. Very easy to spot these people: baggy eyes, stubble/mini-beard, crazy hair, crumpled clothes and general disheveled appearance.

So how did my release go? Nearly perfect! :)




Elements of a Video Conferencing System

I work in the embedded multimedia domain. Video conferencing is one of the more exciting fields that I’ve worked on. I thought I’d make a list of  elements  and topics of interest when talking about a VCS. Not a complete list, treat this as a work in progress…

  1. Signalling stack: SIP, H.323, XMPP (+ Jingle)
  2. RTP stack and packetizers and depacketizers
  3. Jitter Buffering
  4. Video codecs: h.263, H.264 AVC, H.264 SVC
  5. Audio codecs: g.711, g.726, g.729
  6. NAT traversal
  7. IPv6
  8. AEC
  9. AGC
  10. Audio beam forming
  11. Error Concealment
  12. Bandwidth Adaptation
  13. A multimedia framework
  14. DTMF Tone generator
  15. Legacy protocol gateways
  16. Video and Audio mixers for multi-channel
  17. Instant Messaging


HD Skype Calls

Sometime back, PathPartner‘s skype demo at MWC was covered by engadget. This was a demo, running on OMAP4+android, doing 720p (1280×720) between two boards. Skype on OMAP4+Android might be our flagship demo, but its not the only SoC/OS on which PathPartner has skype running.

With boards, We have accelerated video encoders and decoders which make achieving 720p relatively easy. With a PC, the story is slightly different.

Skype defines HD as upto 720p (1280×720 ) and High Quality as  upto VGA (640×480).

There are Skype HD webcams available in the market today. These webcams use a special USB-UVC extension to send H.264 encoded video from the camera to the PC. So the PC just has to encrypt and stream this video. This reduces a lot of CPU load and has performance benefits.

I’m only aware of certain facevision and freetalk webcams which utilize this USB extension. I haven’t been able to achieve 720p calls with any other camera.

A skype call will usually start at a lower resolution, say QVGA or VGA and then switch up to 720p over time, depending on bandwidth availability, CPU load of hardware etc. Also, the video probably reaches about 22fps with these cameras at about 1-2MBPS bitrate.

Initial versions of these skype HD webcams might not switch to 720p. Nothing lacking in the hardware: There were firmware updates that were released later which allowed the 720p switch to happen.

Skype will also insist on using tlatest versions for making HD calls (5.0+ on windows and 2.2 beta on linux).

Recently, skype opened up an updated UVC extension specification. Hopefully, this encourages a lot more vendors to manufacture skype enabled HD webcams, bring down webcam costs and also improve performance to 30fps@720p.

Belkin ADSL Modem and Wifi Routers

This seems to be the  brand that’s best stocked in stores around bangalore. Belkin markets these as “Surf”, “Share” and “Play”.  They might throw in a “+” here and there into the names.

They all look identical except the higher end ones probably have USB ports.

Share and Play are based on Broadcom hardware, use linux and have DD-WRT firmware updates available. In-fact Belkin releases their entire firmware sources here.

Surf on the other hand is super tiny. Its firmware sits in something like 1.2MB. Looking at the firmware image, it seems to use a proprietary RTOS which seems to be popular with such ADSL modems/ wifi routers.  If somebody can give me some clue about whats running here it would be great.

To get into the bootloader, you would want to unplug the power cable, press the reset button and while holding it in, plug the power cable back in. You should be able to connect to after that. The bootloader offers dhcp ip addresses and allows resetting/flashing. I believe it briefly accepts tftp connections too.

So how do I know all this? Well yeah, I guess I goofed up. I should’ve looked up the dd-wrt supported hardware list first.

Running your Existing Ubuntu installation inside virtualbox on Windows 7

Firstly, why would you do that?
I mean run an existing Ubuntu installation inside windows 7. Its possible to go about it the other way, but this is far simpler. Windows is kind of hardware change unfriendly. When the installed windows detects that the IDE has changed (you are booting a vm) its going to require re-registeration. This wont be a straightforward process if you have an OEM license, which is what you will have if your windows came bundled with your laptop/desktop. On the other hand, linux kernels are soooo easy with hardware changes.

Hardware Requirements

This you will probably find in some virtualbox documentation, but from my experience, I would suggest:
1) older processors like pentium 4, pentium D do not have virtualization support (VT-x on intel cpus). VM performance will be quite poor on these. Only install the VM if you have a relatively new processor.
2) You need a decent amount of RAM. 2 gigs with atleast 750MB allocated for the VM should be a minimum requirement for newer ubuntu versions (10.x etc)

Getting Started:

Before I get started, I’d like to thank the author of this article which I found extremely useful.

1) Download and install virtualbox. Its generally suggested that the non-ose edition is much more up-to-date than the ose edition. Whatever version you use, please go through/understand and respect the license under which the version is released.

2) Create the vmdk file:
2.1) Find the partitions that are used by your linux installation: start cmd as admin and cd into the directory you installed virtualbox and run:

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe internalcommands listpartitions -rawdisk \\.\PhysicalDrive0
Oracle VM VirtualBox Command Line Management Interface Version 3.2.8
(C) 2005-2010 Oracle Corporation
All rights reserved.

Number Type StartCHS EndCHS Size (MiB) Start (Sect)
1 0x06 0 /1 /1 25 /254/63 203 63
2 0x07 26 /1 /40 1023/254/63 23999 417792
3 0x83 1023/254/63 1023/254/63 161242 49567744
5 0x07 1023/254/63 1023/254/63 42343 379792728
6 0x82 1023/254/63 1023/254/63 8635 466513920

PhysicalDrive0 indicates the first hard disk. Sort of like /dev/sda, /dev/sdb etc. Partition types 0×83 and 0×82 are the swap and ext3 partitions here.

From the listing identify all the partitions that are required by linux ( rootfs, swap, boot…)
Dont consider NTFS/VFAT partitions that you want to share between linux and windows.

2.2) Create the vmdk file with the partitions you just identified

VBoxManage.exe internalcommands createrawvmdk -filename C:\path\ubuntu.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 3,6 -register

3) Start virtualbox. You have to start it as administrator, otherwise it wont be able to access the rawdisk.

4) Create a new VM using the vmdk you just created. This is a straightforward process. You would want to enable IO-APIC and if your box has muscle, allow more cores, 2d/3d acceleration etc.

5) And now, you’re all set. Start the VM. You should see the familiar grub boot screen. Select your ubuntu installation and it should come up without any issues.

6) MOunt vbox host additions and install it. This will give you a lot of useful features, like higher resolution display.

Some tips, tricks and problems to be aware of:

1) Use vboxsf to share folders between windows and linux. One thing to be aware of is, at the time this article was written, vboxsf didn’t have support for symbolic links.

2) The VM will be able to connect to the network using NAT. But if you want to do stuff like export NFS shares or use ssh, you would want to create a network bridge. To do this, on windows 7:
a) go to Control Panel\Network and Internet\Network Connections, press ctrl, select both your network adapter and virtual box host-only adapter, right click and create the bridge.
b) Now, on your vm, either through settings, or by right clicking on the vm’s network icon, change your adapter from NAT to bridged adapter.

3) The VM clock can sometimes skew, especially if you hibernate or push your windows to sleep while the VM is running. If you have installed vbox host additions, this shouldn’t happen, but if it still does, one handy trick is to disconnect and reconnect the ubuntu wired network.

4) Whenever ubuntu downloads and installs an updated kernel, it updates grub too. Your VM can only see the partitions that you added into your vmdk while creating it. As a result, it will remove your windows root partition from the grub list. A solution to this, is to reboot into linux and run

sudo update-grub2

long filenames on windows

Ok. A stupid tip.
While trying to setup a windows based toolchain, I was having trouble with one of the tools having a space (Program Files). Using quotes wasn’t particularly useful. In fact the toolchain setup documentation actually advised to ensure there were no spaces. There’s a simpler way out, use a dir /x to get an 8.3 equivalent of the filename and use that instead.

Howto Train A Dragon

Yesterday night went out to see this movie with wifey. The story might seem so typical, however it was really fun to watch and after a long time I felt like I had seen a really good movie.

We saw the 2D version and I guess there’s a 3D version as well.

This is yet another movie that should inspire kids into engineering/science :) . I dont know why kids, especially boys dont see the engineering talent of the hero and emulate that (no, I dont mean go fight crime or villains, I mean go create something. solve your problems). When I was a kid, my heroes were talented engineers, and not genetic abnormalities (batman. I tried creating my own bat cave under my bed, and made my own batman’s belt to carry all sorts of tools.) .

Every movie probably has a core story line that you can extract and this storyline repeats between movies. The core storyline in this movie and another sci fi 3D movie that you can recognize would probably go like this:
hero+hero’s people+nemesis.
hero’s people hate nemesis
hero interacts with nemesis. discovers they’re not so bad.
hero tries to convince hero’s people that nemesis is cool/fun. fails.
hero’s people try to destroy nemesis.
(beyond this point, variations can be introduced…)
epic battle
hero + nemesis + (hero’s people) victorious
happily ever after

So its possible that based on this core line, I can create my own movie. :)
Maybe we can create a story spewing program as well….
watch out hollywood!!!

one week to go….

and I’ll be a married man. So little time, so much to do!!

PathPartner @ CES 2010

Pathpartner, the company I work for, will be showcasing our Android based mediaphone and 3D Graphics solutions @ CES 2010 . If you’re going to be there,  visit our stall and check out our demos : south 4, Booth No 35614.

There’s also a Youtube channel with a couple of videos of our solutions.

The mediaphone demo runs on an Always Innovating Touch Book thats powered by an OMAP3530. The mediaphone multimedia is using hardware accelerated decoders & encoders available on the OMAP.
The advantage of using Android for the mediaphone, is that it provides a ready, open source framework for creating rich UI. There were a lot of challenges with Android’s existing multimedia framework that the team at pathpartner was able to overcome.

One of the guys at work has a couple of screenshots on his blog.

We’re also showcasing our full software OpenGL ES 1.1 library. The library is intended for resource constrained devices which dont have a GPU. The demo video here, runs on an OpenMoko Neo Freerunner. The OpenMoko uses a ARM920T based Samsung SoC thats clocked at 400MHz. The device is running Angstrom based on a 2.6.28 kernel. There’s no X11 and the EGL version here, directly draws to the framebuffer. In the video, apart from the khronos demos, you can see some of the clutter tests that are working with the library. OpenMoko has a 480×640 display and the initial khronos demos are running at QVGA (320×240).

Book Reviews

There were a lot of holidays this month, and I found the time to chomp through three books. Thought I’d put up some quick reviews.

Ok, so the first book is Neal Stephenson’s Snow Crash
The book is really fast paced but I found that the Sumerian history lessons were a drag. This is one of those books where, towards the end, the author seems to get bored and wraps things up real quick

However. The coolest thing about the book is the Metaverse. No fun without a second life comparision. Snow crash probably might have been an inspiration, but the secondlife metaverse beats the pants off snow crash. Some nerd would’ve written a comparision somewhere. Being me, I specifically love the 3d modelling environment and the simple scripting language that allows anybody to try and create stuff that they want to. One of these days I’m going to try hack around my client and try to cut off texture downloads that make rezzing so slow. I’ll probably be like one of the guys in snow crash, who “goggle” in from a “cheap terminal”, but the neat thing is that its only going to appear that way to me :)

The second book, Stephen Budiansky’s Air Power
The book, begins with early days of aviation, development and advances in aviation and engineering, and sheer stupidity that the human race is capable of. I wont go into details because I want to go to sleep. But there’s always some lesson to be learnt from history and books about history:
1) When something is wrong, fix it. Dont try to live with it and make it sound as though its right. The more stupidity in a society, more examples of this, you will be able to find.
2) Dont let success get to your head.
3) Listen to smart people.
4) Delegate responsibility. If you’re asleep after downing sleeping pills, your next in command should be able to call in the Panzer divisions.
5) Learn from the past mistakes and successes.
6) Dont buy a book at the airport bookstore. They charge almost twice its worth.

Book No. 3, that I chomped down over the last weekend: Somerset Maugham’s Of Human Bondage
It would be wrong to consider the book only as a series of love stories/attempts. There are so many relations that are discovered, built and broken. Quite endearing.
Also, as an interesting aside, I felt that the author used the book to critic the arts of his time. Deep descriptions of art, books, artists and poets, that probably do not carry so much of weight in our current time, can feel tiresome, but I guess somebody researching the past would love to have such a nice written record.