Friday, February 27, 2009

My Evening with Vista

That is not a typo, i did not have dinner with Andre or even an Andre action figure but spent the evening playing around with Microsoft Vista.

How did it start?

Well, i got Vista with my laptop as part of the infamous 'vista capable' program and hated it - slow, annoying, ugly. So I switched the dell laptop to Ubuntu and it has been happy ever since. This weekend i decided to clean out the storage room with ideas of turning it into a guest room or playroom for Liam this summer. There were two dell machines there that i thought i should probably sell at least one of them. They are:

Machine #1 - Dell Precision 470
Dual Xeon 3.2Ghz processors, 4gig ram, ATI Radeon 2400 pro 256mb pci-e

Machine #2 - Dell Precision 450
Single Xeon 3.2Ghz processor, 1 gig ram, Nvidia Quadro FX 128mb agp

I had installed ubuntu 8.10 on the 470 and it ran fine but the HP evo dual xeon box runs so well that there is no need for a faster machine. No stimulus spending required for Linux. A ran across the vista home premium cd and decided to install it for a lark. Removed the 1.5 terabyte hard drive and replaced it with a spare 320gig IDE drive. Stuck in the Vista cd and booted.

The Install

Went pretty smoothly with a couple of reboots and then Vista started. Put in the serial number and activated. The aero rendering is quite good, very similar to osx or ubuntu, in face the color scheme reminded me of Suse. so how did it do with the hardware?

ATI video card - Installed as generic vga compatible
Sound card - no driver with vista cd so not working
Network - detected and working

I tried the search for drivers function but it just spun its wheels for a while. So then i started the update manager and downloaded lots of updates. This process led to the system detecting the ATI radeon card. I also went off to the ati web site and downloaded and installed the latest driver. Then something interesting happened - vista seemed to realize the sound card was not working and added it as a 'task' to its list of things to do. It went off and scoured the net for a dell/intel integrated audio driver and installed it. This was impressive and a very good idea. Computer systems should be self-healing, to know when hardware is not working and to fix it. One of the big annoyances with XP is the countless hours searching, installing and configuring drivers manually. I'm no big fan of Microsoft because of they way they treat their customers, but this was impressive.

I then decided to upgrade the video card so pulled the ATI and put in a Nvidia 8600GT. The result was a return to the vga compatible setting and back to the net to find the nvidia vista driver and after installing it to take the machine for some speed tests.

How Fast is It?

I dragged a cpu and ram meter to the widgets or gadgets area so i could keep an eye on things while i did stuff. The ram meter rarely budged beyond 25% but the cpu meter frequently red lined around 100% when installing software or drivers or doing other stuff - which meant the machine was basically frozen - similar to doing large file copy operations on XP. This is something i had forgotten as a Linux/OSX user with all dual cpu machines - the os is always responsive, which makes the whole experience seem faster as you are never made to wait.

I wondered about this so i did the ctrl-alt-del to look at the task manager and check the performance. Lo - there were only 2 'cpus' listed when Linux showed 4. It turns out the Vista home editions are crippled - they do not support more than 1 cpu, rendering those versions unwanted in my home.

Next i tested the Windows Vista Experience Index which gave good scores except for the video card which it listed as the lowest level a 1. This is impossible, the 8600 is a fast card. The windows help suggested 'refreshing' the index which i did twice with no change. Why?

It turns out there is a 'feature' in Vista or a bug that causes this when you change the hardware, the index never gets refreshed. The solution was to goto:

%SYSTEMROOT%\Performance\WinSat\DataStore

and delete all the files in the folder and re-run the index and now we get 4.9 and 5.3 for the graphics index (with the nvidia setting set to best looking at the expense of performance). Eye-candy trumps speed! And the areo eye-candy is very, very good. Windows has finally caught up to Linux and OSX!

Switch the Drive

One thing i wanted to test is the common windows problem of switching drives or computers. The solution is usually to re-install the operating system which is a hoot to long-time mac users. Anyway, i pulled the 320 gig hard drive from the 470 and put it in the dell 450 - which is almost functionally the same machine but this one only had a single cpu.

Booted and Vista came up and detected all the hardware (as the drivers were already there) and rebooted twice. The only problem is a message that says you have 3 days to activate. We had already activated on the old machine but it seems to have forgotten. Doesn't microsoft ever think that people upgrade or switch computers regularly? Ask their fricking employees.

Anyway let's try it. We click activate and it says we have to use the automated phone system. This should be fun - should we use the dial phone in this room? Bet it won't work - doesn't microsoft know that some users have dial phones? So we grab a touchpad phone.

