Tuesday, October 30, 2012

a brief descent into cell-phone purgatory

I had taken out my Airtel SIM card to try out radiosai using GPRS on an iphone and a windows mobile 5 phone. After putting it back into my HTC Wildfire Android phone, the phone started giving flash messages with junk characters at the rate of 3 messages every five minutes. The messages had two options - save or cancel. If saved, they were saved to the messages folder. The messages looked like this:
Q$ΦIΓ#OB@é(AR7kJM¥ jÆΨ3¡$d0
And when saved were seen to be from the number 4204.

Three messages every five minutes is too much to bear, right? Tried calling Airtel customer care. I did not know what exactly to ask them, I said junk characters are seen on my phone like a flash message. They said they will disable flash messages for my number. But the messages kept appearing. Went upto supervisor on Friday and Saturday. Still no respite - supervisor said that they are logging the issue, expect a resolution time of 48 hours. But till Tuesday, no respite.

The messages would stop at night after 9.30 or 10 pm and would start again the next day after 9 or 10 am. So I was led to believe this was some sort of message being sent by Airtel. But then I was wrong.

Finally thought of google - googled flash messages on airtel htc wildfire and found that these could be due to cell broadcast messages. Then googled disable cell broadcast htc wildfire and found this link which says Settings -> Call -> Other Call Settings -> Cell broadcast. But on my phone, it was in Settings -> Call -> Cell broadcast and was already disabled. I enabled it and then disabled it. And that resolved the issue!

recovering from rm *

V did an rm * on his system when trying to delete his Skype folder. Trying to recover deleted files from his Ubuntu Linux system with PhotoRec by booting with a Live CD.

We needed a root shell to go into the folder and run it - used sudo -i as given here.

Tried recovering from the unallocated space - 153,174,016 sectors - initially it estimated around 4 hours to completion. Actually took 8 hours. And it recovered 320,000 files in 600+ recovery folders! Digging out the actual files which were needed out of that mountain was another task, trying to use
find /folder/where/recovered/files/are -name '*ods'
didn't yield any results, probably open document spreadsheet files are not recognized as such by photorec and are saved as generic binary elf files?

Next step was a search within files for a known string contained within the file, like
find /folder/where/recovered/files/are -exec grep -l "Jaya Jaya" {} \;
But that takes a looong time, since there are many GBs of files. The idea is to do it in batches of a few thousand files. For eg. a search on saiwaves over 173 MB of 10 kB files - around 15,000 files -  took around 2 minutes.

Update: V says he proceeded in a semi-manual way. He used a tool 'search for files' which allowed him to search specifying file size limits and other parameters. He found that there are multiple copies of the same file (versions over time) which have been recovered. And he found that generally the files recovered which are in the same recovery folder were in the same folder to begin with. So he found some ods files with the 'contains string' method, and by opening them manually, found the latest version. mp3 files had their filenames stripped, but he was able to rename them back using an mp3 tagger tool. The whole process took him till 3 am to complete. He restored a backup he had made 15 days ago, and overwrote the files which he had modified over the last 15 days using the recovered files.

Thursday, October 25, 2012

gprs keep alive on Windows Mobile 5

Wanted to make my old Windows Mobile phone a usable internet radio. For that, gprs keep-alive was needed, since TCPMP by itself was not keeping the connection alive even when it was streaming. Instead of the $2 app, this registry hack did the trick.


for the relevant connection (which connects over GPRS, I had named mine as Mo), switch the "AlwaysOn" value from 0 to 1. Then, one can manually stop the GPRS connection from the Connection Manager by turning Data off, but to connect one just needs to do some sort of network activity like make a phone call or something like that, after which it automatically connects and remains connected.

Wednesday, October 24, 2012

disabling a single page in apache

I wanted to disable a html page which had a lot of graphics on it when we were doing live video streaming from the same box. Did it by editing /etc/apache2/sites-available/default

Added a line
RedirectMatch path/to/the/file.html http://radiosai.org/tempUnavailable.html
and restarted Apache.
/etc/init.d/apache2 restart

