Saturday, December 20, 2008
Ghosting Ubuntu to a different Hard Drive
When we originally set up Godzilla, the dual Xeon Evo 6000 it had plenty of disk space, a 73 gig boot drive and an 18 gig drive for storing junk. However, over the year it has had vmware installed to do virtual machine, transmission for getting torrents and a raft of video conversion tools. The plus is the machine is very useful, the downside is that it is filling up. A temporary solution was to plug in an old external USB 80 gig drive. But now that the term is over we need a longer term solution.
The first goal of the project is to get more disk space without re-installing the OS. With a simple machine consisting of a single IDE drive this can be easily accomplished by cloning or 'ghosting' the smaller drive to the larger. We have used Norton Ghost to do this successfully for many years. Put in the new larger drive on the 2nd IDE controller, boot to a ghost floppy and start the clone. Remove the first drive and put the new drive on the primary controller and boot away.
However, the situation gets more complicated if you use multiple drive types such as IDE, SCSI and SATA. Windows has rules about the order in which drive letters are assigned- it is possible to clone a SCSI to an IDE or vice-versa but a system with multiple scsi and ide drives is more difficult. Linux has a similar problem - a simple clone from ide to ide can be done but what if your needs are more complex?
In our case the system has 2 SCSI drives and 1 external IDE mounted in a USB case. We want to clone to scsi boot disk to a old 320 gig IDE disk and maybe later clone that to a 1 terabyte SATA disk.
The first step is to find out exactly what the disk are labelled. We open a terminal window get the following:
gnickers@godzilla:~$ sudo fdisk -l
[sudo] password for gnickers:
Disk /dev/sda: 18.2 GB, 18209792000 bytes
255 heads, 63 sectors/track, 2213 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00006694
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2213 17775891 b W95 FAT32
Disk /dev/sdb: 73.4 GB, 73407868928 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00045a17
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 8555 68718006 83 Linux
/dev/sdb2 8556 8924 2963992+ 5 Extended
/dev/sdb5 8556 8924 2963961 82 Linux swap / Solaris
WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'!
The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdc: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdc1 1 9730 78150743+ ee EFI GPT
We decide to use a couple of other methods to check our results.
gnickers@godzilla:~$ sudo cfdisk -P s /dev/sda
[sudo] password for gnickers:
Partition Table for /dev/sda
First Last
# Type Sector Sector Offset Length Filesystem Type (ID) Flag
1 Primary 0 35551844 63 35551845 W95 FAT32(0B) Boot
and
gnickers@godzilla:~$ sudo tune2fs -l /dev/sda1 | grep UUID
tune2fs: Bad magic number in super-block while trying to open /dev/sda1
Couldn't find valid filesystem superblock.
Which gives an error message. I'm thinking we could simplify matters by disconnecting the external USB disk and the 18 gig internal scsi drive. We probably should reboot the system anyway as it has been up all term and probably needs to fsck the filesystem anyway.
Reboot - nothing. It does not come up to sdb1. Check connections and ensure adaptec scsi controller is set to boot the hd with id = 1. Reboot. no joy. So let's put the 18gig scsi back in and reboot again. The GRUB boot loader appears but lists Error 21 which means it cannot find the disk. We go into the scsi bios and see the 18gig is ID = 0 but the 73 gig has disappeared. A loose power connector. Fix and restart. no boot. So i undo the only other changes and set the scsi bios to boot to id0 which is the 18 gig and it works.
We need to take a closer look at this.
Sunday, November 16, 2008
Portable Xampp
Last year we decided to stop using IT services and teach programming by having students run LAMP from a usb stick using server2go. It was successful enough (despite some new technology problems) that we want use the same approach again. With larger and faster usb drives like the excellent Corsair Flash Voyager GT series this is now a useful option.
We had downloaded and installed the XAMPP stack on our linux laptop and were quite impressed by the excellent job done by the project team. The next step was to try running it on a usb stick using the portable app
s project.The portable apps web page has an installable XAMPP control panel which we added to our stick and then:
- Double click StartPortableApps.exe
- Click the portable apps icon on the taskbar
- Scroll down and click on Xampp control panel
- Place tickmarks in the Apache and mySQL services
- Click the start button for each service to start them
- Goto http://127.0.0.1/ Which laods the xampp/index.php (be sure to allow 127.0.0.1)
- The status menu item will let you know what is running.
The problem was that i had been running wampserver off the desktop the usb was plugged into. Although i had shutdown wampserver the apache webserver was still running which prevented xampp from operating correctly.
The solution was to go to control panel, administration, services and to change the wampapache service properties to manual and to shut down the service.
I then re-ran the xampp control panel from the portable apps menu and when we clicked on the status menu item we see mysql is running correctly on port 3306 and apache is running on port 80.
We try out the demo apps and they all work. The next task is to port some of my examples from the server to the usb stick. This involves:
- exporting the mysql database into a backup .sql file
- creating the users on the mysql usb database
- restoring the database from the backup.sql file
- copying the .php .css .htm and .jpg files from the application's folder to the usb stick
Sunday, November 9, 2008
Virtualbox Win95
I wanted to play an old game - Axis and Allies but it does not run on XP and the company has never released an updated version or even fixed the bugs. Hasbro has a habit of buying up the IP rights to classic board games and then releasing terrible computer games based on them (while preventing anyone else from releasing a good game!)
Anyway i decided as a test to install win95 on vb to see how it goes. The vb version is the closed one version 2.0.4
- Click New
- Give it a Name of Win95
- Select Windows 95 from the OS Type pulldown menu
- Allocate 128 mb of ram memory
- Click New in the Boot Hard Disk dialog box
- Choose Fixed Sized Image
- Make it 1 gig in size
- Click Finish
Note to self: The removal of the previous virtual box left the xp virtual machine as xp.vi in /home/gnickers/.VirtualBox/VDI - test and see if we can use this later!)
Click Start
Delect CD/DVD-ROM device abd Host Drive
Click Finish
We get 'no bootable medium found . System halted'
Insert the win95 install cd
We select Reset and press F12 and select CD-ROM
The error: 'Fatal: could not read from boot medium. System halted'
We shutdown the vm and restart with no change.
We try clicking on setup.exe from the cdrom0 window which runs the install program, but it says you cannot 'run setup from within windows NT'. This looks like it is running the install program - perhaps using Wine!
I seem to recall having the same problems last time i tried virtualbox - while setting up and installing vmware was more difficult, creating virtual machines seemed easier and more obvious using vmware than virtualbox.
Let's try to recover the old xp vm
- Select New
- Select Windows xp as the os type and call it xp
- Assign 512mb of ram
- Select the old xp.vdi as the boot hard disk
- Click Finish
- Click Start
Turns out the image does not work - xp starts to run but generates a bunch of errors. Expected really so we deleted the xp vm. Best check the xp.vdi to make sure the 10gig file gets deleted too!
Ok - now i remember the problem - the boot order is set to floppy drive (remember those?) and then to cd/dvd and the last time we did this we had the same problem.
- Click Settings, General
- Select the Advanced tab
- Untick the Floppy box (since we have no floppy drive...)
- We also do cd/dvd-rom and place a tick in Mount CD-DVD drive and also Audio, enable audio and set the audio to use the ALSA audio driver.
One annoyance is that an error message about 'usb services' comes up. We had the same problem with virtualbox 1.5.0 ose and the fix rather technical.
BTW - we notice that snapshots are stored in /home/gnickers.VirtualBox/Machines/Win95/snapshots for this vm.
Ok we put in the win95 cd and start up the vm. No joy. A complete waste of time so far. Probably because i forgot that windows 95 is so ancient it requires booting from a floppy before you can run the install. I wonder if i can install it by booting up a freedos vm and then running setup.exe. Maybe later.
Let's see if the XP install that worked before will still work again.
Installing XP on VirtualBox
First - Follow the instructions on enabling USB support BEFORE starting virtualbox
- Click New
- Set the memory (we have 4 gig so we gave xp 512k)
- Click New to create a virtual hard disk (10 gig is fine for a test install)
- Click Settings (If you get an error message about USB see below)
- Adjust the video memory size (16 or 32mb)
- Click the Advanced Tab and untick the floppy in Boot Order
- Click CD/DVD-Rom and select the mount cd/dvd radio button
- Select Audio and tick Enable Audio and select the ALSA Audio Driver
- Click USB and place a tick in the enable USB controller
- Start the xp vm
- Put in the xp cd
- We see the message - press a key to boot from the CD
- We press a key and the xp installer runs
Virtualbox USB Fix
Select Applications, Accessories, terminal and enter:
sudo gedit /etc/init.d/mountdevsubfs.sh
Go to the lines as shown below:
#
# Magic to make /proc/bus/usb work
#
#mkdir -p /dev/bus/usb/.usbfs
#domount usbfs «» /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
#ln -s .usbfs/devices /dev/bus/usb/devices
#mount --rbind /dev/bus/usb /proc/bus/usb
Uncomment the last 4 lines by deleting the # marks to make it look like below:
#
# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs «» /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb
Select File, Quit
Now type this in terminal:
gksudo gedit /etc/udev/rules.d/40-permissions.rules
We then commented out the following system line by placing a # mark before it and added a # comment line saying when and why we made the change. We then copied the following line and edited out the # mark and did the following. Change:
SUBSYSTEM==»usb_device», MODE=»0664»
to
SUBSYSTEM==»usb_device», MODE=»0666»
We then did File, Save and exited the text editor.And then rebooted the system
Now we Rerun virtualbox and when we click on SETTINGS there is no error message about USB.
Running VirtualBox
We were running virtualbox from the command line after the install by type VirtualBox which was a real annoyance. We wondered why the install did not add an entry to the system tools menu. As it turns out we were wrong - it DOES add a Sun xVM VirtualBox entry but NOT until you reboot!
Vritualbox on Ubuntu - update
We went to run XP under virtualbox and found it was broken. Since we've been using ubuntu on the laptop we installed xp for those times we needed it, which has turned out to be not very much - so far we have not found anything we did on windows that we can't do on ubuntu. Since the summer there have been numerouse updates to the os but we have not run xp...
Anyway when starting up the xp virtual machine we got an error.
"virtualbox kernetl driver not installed.' The vboxdrv kernel module was either not loaded or /dev/vboxdrv was not created for some reason. Please install the virtualbox-ose-modules package for your kernet and execute /etc/init.d/vboxdrv start as root."
So off to the package manager we go to do a search for virtualbox. And we see that in fact we had installed the virtual-box-ose-module so maybe one of the updates broke this. Time to test out starting the vboxdrv module.
Off to Applications, Accessories, Terminal. Since starting the vboxdrv requires root priviledges we will use the sudo command.
barugon:~$ sudo /etc/init.d/vboxdrv start
Which gives us an error message about 'module vboxdrv not found'. Since modprobe (module probe) will not load a module unless it is installed first it looks like vboxdrv is not installed anymore. Should be re-install?
From the virtualbox help, about screen we see that we are using verison 1.5.0 and maybe the vbpxdrv module does not match my current linux kernel. Do we upgrade to 1.6.0 - but will upgrading destroy existing virtual machines? One would think not!
We go to the virtualbox downloads and see that it is at version 2.0.4 so we click to download the i386 version for Ubuntu 7.10 which automatically opens in the gDebi package manager. However, we get an error message: 'conflicts with teh installed package virtualbox-ose'.
Looks like we cannot do this directly. There is a note on the virtualbox web site that ubuntu users need to install the dkms package to ensure that the virtualbox host kernel module (vboxdrv) is properly updated if the linux kernel version changes during upgrades.
It seems likely this is what happened to us. Would have been useful it when installing virtualbox on ubunutu the package saw dkms as a 'dependency' and installed it. Will it work retroactively or do we have to remove the current version of virtualbox and reinstall the xp vm?
Back to the package manager to search for dkms which turns out to be the dynamic kernel module support framework and it was not installed. So we install it.
Now we retry the virtualbox-2.0 package but it gives the same error message. Oh well, let's deleted the existing vm's and remove the existing virtualbox installation and install the version 2 and then show how to install xp in class next week as a demo of a virtual machine installation.
We run virtualbox , select the xp vm and click Delete. We then run the package manager, search for virtualbox and mark the packages for removal.
Back to the virtualbox 2.0 download (just click the downloaded file in the firefox downloads window) and we click Install Package. It notes that "users of virtualbox must be members of the virtualbox group and host network interfaces will be assigned to that group."
A couple of Forwar clicks and the program installs itself.
Now we have to do the administrative tasks. Linux uses a different security model than windows (XP and lower) where everything basically has to have administrative rights. In Linux you can
We go to:
- System, administration, users and groups.
- Click on Manage Groups
- Select vboxusers
- Click properties
- Ensure the current user has a tick mark
- Click OK
One annoying thing it that the install did not add virtualbox to the applications, system menu. This is a long-standing annoyance with many linux installs - they seem to assume you know exactly where it installed...why? There are lots of places programs can install themselves to. Why i don't like the windows installer's habit of strewing icons across your desktop, the better installs ASK if you want an icon added to the menu and/or the desktop. Many linux installs do even do that. Why force people to have to hunt around the system trying to find out where the damn program is located so you can run it?
So how do you run it?
1. Run terminal (Applications, Accessories, Terminal)
2. VirtualBox
Note the capitalization of VirtualBox, you must type it exactly, else it the program will not be found. Linux is case-sensitive (unlike Windows) so that VirtualBox and virtualbox are different programs.
Once the program runs you have to agree to the EULA and register.
Next Step
Create a menu icon for VirtualBox so we don't have to run it from the terminal. But lunch first!
Appendix
Seeing how the version in the ubuntu repository is rather old, because there are two versions of Virtualbox, the open source one (ose) that gets included in distributions, and the more up to date closed version, which does not - so how do you keep up to date with virtualbox updates etc?
You have to add it to your list of repository sources.
Goto: http://www.virtualbox.org/wiki/Linux_Downloads
The easiest way seems to be to copy the following text from the web site and to open a terminal and paste it in:
wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -To get some pre-built virtual machines for virtualbox goto:
http://virtualbox.wordpress.com/images/
Friday, October 17, 2008
Internet Radio 3
We brought the labtop to the computer lab to test it out. First we had to register the mac address of the laptop in the DNS. We plugged into the free Z port near the instructor workstation and booted up. We then ran cmd and at the > prompt typed ipconfig /all to determine our IP address which was 129.100.35.254 today.
All the MP3 files are in a file called CONTENT in the Winamp directory although they could be anywhere.
We ran Winamp and clicked the ADD button and added that folder into a playlist. We can now arrange the content into the desired order - mixing longer speeches or music with short adverts or sound effects or canned carts like 'You're listenting to Bill and Marty on KBBL'. This allows the producer or DJ to design their own show. We saved this to a playlist file called playlist.M3U and started the show playing.
Next we ran the win32 version of icecast. (maybe we should do this first before playing the list!) which started streaming the audio.
We then fired up one of the lab machines and tested out the web interface by going to http://129.100.35.254:8000 and the web screen is displayed with the menu options of Administration | Server Status | Version. We clicked on the Administration menu option and verified it requires a username and password (which we had set up in the icecast.xml file) to log in.
We start the stream playing and the status menu shows up we are listening to
Next we fired up another lab workstation and ran Internet Explorer and went to http://129.100.35.254:8000 but got cannot display the web page and in Firefox we got a network timeout.
The problem is likely that our server is only accepting 1 connection? We changed some of the defaults in icecast.xml so we need to look at that, make some changes and try again.
Also we had logged in as ourselves on two workstations although that should not really make a difference.
Time for some lunch...and maybe we should look at the documentation...where we see:
"A mountpoint is a resource on the icecast server that represents a single broadcast stream. Mountpoints are named similar to files (/mystream.ogg, /mymp3stream). When listeners connect to icecast2, they must specify the mountpoint in the request (i.e. http://192.168.1.10:8000/mystream.ogg)"
I think we used a mountpoint the first time we did this so we try http://129.100.35.254:8000/stream.mp3 and it loads the Quicktime player. The spinner is going and going..
We go to the admin interface and log in and looks like we need to spend some more time in the config and documentation.
More tomorrow...
Monday, October 13, 2008
Internet Radio Station Part II
The problem for our students will be they can't do anything in the computer labs as the machines only run Windows. I got the IT staff to install VirtualBox hoping that each student could create a VM but the IT dept won't let them do this - they can only define a VM to boot a livecd with. So how to do broadcasting when you can't set up anything?
The answer of course is open source to the rescue - having access to the source code means you can innovate and come up with solutions to problems. Can't install? - then run the application you want from a USB stick. They are now large enough and fast enough to be useful for this purpose. And while booting Linux from a USB would be the best solution - the lab locks down the BIOS so this is not possible. They should really provide a lab of diskless machines that boot from USB.
Apps that don't need installing are called portable applications and while it is possible to write windows apps that do this (remember the old .com executables?), it is not common because most window apps need to be in the registry and use windows system DLLs. However, many open source apps can be modified to run under windows without being installed. A list can be found at:
http://portableapps.com/support and there is also a large list linked from the wikipedia article.
The download site offers a choice of just the platform or the platform and applications. You can get a full suite of software that will run on a 512k stick.
Download PortableApps.com Suite and Platform
Get all the apps you need at once or add only the apps you want. Pick the download that's right for you: | Platform Only | Suite Light | Suite Standard |
|---|---|---|---|
| Download Size | 1MB download | 35MB download | 113MB download |
| Free Space Needed | 1.2MB installed | 100MB installed | 350MB installed |
| Recommended Device | All devices | 256MB+ devices | 512MB+ devices |
| Supported Language | Multilingual | English | English |
| PortableApps.com Platform | |||
| X | X | X | |
| X | X | X | |
| X | X | X | |
| Bundled Apps | |||
| X | X | ||
| X | X | ||
| X | X | ||
| X | X | ||
| X | X | ||
| X | X | ||
| X | X | ||
| X | X | ||
| X | X | ||
| X | X | ||
- Writer (word processor) - Calc (spreadsheet) - Impress (presentations) - Base (database utility) - Draw (drawing) | X | ||
| X | |||
We decide to take only the platform as we want to add our own applications, the VLC media player and the Audacity sound editor in particular. VLC can stream audio so we want to see if it can work over a USB stick as a pirate Internet radio station.
Step 1 - Plug in a USB stick.
Step 2 - Download and save the portable apps platform software to your USB stick
Step 3 - Run the portableappscomplatformsetup_1.1.exe installer from your USB stick
Step 4 - Type in the drive letter of your USB stick and click OK
Step 5 - When the install is finished double-click the StartPortableApps.exe file
The menu appears. It can also be minimized to the taskbar. Right now the menu is empty as we just downloaded the platform. Now we need to get some portable apps so off to http://portableapps.com/apps/ we go.
We select Audacity which the site says "Audacity Portable is the popular Audacity audio editor packaged as a portable app, so you can take your audio files along with everything you need to edit and record on the go". We also grab coolplayer, a light audio player that does streaming and the popular and excellent VLC media player.
We first installed Audacity by running the installer and it selected its install folder on the USB drive. We then added MP3 support by copying lame_enc.dll from the winamp folder we had already installed it in to the AudacityPortable\App\LAME directory.
Finally we installed the VLC media player to the USB stick.
The next step was to add the newly installed applications to the portable apps menu. At this point we find out we should have installed from within the portable apps menu and it would have automatically added the apps to the menu. No problem - we quit the p-apps platform and run it again and the new programs are on the menu.
Now to set up VLC as a streaming audio server. First we copy over some content as we want to run both content and server off the USB stick as a test. We then run VLC and set the downloading of album art to manual and turn off the update checking.
Now that the program is running we select Media, File Open and choose a bunch of files. The first file starts playing so we stop it.
We select Audio, Audio Device, Mono from the menu
We select Playlist, Show Playlist from the menu to display our selections
We highlight the selections and right-click and select Stream from the menu
This brings up the Stream Output dialog box. Check the box next to Play Locally under Outputs. When streaming to another system we would not play the file on the server, but this option is useful for testing that our audio plays ok.
We have a number of options under outputs. We can use check the HTTP box and add the IP address of the machine VLC is running on. This should give us access using a web browser - of course the web browser needs to have the proper extensions or plug-ins to play audio files. Since we are using Firefox on Ubuntu the firefox mplayer extension does the job, however users of IE may be out of luck. There is also an icecast option - actually this would be good!
The other option is to click the RTP box which ungreys the UDP box. Either one should work and stream the audio so it could be picked up by another VLC client running on a second comptuer.
Let's try the HTTP option first. We add 191.168.1.108 as the address and the service is running on port 8000.
We also turn on VLC's web interface by selecting Tools, Add Interface, Web Interface from the menu. This seems to do nothing and we cannot connect to port 8080.
Under the Profile section we click the Audio Codec tab and select MPEG audio as the codec with a bitrate of 96bps and 1 channel.
We click Stream to start the audio server playing. Now off to the second computer and run firefox and goto http://192.168.1.108:8000 and all we get is a spinning loading. We can hear the file playing locally. So we return to the Stream Output dialog box and change the setting to RTP with the same address and fire up VLC on the second computer.
Select File, Open Network Stream. UDP is selected so we click OK and VLC should start playing, but it does not. We change to udp/multicast and enter in the ip address of 192.168.1.108 but this returns an 'unable to open' error message. It looks like our laptop is not streaming at all.
Perhaps download a portable version of icecast? WE do but it is in .rar format so we also download the excellent 7-zip portable app and add it to our keychain usb stick. Once we extract we find a portable icecast.exe file in an icecast folder. Do we run this - is it an installer or is it the executable? It does not look to be in paf format. We decide to copy the icecast folder to the portableapps directory on the USB stick as well as our working icecast.xml file.
When we run the program it asks for the location of the M3U file to stream. M3U is a winamp file that stores playlists. It is actually a text file that looks something like this:
#EXTM3U
#EXTINF:134,Have A Holly Jolly Christmas - A Holly Jolly Christmas
\xmasprogram\Burl Ives\Have A Holly Jolly Christmas\A Holly Jolly Christmas.mp3
M3U files are now used as a single entry point for streaming content over the internet.
Each location is placed on a new line. The 134 indicates the length in seconds, although a value of -1 should be used when the media file is a streaming file. Next comes the display title. The next line indicates the location of the content. The location can be either an absolute or relative path pathnames (e.g., "E:\ives\holly.mp3" or "\ives\holly.mp3") or they can be URLs. The file can also include comments, prefaced by the "#" character. For portability reason it would be best to use relative paths.
Probably the easiest thing to do would be to put all the content into a folder and then place the folder path into the M3U file so that when the media player starts it plays all the content which then gets streamed. Here is an example from Wikipedia:
#EXTM3USo first step is to move all the content on the flash drive to a folder and edit the M3U file. So we created a content folder on the flash drive. Instead of hand-coding the M3U file we ran winamp and right-clicked and choose Playlist Editor from the menu, removed the existing entries in the playlist and pointed winamp to the content folder on the USB drive. We then re-arranged the content in the desired sequence and clicked the List Opts button and saved the list to the USB stick as playlist.m3u.
#EXTINF:123,Sample title
Sample.mp3
#EXTINF:321,Example title
Greatest Hits\Example.ogg
Ok now we are almost ready to try again. We did notice during the last attempt that the IP address of the portable icecast was incorrect. This could be due to the configuration so we check the icecast folder on the USB stick. We had copied our working icecast.xml file to the stick but let's take a look:
ezstream_mp3.xml is a configuration file - uses localhost:8000 and it looks for a m3u filename but it is currently set to look in c:\program files\winamp\winamp.m3u
This could be a problem as what if the computer you are running the pirate internet radio station on does not have winamp but something useless like windows media player? There was no portable winamp listed on the portableapps site but since winamp doesn't really hook into windows it should be portable. Let's search. Ok there is a :
Portable Winamp 5.35:
So we switch to the windows laptop and download. We start up the portable apps environment and select Options, Install a New App. However, the winamp.exe is not in the portable applications (paf) exe format. So we have to do it by hand. We create a folder in the Portable Apps directory on the USB stick. Run the winamp install and select the folder and click install.It's writing tons of crap to the stick - all sorts of stuff we don't want. It is the FULL version - 33mb of stuff is installed. We don't need no stinkin visualizations of skins or dsp effects for streaming audio! So don't use the softpedia download. I now either have to prune it manually or uninstall and find a portable lite version. What we need to find is the portable winamp lite 5.1
No joy yet - there is on out there but either you end up at scary sites or get the redirect runaround. Too dangerous to take a windows machine. Let's try installing the non-portable lite version to the USB stick first and removing things like file associations etc.
Run the winamplite installer and choose the minimal version which takes 2.7mb of space. We deselect all associations or icons or other hooks with a custom install and then choose a destination of d:\portableapps\winamp. We select shared settings for all users but choose NOT to copy them to the c:\program files\winamp folder. No downloading of codecs and we click install. We untick the anon stats and tick the do not ask again until the next install in case it has a nag setting.
Next we examine the winamp configuration settings in install.ini and see that everything is pretty much set to =0 but we change the associate with m3u playlist files to =1 and add the line no_registry=1
Since there is no need to unininstall or to run the winamp agent we delele the uninstallwa.exe file and the winampa.exe file. We also run winamp from the USB Stick and right click and select Preferences. We untick the check for new instances and the show winamp in systray stuff and untick the show winamp in windows folders, and untick restore file associations. Not sure about disabling the 3 default plugins - we leave them alone for now.
Next we want to add winamp to the portableapps menu and test it out on a computer without winamp installed.
First we run portableapps and the winamp icon is displayed in our list. If it was not we would select Options, Refresh Apps Icons from the menu.
When we run the portableicecast and feed it our playlist.M3U file we get the message:
"your stream is on: http://172.33.16.23:8000/stream.m3u" which should not be as the ip address of the machine is 192.168.1.110. Could it be the person who created this version hard-coded the server ip? There are no notes with the file.
Ok for now looks like we will have to come back later to the idea of running a portable pirate radio station from USB and work on running it from the laptop.
Internet Radio Station
Today we want to take a first look at Internet broadcasting, but not necessarily the creation of podcasts, which when you strip away the jargon are just recorded audio files - usually just some talking head. Good for listening to lectures on the bus possibly but pretty boring most of the time. What is more interesting is the concept of replacing amplitude modulation or frequency modulation transmission methods for radio with broadcasting over tcp/ip. A mac server using the included quicktime broadcaster would be a good way of proceeding but let's see if we can do this on the cheap.
Looking through the storage bins we came up with a bag full of old mac microphones - the ones that also work on PC's. So we can set up the class with mics for recording their voice-overs and carts. We also have a bunch of audio content already in MP3 format as the test files for the web class - including songs, speeches, sound effects etc. All we have to do is set up a steaming audio server and design our show.
We are going to start with Windows first and then see how it can be done on Linux. The first requirement is something to steam audio in MP3 format.
So we head off to http://www.icecast.org/ the home of the open source Icecast project. Their home page says "Icecast, the project, is a collection of programs and libraries for streaming audio over the Internet". This includes:
- icecast, a program that streams audio data to listeners
- libshout, a library for communicating with Icecast servers
- IceS, a program that sends audio data to Icecast servers
For now we download and install the Windows version which installs itself as a windows service. This means you can administer the service through the control panel, administrative tools, services applet. The default is to set the icecast service to automatic which makes sense for a server. Since this is running on my sub-notebook we change this to manual for now. If you do this you have to tick the checkbox Start Server on Application Startup in Icecast.
The program installs itself to C:\Program Files\Icecast2 Win32 which contains the configuraion file called icecast.xml which we open in the Notepad text editor. For doing a demonstration we problably want to 'lighten' the load on the mini book.
For example, i've reduced the number of clients from the default of 100 down to 10 and made some other changes. Also enabled burst mode, changed the source/relay passwords and setup the admin user password. I left the directory listings commented so that functionality is disabled for now. Port 8000 was set up for multiple connections.
After we save the file we run Icecast. Since we had set the service to manual we had to click the Start Service button which immediate brings up a windows security alert from the windows firewall. Click Unblock to allow Icecast to proceed. You can actually edit your configuration inside the program.
Once we verified the icecast server program is running ok we n0w need some broadcasting tools for the audio. The idea is to play the audio and send it to the icecast server for streaming. We don't want to a bloated program like windows media player (which we disabled anyway) because we prefer Winamp, especially the lite version on Windows with the dumb visualizations turned off.
There was a neat plug-in called oddcast. So off to http://www.oddsock.org/tools/edcast/ we go. The web site says:
"Edcast is a broadcasting application targeted to the small station owner. There are three different flavors, a Winamp plugin, a Foobar plugin, and a standalone broadcaster".
This give us some choices. Since we already have winamp lite version 5.xx we can try the old oddcast plugin and see how it goes - and if that is no good then try the standalone edcast program. So we install oddcast version 3.xx and choose the default install. Note that this comes with an option for the Lame mp3 encoder but that it cannot be included for legal reasons.
We right click on winamp and select Options, Preferences from the menu. In the plug-in section we select DSP/effect and choose Oddcast. The configuration dialog box for the plug-in appears.
The problem here is that only the ogg vorbis encoder appears so that all audio will be streamed in that format. Since all our content is in MP3 format that is no good. Looks like we have to install the lame MP3 encoder.
So we need to reinstall oddcast. First we search the web and download out_lame162 which is a lame encoder plug-in for winamp and install. The installer works but returns a warning:
Quality value setting is broken in 3.96.1. Use presets to set quality of use 3.97.4
Let's see if we can use presets to get an acceptably low bitrate for streaming. If not we have to get the newer version. However, it doesn't even turnup as a plugin in winamp s o we go back to the oddcast and select lamp this time. We download the lam_enc.dll and copy it to the winamp program directory.

