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.