Saturday, September 10, 2011

working around a broken iphone

Got a used iphone for Rs. 4k - reason it was going cheap was that part of the touch-screen was not responsive. This happened to be the part just above the lowest line. So, the Call soft-button in the phone keypad does not work! And so on.

Trying to get ebooks into it. SSH not working - probably not installed, though Cydia is present. Trying to install SSH gave an error message in Cydia about being unable to download files - probably an old repository. But cannot click on the OK button for the message. That was in the bad portion, and landscape mode is not available for that screen.

Tried to use the Kindle app - it needs registration, and in portrait mode, which does not work with the keypad. I did not try copy-pasting the username and pw - that might have worked. But anyway, went on to try iBooks. Unfortunately iBooks needs iOS 3.2 and higher, and this is a 1st gen iPhone with iOS 3.1.3. Then tried Stanza, that one works.

Transferring files to Stanza - all the methods seem to need Stanza to pop up a confirmation dialog asking if I want to download - and the Download confirmation button comes up in the non-working part of the screen! Finally got books to transfer using iPhone Explorer.

Tuesday, September 06, 2011

DD-WRT and Dlink DIR615 revE4

As mentioned in an earlier post, tried out DD-WRT on the Dlink DIR615. What we got was hardware version E4.

Quite simple procedure as given at the dd-wrt wiki. Ours was E4 and not E3. Read somewhere on the forums that changing the last number from 0 to 1 in the E3 firmware with a hex editor makes it work with E4. Tried that, it works. Did the Hex editing of the firmware using Free Hex editor Neo on Windows.  The firmware labelled as E4 in the dd-wrt site has 5 as the last digit - that apparently makes it not compatible with our E4 version.

But plugging it in our network, it didn't work. At first I thought it might be a MAC address caching issue, and tried cloning the old router's MAC address. That also did not work. Then did some tests and found that it was just not routing - logging into the router, ping works in both directions LAN and WAN. But the LAN can't ping the WAN and vice-versa.

Tried posting on the dd-wrt forums, here and here, but finally did not get any solution. Assuming that some hardware limitation prevents it from working as a router without NAT. And the google answers page recommended routers seem to be scarce. The Linksys WRT54G is superseded by the WRT54GH which doesn't support routing mode, for example.

Sunday, August 28, 2011

access to audio files from macs at Studio

With MacOSX, the audio directory windows share was not accessible. Reason seems to be the large number of files - seems to get stuck. Workaround - connecting with sftp using Filezilla.


In order to connect, have to import a key as given at this page from FileZilla -> Preferences -> Connection -> SFTP

In order to navigate hidden folders like .ssh in File -> Open dialog box, as given  here
press Shift + Command + Period

Saturday, August 27, 2011

burning cds on the mac

Copied some CDs on the Mac using the procedure at

Create an image using Disc Utility, (make a read-only image to make it faster) then burn the image. This method does not work for audio CDs and protected DVDs.

Friday, August 26, 2011

router failure and fail-over

Last night, power failure and UPS draining caused the servers and routers to go down. The Dlink DFL-210 router did not come back up after power returned. This morning, replaced it with a Linksys WRT54GS - cost around Rs. 3,500

The router which failed yesterday - DLINK DFL-210 - cost around Rs. 22,000

Both these models are no longer available. DFL-260 is a possible replacement, PB checking Indian market cost found it to be around Rs. 50,000.

According to posts on this page, newer routers don't have the built-in static routing which we need, dd-wrt is a possibility.

So, we're planning to try out Dlink DIR-615 and are going to try and load dd-wrt on it.

Wednesday, August 24, 2011

live video streaming test

Running Adobe Flash media encoder and C++ RTMP server locally for running tests.


First downloaded Wowza server with a free developer license and tested after installing it with the documentation given at wowza forums.

Then tested by copying the same html file mentioned above to another system.