Saturday, October 20, 2012

more adjustments to the mirrordome

More tweaking after my previous post about mirrordome adjustments in our Planetarium. The distortions of lines which should be vertical becoming slanting on the sides, and of spheres becoming oblate spheroids in projection, were all due to projector and mirror positioning. The default warp settings are for a setup like this, (as shown at Paul's website)

But our mirror and projector were much more angled, like this,

As a result of that, we needed to use keystone correction to make the image on the mirror rectangular in shape (instead of trapezoidal) as seen from the projector as in the somewhat exaggerated drawing below.

The projector and mirror do need to be tilted because ours is a tilted dome, but they should be aligned so that the image on the mirror is rectangular. As Paul pointed out, digital keystone correction reduces the effective number of pixels and so the clarity of the image suffers.

Taking a look at the Bangalore Planetarium as suggested by Paul, found that their Mitsubishi UD 8400 projector with the rated 6500 lumens ($10,000)was giving a much better image, not just in brighness, but also colour accuracy and focus. In comparison, our Optoma EP1080 is 3600 lumens. The pixelation, screen door effect etc was similar, but not so noticeable since their audience sits further away from the dome.

To be done: adjusting projector positioning and colour calibration for more improvements. Also can explore other projectors. Paul also mentioned the Optoma TH7500 (6000 lumens, $9,000) and the Optoma EH2060 (4000 lumens, $1,500) as a cost-effective alternative.

Friday, October 19, 2012

making our own internet radio

Thought this Raspberry Pi hack of a home-built wifi radio would be a good starting point for us to make our own low-cost internet radio for people to listen to radiosai. But then, the cost would be around Rs. 3,000, and for that price Mutant radios are available in the US during discounts. Also, the Raspberry Pi based device is a bit difficult to configure to use the home wifi access point for non-techies. Also, SK said that he has had discussions with a Hyderabad-based mobile-phone assembling company for making our own internet radio with SIM-based connectivity instead of wifi, which would be more usable etc.

Later, I made the following two documents for different options for connectivity:

Options for people in India - http://goo.gl/YO795

Options for people overseas - http://goo.gl/ShwuS

Technical details for connecting - http://goo.gl/GH1DM

(Even though internet radios are available in India, the prices are nearly double the prices in US. Hence, other devices are mentioned as options for people in India. The Logitech squeezebox, for eg. is $100 in the US, but Rs. 12,000 in India.)

Edit - another inexpensive web radio option explored here.

deleting all contacts on iphone

Easy way to do it for the console enthusiasts: just ssh into the phone, delete the files in /User/Library/AddressBook and then reboot.
Was let to it by this forum thread, which has the wrong path mentioned.

Monday, October 15, 2012

more on typing in Hindi on Mac

In August, I'd passed on the following info to A, when he wanted an alternative to copy-pasting Hindi text from google transliterate for use in Google Docs and other apps:

Looking further for typing Devanagari on Mac, found this discussion,

Accordingly, there seems to be phonetic Hindi typing built-in on the Mac. It says,
activate the Devanagari Qwerty keyboard in system prefs/international/input menu and then select it in the "flag" menu at the top right of the Finder and type away.
The Mac Devanagari Qwerty keyboard is similar to the transliterate, but a little different, as described at this link.

To generate default conjuncts, type the first character followed by the Halant (also called Virama) key, then the next character. To generate explicit half-forms for alternative conjuncts, or independent half-forms, type the character followed by the Halant key and the Nukta key. To generate an "eyelash RA," type RA plus Nukta plus Halant. To generate a Nukta consonant, type the character plus Nukta. To prevent conjuncts, type two Halants.
Note that the Halant/Virama key is the D key on Devanagari keyboards and the F key on Devanagari-QWERTY keyboards. The Nukta key is the ] key on Devanagari keyboards and the Shift-F key on Devanagari-QWERTY keyboards. RA is the J key on Devanagari keyboards and the R key on Devanagari-QWERTY keyboards.

