N900 is a great phone for those who knows how to use it. Recently I have got a little projector (Optoma PK301) which is, by the way, a great and very capable device. One of the devices I planned to connect to it was my N900 phone. Its AV cable fits nicely one of the cables shipped with PK301 and you do not really need HD video source for a pico projector. Picture is good enough for any movie anyway.

Once I tried it for the first time, I have found two problems. First of all, the picture was just too small. It was approximately half of the image produced by the projector. Unfortunately, PK301 refuses to stretch the image both vertically and horizontally at the same time unless you use VGA cable. Second problem was the audio. Small mono speaker available in the projector is just not good enough for a movie. N900 has great speakers but, unfortunately, the software is designed so it redirects the sound to the connected AV device once video output is connected..

After searching a bit on maemo.org I have found a method of configuring the parameters of the video signal produced by the projector. The following commands will fix them and N900 will use almost entire area of the projected image (you have to be root to run them):

	echo 26,10 > /sys/devices/platform/omapdss/overlay2/position
	echo 658,464 > /sys/devices/platform/omapdss/overlay2/output_size

First one moves the image to the top-left corner, the second one sets the maximum resolution I could get from the handset. The image uses the entire height but does not use the entire width. All you need to do to make it perfect is to tell the projector to stretch the image horizontally (only).

Now about the audio. N900 use pulseaudio and ALSA sound drivers. I did not have time to figure out how to alter the audio configuration to change the logic. Instead I have decided that all I need to do is to restore the same mixer settings as the phone uses when no AV cable is connected. With ALSA it is very easy to store the current settings to the file.

	/usr/sbin/alsactl -f ~/alsactl.bak store

Then the settings can be restored by the following command:

	/usr/sbin/alsactl -F -f ~/alsactl.bak restore

So what I have done - I have stored the original settings, then the settings active when AV cable is connected and combined them to produce a config that keeps TV out enabled but uses internal speakers instead of audio output via AV cable.

Now I can enjoy the full-screen movie on the ceiling ;) and the sound is played via N900's stereo speakers.

blog comments powered by Disqus


20 January 2011