Then tried stopping Wowza and starting the C++ RTMP server. It asked for a username and pw for the encoder to connect, found that it was located in users.lua
Entered suitable values and the encoder connected without problems. Next, tried on the other system with the same test file supplied with Wowza, and it worked.

Next step was an flv player embedded in the website.

Downloaded JWPlayer's latest version, first tried the quick-start method given in the downloaded pdf. That did not work. Reason was wrong path. Even giving full path did not work, since our server was configured not to serve .mp4 - it gave access denied. Anyway, the player was coming up embedded on the page.

Next, followed the docs at
http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12535/video-delivery-rtmp-streaming

With streamer address given as a private ip address 192.168.2.2, it did not work. Configured the router to use a virtual server at the Macbook, port 1935 for rtmp, and it worked with the public ip - used the domain name, actually.

Later, tried out the private ip address also - that also worked. The player on the remote server does not need to contact the streamer directly. Only the client needs to contact the streamer. The first time the private ip address did not work was because of other issues with embedding the player - the player itself was not appearing.

Monday, August 22, 2011

automatic email scripts

Removed the radiosai gmail id from the following scripts which were sending automatic emails:

On saiwaves :
playlist_import.sh
lame*sh


On colinux :
test_playlist_sgh_africa.sh
test_playlist_sgh_america.sh
test_playlist_sgh_asia.sh
test_playlist_sgh_discourse.sh
test_playlist_sgh_bhajan.sh

Thursday, August 18, 2011

problem with ftp upload using php ftp_connect

The php script to upload csv files automatically had not worked for a while. Checking it out:

This page says that with some firewalls you should connect to the firewall and then connect to the host etc. Tried that, doesn't work.

I suspect that the problem is with the way in which php handles ftp commands. When a put command is sent on our system, cyberoam responds saying delayed due to scanning, and then uploads.

STOR /httpdocs/program/csv/AmeriStream20110818.csv
150-Scanning file for viruses
150-There'll be a delay while we scan for viruses
150 Data connection already open; Transfer starting.
221-Scanning for virus
221 Transfer complete.

I think php's ftp library does not handle the ftp 150 commands, hence it fails.

I have currently commented out the ftp upload part in the mkcsv php script.

ERROR: duplicate key value

PB being out of action, making playlists and doing Telugu database work etc. So, while importing Telugu files, came across
ERROR: duplicate key value violates unique constraint "download_filename_file_id_ukey"

This causes some files not to be entered into database, so when importing playlist, it complains that some fids are NULL

Solution was to import files one by one till the offending file was found - a file which had the same name as an existing file, but with space in the filename replaced with underscore. Removed the old entry from database - rather, changed space to underscore for its filename.

Wednesday, August 17, 2011

setting up vnc

While setting up vnc for doing the Telugu files on the telugubc server, found that it was installed but not running. Using the same script as on saiwaves did the trick, only thing was that it needed vncpasswd to be run before running the script to start vnc, so that we set the password to something we know. And editing .vnc/xstartup is required if you want kde - I changed the default twm window manager to kde. Last line becomes startkde & instead of twm &

Tuesday, August 16, 2011

procedure for telugu broadcasts

1. Go to ~/new_telugu and copy mp3 files from relevant folder to ~/ftpsent

2. Copy relevant m3u file to ~/playlist directory.

3. cd to playlist directory and run the sed script modifying the commmandline to relevant date, which converts the extended m3u to simple m3u and appends the audio directory path.

4. run ~/scr*/lame_encoder2422.sh

5. Open playlist from step 2 in kwrite and change / to \, save as m3u

6. Open the m3u playlist in Winamp after lame finishes, to check that all files are present - total duration should be 24 hours and a bit, and it should not show a + symbol after the total duration.

If playlist generation is desired, additional steps:

7. Run scr*/main_ftp.sh which takes files from ~/ftp folder

8. upload files from ~/ftp folder to dl.radiosai.org

9. Run scr*/playlist_import.sh

10. Update missing descriptions from localhost/SGHDescription as with sgh database, if necessary copy-pasting from sgh database

