Quantcast
Channel: am7xxx
Viewing all articles
Browse latest Browse all 11

An Open Source driver for USB pico projectors

$
0
0

This is a follow-up to the previous story about am7xxx devices.

The 0.1.2 stable release of libam7xxx is out, and some binary Debian packages are available as well. Check out also the am7xxx page on Ohloh.

The devices supported in this release are:

This release comes with a display daemon based on libav, it is called am7xxx-play and you can use it to:

  • display your X desktop:
    am7xxx-play -f x11grab -i :0.0
  • display the content of a single X window with a script like this one:
    #!/bin/sh
    
    set -e
    
    WIN_INFO="$(xwininfo)"
    
    X=$(echo "$WIN_INFO" | sed -n -e "/^[[:space:]]*Absolute upper-left X:[[:space:]]*/s///p")
    Y=$(echo "$WIN_INFO" | sed -n -e "/^[[:space:]]*Absolute upper-left Y:[[:space:]]*/s///p")
    WIDTH=$(echo "$WIN_INFO" |  sed -n -e "/^[[:space:]]*Width:[[:space:]]*/s///p")
    HEIGHT=$(echo "$WIN_INFO" |  sed -n -e "/^[[:space:]]*Height:[[:space:]]*/s///p")
    
    set -x
    
    am7xxx-play -f x11grab -i ":0+${X},${Y}" -o video_size="${WIDTH}x${HEIGHT}"
  • display the output of a framebuffer device:
    am7xxx-play -f fbdev -i /dev/fb0
  • display the output of a v4l2 device:
    am7xxx-play -f video4linux2 -i /dev/video0 -o video_size=640x480,frame_rate=30
  • display any files supported by libav (but note that the framerate is not accurate in this case and audio is not decoded at all):
    am7xxx-play -i http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v

Keep in mind that am7xxx-play is just a prototype, I think it is not worth adding audio decoding and audio/video synchronization to it.

It is interesting to note that the freedom to send images of arbitrary resolutions to the projectors exposed some bugs in the devices firmware. So if you get garbage output try replugging the device and changing the dimensions of the image you are sending for display.

Where to go from here?

In the long run I think that we could write a libav output format, or —maybe better— a GStreamer video sink based on libam7xxx.

GStreamer looks interesting to me, and maybe keystoning can be implemented as an element of a GStreamer pipeline too. I'll ask GStreamer devs about that.

On linux systems, writing a kernel driver is also a possibility, the first easy choice would be writing it as a v4l2 output device accepting JPEG images or raw NV12 frames, this way v4l2sink from GStreamer could be used immediately.

I don't know if the framebuffer way is viable, since we would have to do JPEG encoding in userspace anyways; I'll ask linux-media for advice.

But if we want portability (GStreamer runs on Windows too, doesn't it?) the linux kernel driver becomes low priority.

There is also the issue of having some display-extension-mode, right now am7xxx-play is enough if you are only interested in a clone of the current screen, but what if we want another screen displayed by the projector? I read the Xvfb might go away in future Xorg versions and that we should use xf86-video-dummy, but I've just learned about it, I have to see how to use it, if it supports RANDR and stuff like that.

Call for help

If any Debian Developer is willing to sponsor the libam7xxx package for upload to the Debian archive, let us know, I'll try asking on debian-mentors as well. The packaging bits are in the libam7xxx debian branch.

If you are interested in sponsoring a port to Android/Linux, get in touch, we could use some (even old) Android device with USB Host support and maybe some other projectors to test multi-device operation of libam7xxx.

If you'd like to have an Open Projectors project where you can find Open Source software to use with video projectors, speak up! I'd like to hear some opinions before I start putting time on that. The L.A.S.E.R. Tag Linux port is an example of the kind of software I am talking about.

We are in the #am7xxx channel on the freenode IRC network.

Side Note: the development of am7xxx-play brought also a little fix for libavdevice.


Viewing all articles
Browse latest Browse all 11

Trending Articles