Well that was a 'fun' 6 minutes. Why make it so hard for a licensed customer? I'm sure those who pirate the program don't have to listen to a relentlessly perky robo-attendant just to use a product they bought.

Anyway we are now activated. I'll drag the cpu meter to the sidebar to see how vista does with only 1 gig. The ram meter is at 43% with IE loaded and the system does not feel sluggish at all.

Summary

Install - not bad. Too many reboots but fairly smooth and some impressive new features. I give it 4 out of 5.
Looks - impressive rendering, seems well integrated. 5/5
Other - no dual cpu support, poor backwards compatibility, stupid product activaction. I give it 2/5. Microsoft could learn a thing from Apple about taking care of their customers. For example:

- When i had an SE/30 mac and apple went to the powerPC architecture my programs still ran while vendors re-wrote their applications
- When i had a G3/350 running OS9 and apple introduced OSX i could still run my classic programs. In fact, many years later my dual G5 box still runs Civilization - Call to Power (which also runs on an 040 mac!). I did not have to pay for a new program when the OS changed.
- Now that apple has switched to Intel cpu's, the older powerPC applications still run while vendors re-write native programs.

The point is that Apple took care of its customers through all of those upgrades but Microsoft forgot about it's customers - why did they not provide an XP emulation layer with Vista using a VM. This would provide users time to make the switch from old and crappy XP that works with what you got and new shiny Vista that doesn't. Windows 7 is XP to Vista's ME so it will be a success but people don't forget when they have been screwed. Microsoft should have been listening to their customers instead of the record and movie companies.

Business 101 - don't get in the way of the customer!

Monday, February 23, 2009

Internet Broadcasting Phase III

Fixing the Movies for Streaming

Yesterday we copied some old quicktime movies to the osx server but they would not stream. We think the problem is that they are not ready for streaming because they are not 'hinted'.

What is hinting? It appears that streaming quicktime movies need a hint track to tell the QTSS server exactly how to package the data for the network.  So let's try and hint. Our first effort will be on the dual G5 using quicktime pro.
We just dropped the movie by mistake into the safari window. Interesting - it posts as a picture right to the blog. Way to go! Ok we open the movie in quicktime.

1. Select File, Save As from the menu
2. Choose Self-Contained Movie and click Save
3. Select File, Export from the menu
4. Select Movie to Hinted Movie from the Export: pulldown menu
5. Select Default Settings from the Use: menu and click SAVE

This creates a movie ready to stream. So let's test it out. We copy it to the server and put it into Library/QuickTimeStreaming/Movies. Back to the dual G5 and in Quicktime we select File, Open URL and enter:

rtsp://gnickers/book.mov

and it doesn't work. We get the 'live broadcast paused' error. So we re-load the original back into Quicktime.

1. Select Movie to Hinted Movie from the Export: pulldown menu
2. Click the OPTIONS button
3. Place a tick in the Optimize Hints for Server option
4. Click OK, SAVE and replace

Ok we copy it to the server and stick it in the broadcast media directory.  Open the file in quicktime again and...error 32xx - disconnected - live broadcast paused. Ok load the original back into quicktime. This time lets set it up manually.

1. Select File, Export
2. Select Movie to Quicktim Movie in the Export: pulldown
3. Select Streaming - medium in the Use: pulldown
4. Click the OPTIONS button
5. Place a tick in the Prepare for Internet Streaming box
6. Select Hinted Streaming in the settings menu
7. Click the SETTINGS button
8. Put a tick mark in the Optimize Hints for Server box
9. Click OK, OK, Save and replace

This take a bit longer to convert. Copy it to the server and...error 3285 disconnect again! Just to confirm we test out the sample_300kbit.mov and it plays fine. So what is error 3285? 



Sunday, February 22, 2009

Internet Broadcasting Phase II

Broadcasting Redux

Last term we had fiddled around with broadcasting from a USB stick using icecast and a hacked winamp but it was not entirely successful. So we decided to try a different tack. We purchased a G4 mac mini (1 gig ram/80 gig hd) and installed osx server 10.5 on it. The idea is to see how well the mac stands up as a broadcast platform. We can use our trusty dual G5 (2 gig, 1.5 terabyte) as the client that produces the content. It is hooked up to a sony miniDV via firewire and has iMovie, Garageband, Final Cut, Soundtrack etc installed. It is running 10.4 because of the need for the occasional classic environment session. Quicktime player will be used as the client and the scheduled should be available on a web page. We also want to experiment with iTunes as a client.

The basic idea is to:

- have users create either audio or video shows with their own content, or to weave together acquired content
- the shows would either be theme based or maybe even revolve around an 'on-air personality'
- the content would be edited and encoded for internet streaming and moved to a server
- the server would broadcast like a radio station or tv station