11. Make csv and upload from localhost/mkcsv


bug in our playlist import script

Faced the same problem as given in this earlier post, with the schedule csv/email creating script complaining that SIGNATURE TUNE not found, "PROGRAM NOT FINALISED". The solution is to just search for entries in the playlist table where timestamp is 2011-08-16 06:30:00+05:30 (or whatever date). This can occur at midnight also - as PB pointed out, a bug in the script changes a timestamp of 2011-08-16 00:00:00+05:30
to 2011-08-16 06:30:00+05:30 during the import process. So, verify if the correct timestamp should be 00:00:00+05:30 and then edit the entry manually from 06:30:00+05:30 to 00:00:00+05:30 .

The point to be noted is that the problematic entry may not be adjacent to the actual 06:30 signature tune file, it could be at midnight also.

Saturday, August 06, 2011

updating MBV download filenames

The MBV files were imported into Telugu stream database without suitably modifying the download filenames. This caused quite a bit of confusion. PB contributed the following post :

Steps done for rectification:

1. In sgh database on saiwaves run the following query:

select 'UPDATE file_id SET download_filename=' || '"' ||download_filename|| '"' || ' WHERE filename="' || filename || '"' from file_id where filename ilike 'MBV%' \t \o update_mandirbhajans.sql ;

First row of the result set looks like:

UPDATE file_id SET download_filename="MBV_04_RAMA_OM_SRI_RAM.mp3" WHERE filename="MBV_04_SUJITH_RAMA_OM SRI RAM.mp3"

2. Save the result set to a file update_mandirbhajans.sql

3. Replace double quotes with single quotes in update_mandirbhajans.sql

4. In sghtelugu database on saiwaves execute the saved update_mandirbhajans.sql (through phpPgAdmin interface)

5. upload the updated csv files / run the update sql statements on the schedule database through the cpanel

Friday, August 05, 2011

stellarium night sky on our mirrordome

Trying out Stellarium's Mirrordome distortion mode. On the laptop I use, Stellarium cannot use the full screen when in dual-screen mode with different resolutions on each screen, and also refuses overlays like the toolbars on the secondary screen. So, used the Dual-screen clone mode with both displays set to 1280x800. With the default settings, the stars don't look so good on our dome, but some tweaks make the stars look better.

View Settings Window -> Sky tab -> Absolute scale = 2 makes everything bigger and hence brighter, and Relative scale = 0.2 or so makes the stars uniform in size instead of brighter stars being as big as oranges! This makes the night sky much better to look at, more like a "starball" effect.

viewing panoramas on fulldome - simple technique

To make a panorama viewable on the fulldome, tried the following method as given at this page as a shortcut instead of going through Blender or buying commercial software. At the bottom of this page, the type of fulldome image we need is shown. Basic method is simple - make the pan into a square image by resizing, then convert to polar co-ords. In Photoshop it is Filter -> Distort -> Polar Co-ordinates and in the Gimp it is Filters -> Distorts -> Polar Co-ordinates. This produces a fulldome master which I can later distort with tgawarper for display on our dome.

When I tried it with a pan of the SSSIHMS, a hi-res version of this picture, found that it looks squished on the dome - need original to be more squarish? Also, building is too far above the horizon. Need more sky and less ground. So, probably the solution would be to take a pan with the interesting parts near the bottom edge of the pic, and clone the sky to make it square instead of distorting it by simply resizing.

Friday, July 29, 2011

download users as csv in Google Apps

CV had a problem downloading list of Google Apps users as CSV - the option was grayed out in the control panel.

This post seemed to have the solution:

http://www.google.com/support/forum/p/Google+Apps/thread?tid=5a8c21e76144b065&hl=en

So, sign in, and then use the following url for the csv file:

https://www.google.com/a/cpanel/urdomain.com/DownloadUserData/UserData-urdomain.com-20110727.csv

where you must change the date 20110727 for the relevant date. We also have to remember that google servers use US time, so today is still 28 July for them and not 29 July.