Now we run winamp again and right click and select Options, Preferences from the menu
Then we click on the oddcast dsp.
You have to move to (none) and then back to Oddcast to bring up the configuration box
Clicking the Configure active plug-in button did nothing
Select the encoder setting and right click. Select Configure from the menu
We select the existing encoder entry (ogg vorbis) and right click to bring up the properties. For encoder type we select MP3 instead of ogg or flac. As warned the quality box is greyed out so we manually select a bitrate of 96 with a mono channel with a sampling rate of 22050 about half of the normal rate.
| 5512 | Capable of telephone quality audio |
| 11025 | Capable of radio quality audio |
| 22050 | Reasonable fidelity |
| 44100 | CD quality |
The idea was to get it working first and then see about optimizing the sound. The oddcast panel also has a live recording feature so you can broadcast voiceovers or commericals or 'radio personality' chit-chat. We hooked up a gooseneck clarad mic to the mic input jack on the laptop.
Once confusing item is the mount point of /stream.ogg - it is not clear what this refers to. I changed it to /stream.mp3 and clicked ok.
Ooops- better figure out the IP address of the laptop. Drop to DOS and type ipconfig and see it is running on 192.168.1.110 on the wireless and 192.168.1.108 on the wired. Will we be broadcasting on both? Stay tuned...Best load up some content - we goto winamp and load the classic 'green eggs and ham'.
We now click the Connect button and goto the linux box and type:
http://192.168.1.108:8000/stream.mp3
Success!
We can hear the bedtime story. It buffers the audio and actually sounds quite good. Will have to test with some music later - load up the laptop with tunes. We also want to test the connection with a number of different machines listening to see the load on a light laptop.
Interesting to see how the streaming works. I stopped playing the file on the laptop and it was eerie to still hear it playing on the desktop next to it. I then used the live recording function with the mic to create a short promo. The neat thing is the promo is not heard by the client until the green eggs and ham story was finished. Streaming means there is a steam of data being sent out. Obviously this affects how you setup your show. Do you record everything at once or combine bits into a single audio file or more likely set up a playlist in winamp or even do a random shuffle (with repeats or no repeats) of MP3 files in a directory. Takes me back to Acadia radio in college.
More later - time for some dinner
Weird thing - i decided to switch laptops to use the full-size machine. Icecast installed but winamp crashed on install a couple of times. I only got it to install by delselecting all the options. I then installed and configured oddcast and setup a playlist. Everything looks ok but the web browser could not find the mount point file of /stream.mp3 that i had specified in oddcast.
Checking the oddcast configuration in winamp i noticed it was constantly disconnecting and reconnecting. If winamp was stopped it connected but when the playlist was playing it kept timing out and trying to reconnect. Nothing seemed to solve the problem - i checked the config settings for everything against the working version. Then i copied the plugin directory from the working mininote and ran winamp again. An error message of libsnd.dll not found was displayed but the program ran and oddcast connected and the mp3 stream was ok. The web browser now connected and found the mount point. There was funny business with quicktime, the app associsted with the stream on the client - it would only play a few seconds and i could not get two clients to connect.