We are not so much interested in live events as in creating playlists of pre-recorded and encoded content, in much the same way as most radio and tv stations.

So let's begin the adventure.

Getting Started

Mini is up and running. So the first step is figuring out the quicktime streaming server (QTSS) and the quicktime broadcaster.

Quicktime Broadcaster is used for encoding a live source and delivering it to the server so that everyone sees the same point in the video at the same time. Actually, it does not have to be live, the same effect can be achieved by broadcasting content via playlists. This requires a faster broadband connection which is fine as the clients will be in the same building. For our development environment we will run quicktime broadcaster and quicktime pro on the dual G5.

The website should also have links to shows on the schedule and since these are basically self-contained video they can start playing as soon as the movie has the data it needs. This means the movie starts before it is fully downloaded and can be watched in a web browser. The movie is actually downloaded to the viewer's computer.  Quicktime 6 or higher recommended. This can be used for viewing at home. The web page will specify what content to send to the client.

We will run the quicktime streaming server on the mac mini and the clients will be the G5 iMac, an XP machine and a Ubuntu box.

Note: When we get to the IMC lab we will have to see if they quicktime broadcaster software on the clients, if not it can be downloaded for free from the apple web site.

Quicktime Streaming Server can operate in multicast or unicast mode. In multicast mode each client connects to the stream sort of like a FM radio tuning in a station. This is the more efficient model. Unicast requires each connection to have its own stream putting a heavy load on the network. Since the number of client connections is likely to be small, this may be ok.

Note: Find out if the network is multicast-enabled. It probably is as there is a windows media server on it.

Setup
Damn we downloaded the 10.4 documentation. Off to google to find the QTSS_and_Broadcasting_Admin_V10.5 pdf file. Goto page 25

1. Goto Applications, Server, Server Admin
2. Log in as administrator

A warning message appears:

The server gnickers is a standard configuration of Mac OS X Server, which is best administered using Server Preferences. You can use Server Admin to customize or add services, but your changes could have unintended effects. Before making changes, carefully note current settings in case you need to revert to them.
Alternatively, you can convert this server to an advanced configuration.

3. We select Convert to Advanced and a wizard appears noting that if you do this you will not be able to use server preferences to administer the server anymore but have to use Server Admin and Workgroup Manager. These were the tools in 10.3 and 10.4, is apple doing away with them in favor of a simplified preferences? Now it comes back to me - when i installed it asks what is the role of the server and i choose standard. This allows you to do some stuff and uses the server preferences as its control panel. However, the standard and workgroup roles do NOT allow you to run podcast producer or quicktime broadcasting which is why we are here! 
4. We select Convert and away it goes we are now in the Server Admin control panel
It is obvious the documentation is out of  date, neither the printed 10.4 or greater nor the 10.5 version we just downloaded has text that matches the screens. Ok - let's figure it out.
1. From the menu select Server, Add Service to display the list of services. We decide to turn off some things that are running like mail, ichat, ical, open directory, vpn and turn on Podcast Producer and QuickTime Streaming. We will leave mySQL off for now but later we may need it if we take a look at the open source Jinzora streaming software.
2. Click SAVE
3. Select the QuickTime Streaming service and click the General tab to edit the default

Max connections: change from 1000 to 50
Maximum throughput: change from 100 mbit/s to 50 (will see how it goes)
Media Directory: the default is /Library/QuickTimeStreaming/Movies

We will leave the default directory alone for now but wonder if it is shared so that clients can save directly to it. If not, which seems likely, we will change it later to a public folder that users place content in as part of their production workflow. The manual notes Make sure the owner of the new directory is the system user “qtss”. The owner can be changed from Workgroup Manager,

The other option is when we add the users they will have home directories and we may want to stream from there. The manual notes this can done in the Access tab by selecting 'Enable home directory streaming'. Users then put their hinted quicktime movies into the folder that was created in the their home directory (/username/Sites/Streaming). The downside of this approach is to stream a live broadcast from a directory other than the default media directory you must create a qtaccess file. These files are like the htaccess files used with the Apache web server. It contains information about users and groups who are authorized to view media in that directory.

The Access tab has a mp3 broadcast password box. We leave this empty
The IP Bindings tab has two options - we enable streaming on all IP addresses

4. After Saving the changes we click the Start Quicktime Streaming button.

Testing it Out

There are some sample movies included with QTSS in the default folder. You use a quicktime player to  view these movies. 

1. Went to the G5 mac and ran quicktime player
2. Select Preferences, Streaming, Speed and set it to LAN with Enable Instant On
3. Select File, Open URL and put in rtsp://gnickers.fims.uwo.ca/sample_300kbit.mov
4. Went to the XP machine and it played no problem there too