Wednesday, July 27, 2011

Telugu stream playlist - Extended m3u to simple m3u

PB passed on the following info.

cat 26th_JULY.m3u | sed /^#/d | tr '\\' '\n' | tr '\r' '\n' | sed '/\(.mp3\)\|\(.MP3\)\|\(.Mp3\)/!d' | sed 's/^/\/home\/sgh\/audio\//' > 260711.playlist.telugu


sed /^#/d Remove the lines starting with #

tr '\\' '\n' The windows path backslash (\) is changed to line feed

tr '\r' '\n' The Carriage return is changed to line feed

sed '/\(.mp3\)\|\(.MP3\)\|\(.Mp3\)/!d' Remove the lines not having .mp3 or .MP3 or .Mp3

sed 's/^/\/home\/sgh\/audio\//' Add the path /home/sgh/audio at the beginning of each line.




Added
tr '\r' '\n' on 26th July 2011.
The line used to end with both \r\n which made ices fail to start the playlist.

\r - Carriage Return - 0D in Hex
\n - Line feed - 0A in Hex

Saturday, July 16, 2011

problem playing file from finder for live broadcast

There was some difficulty with using the technique I had used in April for playing an announcement file directly from Finder into the live broadcast. Going through the steps, found that the following sequence is required: First change system audio out to Jack device using Audio MIDI setup utility. Then the Jack setup file which I had created earlier can be loaded.

But in general, this is a bit risky - a better way to do announcement insertion would be to drag and drop the relevant files into the timeline on Reaper. This can be done even when Reaper is recording. The track into which the file is dropped should not be armed for recording - only then will the file play back if Reaper is recording on another track.

Friday, July 15, 2011

more ports on server

We wanted some more ports open on the server firewall, for future expansion if required. The service provider said they have opened the ports, but ShoutCast complained that it could not bind to those ports.

Did some troubleshooting by starting the server from the command line.

Found that the reason it gives for the other ports not to work is:
error opening client socket! FATAL ERROR! Some other process is using this port!

So it is not the service provider's fault.

When I test with telnet, I find (after stopping shoutcast)

telnet stream.radiosai.org 8021
Trying 66.249.27.181...
Connected to stream.radiosai.org.
Escape character is '^]'.
200 1500
GET / HTTP/1.1
fxÚ
ÍËÎË/ÏSHÎÏÍMÌKÑ5

Yesterday when I tested, ports 8023, 24 and 25 were also probably occupied by the other process. Today, those ports were open, and shoutcast could use those ports.

Using
Netstat -a -b -n -o > c:\netstatnames.txt

and searching for 8021 in that file,
found that the process is
G6FTPSERVER.EXE

So, requested that the Gene ftp be tweaked so that it uses only ports above 8100 for listening, like 8121 etc. That solved the issue.

Wednesday, July 13, 2011

procedure to change over to live broadcast

On stream.radiosai.org I have created services 8002, 8002live, 8020 and 8020live in addition to the services for the other streams. Batch files
c:\startlive.bat and c:\stoplive.bat do the work of
net stop 8002
sleep 5
net start 8002live
etc
(similarly for the 8020 stream, and similarly for stoplive)

Shortcuts on desktop for these bat files have been created. So, one minute before the live broadcast is to start, like 4.29 pm for the evening programme, just login with Remote Desktop and double-click on the respective icon.

To stop live, wait 70 seconds after the ending point - usually the Jaikar after Arati - and double-click the stoplive bat file. The BUTT has to be running during these 70 seconds too. This is because of buffering of the stream by the Shoutcast servers.

Edit: Initially we experimented with using Scheduled Tasks to automate the changeover, at least for the startlive which was a fixed time. But Scheduled Tasks don't run if the password is changed, and then we would also have issues when DST kicked in. So, decided manual change-over was better. And the next day the manual change-over came in useful when we had a long power outage at the Studio and could not change to live till 50 minutes into the morning session - recorded filler was played on air at that time.