A tried it out, and used the "Show Keyboard layout" option to actually see all the keys. Pressing modifier keys like Alt, Command, Control and Shift and also combinations like Shift-Command etc are used for some of the letters. A bit more clunky than google transliterate, but more reproducible and accurate.

Later, A had a problem - the documents he produces in this manner were not compatible with CorelDraw which was being used by Ag on a Windows machine. So, A has to type on iLeap on a Windows machine for Ag's use. The issue seemed to be that of Unicode versus ISCII encoding. So I told hime the following:

The type of font used by google transliterate (and typing with Mac Hindi Qwerty keyboard selection) is called Unicode.

The type of font used by ileap and Coreldraw etc is called Type 1 font, or 8 bit Ascii font, or in the case of Indian letters, ISCII.

What you need is conversion of unicode to type 1 for Hindi fonts.

Such a tool seems to be available at this link where if you scroll down, you find a tool called Unidev which seems to do this Unicode to Ascii conversion. There also seems to be this php code, which could possibly be used to do something like the same conversion. There is also a quick and dirty fix, which probably may not work correctly for Hindi, which is suggested here, simply to use, in the Windows command prompt,
type unicode-file-name > ASCII-text-file-name

Wednesday, October 10, 2012

live video streaming options

Looking for options for streaming live video for more concurrent viewers than currently supported by our single dedicated server, found a nice guide to setting up wowza on AWS at
http://churchm.ag/how-to-build-a-live-stream-for-online-church-on-the-cheap/   Google Hangouts on Air had the problem that it did not work with firewire video inputs on MacOS.   We don't have Youtube live streaming partner status yet.   P wanted a way in which we could push the stream to our server using multiple connections for fail-safe operation. Did not find any such option which would work with our Wowza server.   Other options:

1. Hire from utream.tv

By paying $500, we can get 4000 viewer hours, which will be enough for 22/23 Nov.

2. Hire from justin.tv

$400 for 3000 viewer hours.

3. Hire from livestream.com

$350 for 3000 viewer hours.

4. We can hire one more server from Voxel,

$180, and get 4000 GB of traffic. We will still be limited to around 1000 simulaneous viewers with this option.

5. We can hire from dacast.com,

$170 and get 1000 GB traffic, or maybe even $100 for 500 GB traffic, with unlimited simultaneous viewers.

This seems a good option, since 22/23 Nov traffic is expected be < 1000 GB for video. Also, no hassles of setting up.

6. We can hire from Amazon Web Services,

with bandwidth charged at $0.12 per GB = $120 for 1000 GB. But we have to do some setup ourselves, and if traffic is high, set up additional instances etc. Difficult, in my opinion, since we will all be busy at that time.

For decision-making, our past statistics at

would be useful. Especially the Feb (Shivaratri) & April (Samadhi day) stats.

Later, P added BitGravity which belongs to Tata as another option if we get good pricing, and also the unlimited new plan from livestream, for use all year round.

Monday, October 08, 2012

Korg nanokontrol problem - USB cable issue

The Korg NanoKontrol midi controller used for live recordings did not work at all despite many attempts at disconnecting and re-connecting. Had to use the mouse and trackpad. Some tips:

  • Hovering over a track and using the scrollwheel of the mouse will move the corresponding fader. Rotating the wheel slowly makes small changes, rotating the wheel fast makes large changes.
  • Clicking on a point on a fader causes the fader position to move to that point.
  • Multi-touch on the trackpad - two-finger slide is similar to rotating scrollwheel.

Tried out another USB cable - thankfully that made it work.

Wednesday, October 03, 2012

exporting video as a frame sequence

KMPlayer has an option. But did not seem to be working.
says that the latest version seems to do it.

says ffmpeg can do it.
the -y option means overwrite without asking.

But simplest is Virtualdub,
showed the way using File -> Export -> Image Sequence.

In Virtualdubmod, the menu item is File -> Save image sequence

For exporting the video as an image sequence for tgawarper, I need not bother about aspect ratio - tgawarper will warp it anyway in the correct manner if the frame contains a fisheye view with no black edges.