Can't for ubuntu as there is no quicktime player. We then copied over a bunch of old quicktime movies when Liam was 2 and tried to view them. We get 'unsupported media type' from the windows player and 'live broadcast paused' from the mac. Oh, these movies are probably not hinted so they will have to be converted to streaming format. Tomorrow.

Conclusion

We now have a streaming media server. However there are a number of things to improve.

  • The use of the quicktime player with rtsp:// is clumsy and not suitable for end users so we need to set up  some basic web pages to link to content. These pages should really be dynamic so as to reflect new content files. Will start with test pages and then maybe brush up on php 
  • Existing content files in quicktime format will have to be converted so we need to know which is the best or easiest way of doing this and it has to work with the software on the IMC lab client machines

To Do:

  • Install quicktime broadcaster on Dual G5 - done!
  • Figure out how it works and set up a workflow between G5 and the media server
  • Test it out with live camera broadcase
  • Look at getting a newer mac laptop





Monday, February 9, 2009

Xsane in the OSX brain

Using a Scanner with OSX

My brother is getting married in July so i thought i'd scan all the old photos and create a movie. There are 2 scanners - the Canon usb one is hooked to //godzilla, a Ubuntu 8.04 box and the other is a big HP scanjet scsi model hooked up to //rodan, a windows 2003 server that is due to retire sometime soon.

Rather than scan and move files around i decided to hook a scanner to //mothra, a dual G5 running osx 10.4 and pulled out the almost identical canon canonscan N650U which is a usv scanner. I once tried to hook it up to windows but it complained about drivers etc. so it has been sitting around collecting dust.

We plug it into the G5 and it does show up in the 'About this mac' but there is no way to operate it. So off to the canon site where there is some downloads, apparently a driver download and the canonscan software. We download and try to install. No joy - the canon software cannot find the canon scanner. Reading around the net we discover this situation is still very common with osx and scanners. What's the solution?

Well on the Ubuntu box we plugged in the canon scanner and it picked it up and we scanned stuff with Xsane. No install, no problem = it just works. Hey wasn't that supposed to be windows big thing? Well it worked in ubuntu and not in windows. So, can we use the open source SANE software on osx?

We check the list of supported sane devices at: http://www.sane-project.org/sane-supported-devices.html and the canoscan n650u is listed as 

ModelInterfaceUSB idStatusCommentBackendManpage
Cano
Scan
N650U
N656U
USB0x04a9/0x2206CompleteNA plustek 
(0.52)
sane-plustek

We find osx binaries at http://www.ellert.se/twain-sane/ and download them. First we extract the pkg files from the zipped tarballs. We now have the following:

  • gettext
  • libusb
  • sane-backends
  • twain-sane interface
  • sane-preference pane
And we install them in that order. We now check the system preferences and there is SANE in the other section. Clicking brings up a list of drivers for many models - we uncheck all but the canon and the plustek. We do not activate scanner sharing.

Off to applications to run image capture which says 'no image capture device connected'. We select Devices, Browse Devices, TWAIN devices from the menu. SANE is shown as an option so we select it. Do we tick the Use TWAIN software box? Ok we will tick it and see. Now we click CONNECT. Put a photo on the plate and click SCAN. Now we have some options. We select 14 bit color at 1200 dpi. Nice to see the CanoScan as the image source! We click SCAN but get an error during device I/O.

We should test this with a known working scanner. Off we go to get the other canon usb scanner. Ok the scanner we were using may have had a problem. Let's try the canon something - it doesn't seem to have a model number but is almost exactly the same.

Back to image capture and we try Devices, Sane, Overview to see if we can get a preview. The scanner makes a little noise and it takes a minute but then it starts scanning. But not scan.jpg is found in the pictures folder and no preview. Try again. The SCAN button is still grayed out.

Ok the scanner is in fact a canon 630U and now the SCAN button is there - i had to reboot to get everything working. I wasted another hour trying the canon software and driver which did not work. The SANE twain is a bit slow to make the scan - not its fault i think, probably due to the weird way twain is implemented in osx. 

Summary and Conclusions

In this test of installing a 'plug n play' USB device - namely a common scanner on Windows, OSX and Linux, the easiest OS was...Linux.  Ubuntu 8.04 picked up the scanner without installing drivers and i was able to scan immediately using XSANE. When plugged into windows the scanner/camera wizard could not find the scanner. I went to the canon site but and there was software there for XP but since i don't want to use windows anymore i decided not to download and install. I next tried osx and did download and install the manufacter's software which did not work. This is not to say it would never work - just that it was not an easy or obvious thing. Finally, i tried the open source SANE and it worked. Chalk one up for open source.