On USB projectors, linux and libam7xxx

I was looking into compact/mini/pico/handheld projectors, and I obviously wanted something I could use under GNU/linux, there were basically two choices:

  1. Pick up a projector with VGA/HDMI: Operating System independent.
  2. Pick up a USB projector: shipped only with drivers for MS Windows (and sometimes for MacOSX too).

Since the first choice was more expensive and I verified that writing a driver for the second case wasn't too hard, I picked up an Acer C110, I paid it about 160 €, but you can find it even cheaper somewhere else, grr.

AM7X or AM7XXX

The C110 is based on an Actions Micro AM7212P IC and uses USB bulk transfers with a simple packet based protocol on top to exchange data and commands to and from a host system and the AM7XXX chip.

Other projectors using the same protocol are:

These projectors use the USB Vendor and Product IDs 1de1:1101 in mass storage mode and 1de1:c101 in display mode.

Some DPFs too (from Hannspree for instance) are known to use these chips but I don't know yet if they can be put in USB display mode.

I will refer to these devices as either AM7X or AM7XXX devices.

Open Source driver for AM7XXX devices

Reto Schneider and I are reverse engineering the USB protocol used by these devices, using USB dumps and disassembling the Windows device driver, and a basic but already usable library to communicate with those AM7x based projectors can be found in libam7xxx. Reto was the first to start working on that, in the form of acerc11xdrv.

So you can now get these projectors to work wherever libusb-1.0 works, that means you can use them with your phone if it can run GNU/Linux for instance, or even Android/Linux but I don't have an Android device to verify that.

For now all the communication about the development is happening on the #am7xxx IRC Channel on the Freenode Network, come find us, and let us know if you want to help: like hosting a mailing list for us, or sponsoring some hardware (USB projectors you want to use freely or devices you want to use these projectors with).

Side note: the user manuals of these devices sometimes refer to the functionality of displaying images over USB as Display over USB (or DoUSB), this definition is used on a lot of projectors but I don't know if it refers always to the same protocol/mechanism to send images over USB.

Linux running ON other projectors

Incidentally, when I was doing my pre-purchase market research, I ran into several projectors which —unsurprisingly— are running a Linux system themselves (linux kernel, busybox, etc.), here is a summary of what I found out:

  • Samsung SP-H03 (not based on AM7X): the firmware image can be downloaded here, and Samsung is providing the source code for the Free Software used in it, you can find it on opensource.samsung.com (AFAIR Harald Welte gave them some directions about GPL compliance, right?).

    This could be an interesting device if you want to run your own code on a projector.

  • Acer K330: based on a chip of the same am7x family as the C110.

    The firmware image is available for download and it does contain the Linux kernel and other Open Source software, but the source code is not available, neither Linux or the GPL are mentioned in the downloadable documentation; I am going to do more research on this later to see if Acer is in compliance with the GPL.

Open Projectors?

Having the ability of processing an image before projecting it —either on an external system, or on the projector itself— opens up to a lot of possibilities, and I can foresee an increase of AR applications using projectors; so, do you think there is enough interest for an Open Projectors project? A place where we can share the techniques (keystone correction, or some more sophisticate anamorphic transformations by the means of a Camera-Projector system) and the Open Source software implementing them, all in a single place.

Get in touch if you have any ideas about that.


CommentsSyndicate content

Hello , I Have C120. will

Dhanraj Rajput's picture

Hello ,

I Have C120. will this source work for C120 as well? if not then please let me know what changes i should be doing in the source.

thanks
Dhanraj Rajput

Hi Dhanraj, the library

ao2's picture

Hi Dhanraj, the library should work with the C120 as well.

Contact me by email, or join the #am7xxx IRC channel on Freenode for more details.

Ciao, Antonio

Acer C120 has Product ID

Dhanraj Rajput's picture

Acer C120 has Product ID 0xc102.

How to compile? I try to

Michael Renner's picture

How to compile?

I try to compile the current version at my kubuntu 10.04 LST. I guess I have to use cmake for this, right?

renner@mars:/usr/src/libam7xxx-d526982$ cmake src
CMake Error at CMakeLists.txt:4 (find_package):
  Could not find module Findlibusb-1.0.cmake or a configuration file for
  package libusb-1.0.
  Adjust CMAKE_MODULE_PATH to find Findlibusb-1.0.cmake or set libusb-1.0_DIR
  to the directory containing a CMake configuration file for libusb-1.0.  The
  file will have one of the following names:
    libusb-1.0Config.cmake
    libusb-1.0-config.cmake
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as
    cmake_minimum_required(VERSION 2.8)
  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!

The development libraries for usb userspace applications are installed

renner@mars:~$ cmake --version
cmake version 2.8.1
renner@mars:~$ dpkg --list | grep libusb
ii  libusb-0.1-4                                       2:0.1.12-14ubuntu0.2                                 userspace USB programming library
ii  libusb-1.0-0                                       2:1.0.6-1                                            userspace USB programming library
ii  libusb-1.0-0-dev                                   2:1.0.6-1                                            userspace USB programming library developmen
ii  libusb-dev                                         2:0.1.12-14ubuntu0.2                                 userspace USB programming library developmen
ii  libusbmuxd1                                        1.0.2-1ubuntu2                                       USB multiplexor daemon for iPhone and iPod T

Any hint?

Thanks

Hi Michael, this is how you

ao2's picture

Hi Michael,

this is how you compile the code:

renner@mars:/usr/src/libam7xxx-d526982$ mkdir build
renner@mars:/usr/src/libam7xxx-d526982$ cd build
renner@mars:/usr/src/libam7xxx-d526982/build$ cmake ../
renner@mars:/usr/src/libam7xxx-d526982/build$ make

Ciao,
Antonio

Hello it's possible to use

Giuseppe's picture

Hello it's possible to use libam7xxx library on Windows platform? I am currently testing this library with a C120 acer projector but libusb give me following errors

libusb: 0.116006 error [composite_submit_control_transfer] no libusb supported interfaces to complete request
libusb: 0.121007 error [composite_submit_bulk_transfer] unable to match endpoint to an open interface - cancelling transfer

can you help me please

Hi Giuseppe, libam7xxx and

ao2's picture

Hi Giuseppe,

libam7xxx and picoproj work on Windows, yes, info are in the README and HACKING documents.

But the problem in your case is that C120 is not supported (and cannot be) by libam7xx because it uses a different protocol to communicate with the host system.

If you want I can put you in contact with other owners of C120 if you guys want to reverse engineer the protocol yourselves. Join the #am7xxx IRC channel or write me privately.

Alternatively, if you really need an open source driver for C120, you could donate a C120 to me and I'll try to do that :)

Ciao, Antonio

Hi Antonio, many thanks for

Giuseppe's picture

Hi Antonio,
many thanks for your prompt reply! Unfortunately I have supposed that C120 product was compatible with libam7xxx library.
For now I think I will just use regular projector drivers, because I am not able to do reverse enginering of protocol. Anyway many compliments for your great job!
Ciao, Giuseppe

There is one more

Michael Renner's picture

There is one more error:

root@solaris:/usr/src/libam7xxx-d526982/build# cmake ../
-- The C compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found Git: /usr/bin/git 
-- Found date: /bin/date
-- Generator is: Unix Makefiles
--  - "git archive" will use the date too!
-- Found libusb-1.0:
--  - Includes: /usr/include/libusb-1.0
--  - Libraries: /usr/lib/i386-linux-gnu/libusb-1.0.so
-- Looking for avformat_open_input
-- Looking for avformat_open_input - not found.
CMake Error at examples/CMakeLists.txt:27 (message):
  Function avformat_open_input missing.  Please use a newer FFmpeg release.


-- Configuring incomplete, errors occurred!

It is the current kubuntu version 12.04. It comes with
ffmpeg 0.8.1. I can compile the current ffmpeg version 0.11.1, but will this solve the problem?

Thanks

Michael, I'll try to figure

ao2's picture

Michael, I'll try to figure out what the minimum required version is and that highlight that in the documentation.

I really want to avoid adding compatibility code for older ffmpeg/libav versions.

Thanks, Antonio

Moin, no problem, I installed

Michael Renner's picture

Moin,

no problem, I installed the current ffmpeg-version to /usr/local. But now I run into an other problem: Linking the play binary fails:

[ 66%] Built target am7xxx-static                                                                                         
Linking C executable ../bin/am7xxx-play
/usr/local/lib/libavformat.a(swfdec.o): In function `swf_read_header':                                                    
/usr/src/ffmpeg/libavformat/swfdec.c:107: undefined reference to `inflateInit_'
/usr/local/lib/libavformat.a(swfdec.o): In function `zlib_refill':
/usr/src/ffmpeg/libavformat/swfdec.c:75: undefined reference to `inflate'
/usr/local/lib/libavformat.a(swfdec.o): In function `swf_read_close':
/usr/src/ffmpeg/libavformat/swfdec.c:269: undefined reference to `inflateEnd'
/usr/local/lib/libavdevice.a(lavfi.o): In function `lavfi_read_packet':
/usr/src/ffmpeg/libavdevice/lavfi.c:295: undefined reference to `av_buffersink_get_buffer_ref'
.
.
.

The debian packages liblz-dev and liblz1-dev are installed. Anyhow: I can not find the "-lz" switch in the makefile. Any hint?

Hi Michael, about passing

ao2's picture

Hi Michael,

about passing options to the compiler you can do something like:

$ CFLAGS="-lz" cmake ../

Or alternatively you can disable things when compiling ffmpeg/libav.

And be sure that cmake picks up ffmpeg headers from /usr/local/include, as a general rule you should compile using the headers of the same version of the library you are going to link the binary to.

Another choice you can explore is to find an Ubuntu PPA which provides a newer ffmpeg/libav version already packaged.

Moin, thanks for your work

Michael Renner's picture

Moin,

thanks for your work and all the help you gave me here. I maneged it to compile the source. It's running fine now! Now I'm going to compile the application on my other machines. Maybe writing some scripts to start it automaticly by plugging the USB connector in or so ;-)

CU

Hi, I have just managed to

roliopolio's picture

Hi,
I have just managed to build picoproj under Xubuntu 12.04.

If it helps anyone I've written a rough log of my attempt at

http://roliopolio.weebly.com/acerc110.html

I haven't managed to build am7xxx-play yet because I'll probably need to write an xcb.pc.

So, thanks to ao2 and other shoulders for this library; I now have a nice 50 lumen projector for €50 off Ebay.

Next, I'll need a way to make it display my laptop screen, possibly in reverse as a back projector.

rp

@rp, try installing

ao2's picture

@rp, try installing libx11-xcb-dev, note that XCB is optional anyways.

BTW, join the IRC channel if you need more help with compiling the example programs.

Hi, is there any possibility

konstl's picture

Hi,

is there any possibility to pass a device id to am7xxx-play?
I own two C112 projectors from Acer and want to display
different images on each of them

Konstantin

Hi Konstantin, the library

ao2's picture

Hi Konstantin,

the library has support for multiple devices, but the functionality is not exposed in the example programs because it has not been tested (none of us has more than one projector).

Join the IRC channel and I'll give you an experimental patch to test. Please try to hang out for a while in the channel, we may be slow to answer :)

hi guys ein kleines howto

ralf's picture

hi guys

ein kleines howto findet ihr auf ubuntuusers.de

http://wiki.ubuntuusers.de/Baustelleamer_Acer_C110

viel erfolg und spass beim schaun.

lg ralf

Hi, on my mk802 armhf i am

paul's picture

Hi, on my mk802 armhf i am trying to build like this:

root@debian:/test/2# git clone http://git.ao2.it/libam7xxx.git
Cloning into 'libam7xxx'...
root@debian:/test/2# cd libam7xxx
root@debian:/test/2/libam7xxx# mkdir build
root@debian:/test/2/libam7xxx# cd build
root@debian:/test/2/libam7xxx/build# cmake -D CMAKE_BUILD_TYPE=debug -D STRICT_COMPILATION_CHECKS=ON ../
-- The C compiler identification is GNU 4.6.3
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found Git: /usr/bin/git (found version "1.7.10.4")
-- Found date: /bin/date
-- Generator is: Unix Makefiles
--  - "git archive" will use the date too!
-- Found libusb-1.0:
--  - Includes: /usr/include/libusb-1.0
--  - Libraries: /usr/lib/arm-linux-gnueabihf/libusb-1.0.so
-- Looking for avformat_open_input
-- Looking for avformat_open_input - found
-- Looking for sigaction
-- Looking for sigaction - found
-- Looking for strtok_r
-- Looking for strtok_r - found
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
-- checking for module 'xcb'
--   found xcb, version 1.8.1
-- Found XCB: /usr/include
-- Found libusb-1.0:
--  - Includes: /usr/include/libusb-1.0
--  - Libraries: /usr/lib/arm-linux-gnueabihf/libusb-1.0.so
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.1.2")
-- Configuring done
-- Generating done
-- Build files have been written to: /test/2/libam7xxx/build
root@debian:/test/2/libam7xxx/build# make
Scanning dependencies of target am7xxx
[ 14%] Building C object src/CMakeFiles/am7xxx.dir/am7xxx.c.o
[ 28%] Building C object src/CMakeFiles/am7xxx.dir/serialize.c.o
Linking C shared library ../lib/libam7xxx.so
[ 28%] Built target am7xxx
Scanning dependencies of target am7xxx-static
[ 42%] Building C object src/CMakeFiles/am7xxx-static.dir/am7xxx.c.o
[ 57%] Building C object src/CMakeFiles/am7xxx-static.dir/serialize.c.o
Linking C static library ../lib/libam7xxx.a
[ 57%] Built target am7xxx-static
Scanning dependencies of target am7xxx-play
[ 71%] Building C object examples/CMakeFiles/am7xxx-play.dir/am7xxx-play.c.o
Linking C executable ../bin/am7xxx-play
[ 71%] Built target am7xxx-playa
Scanning dependencies of target am7xxx_mode_switch
[ 85%] Building C object examples/CMakeFiles/am7xxx_mode_switch.dir/am7xxx_mode_switch.c.o
Linking C executable ../bin/am7xxx_mode_switch
[ 85%] Built target am7xxx_mode_switch
Scanning dependencies of target picoproj
[100%] Building C object examples/CMakeFiles/picoproj.dir/picoproj.c.o
Linking C executable ../bin/picoproj
[100%] Built target picoproj

witch to me looks ok, but when i try to access the files, it acts as if nothing is there.

root@debian:/test/2/libam7xxx/build# cd bin
root@debian:/test/2/libam7xxx/build/bin# cd picoproj
-bash: cd: picoproj: Not a directory
root@debian:/test/2/libam7xxx/build/bin# ls
am7xxx_mode_switch  am7xxx-play  picoproj
root@debian:/test/2/libam7xxx/build/bin# picoproj
-bash: picoproj: command not found

i am a complete noob to linux so i am probably missing the obvious.
Could someone tell me what i do wrong ?(ps, i am installing it on a wheezy headless debian version through ssh)

Hi Paul, in order to execute

ao2's picture

Hi Paul,

in order to execute programs in the current working directory you have to use the ./ prefix, so the command will be ./picoproj -h.

The prefix is not necessary for programs in one of the directories listed in the PATH environmental variable. You can look up on the web for more details on that.

Of course feel free to keep asking libam7xxx specific questions.

Ciao, Antonio

Tnx a lot, that did the trick

paul's picture

Tnx a lot, that did the trick :)

a quick followup

paul's picture

a quick followup question.
The device that i would like to use my picobeamer with, does not use a normal videocard.
I installed xfce, but it gives me an error about not having found a screen.
I would like it to use the picobeamer as primary (and only) screen.
Happen to know of a guide that can help me achieve this, or got any tips?

If the device has a

ao2's picture

If the device has a framebuffer interface (/dev/fb0) then you can easily use am7xxx-play with a command line like ./am7xxx-play -f fbdev -i /dev/fb0.

If you want to run Xfce, Xorg could use this interface too with its own fbdev driver IIRC; once you got Xorg running you can use am7xxx-play with the x11grab format instead, look at the help or at the man page.

If not even a framebuffer interface is available then you could try with the Virtual Frame Buffer (vfb) kernel driver or with the xf86-video-dummy driver for Xorg.

Any news regarding

Jonas's picture

Any news regarding C120?

Sincerely,

Hi Jonas, The Acer C120

ao2's picture

Hi Jonas,

The Acer C120 supports a different protocol to send images to the projector via USB, it won't be supported by libam7xxx.

If I had one of those I could write a linux driver for it, but I do not plan on getting one by myself.

Regards, Antonio

Hi I want to ask for help. I

Anonymous's picture

Hi I want to ask for help. I can't make the driver. When I try to compile I get the message:

CMake Error at examples/CMakeLists.txt:27 (message):
Function avformat_open_input missing. Please use a newer FFmpeg release.

I've been trying to use various ffmpeg versions but without any success. Could you advise me in what can be the trouble?

Hi, the check works here with

ao2's picture

Hi, the check works here with either libav 0.8.7 or 9.6.

As a workaround you can try try removing these lines from examples/CMakeLists.txt:

  check_symbol_exists(avformat_open_input
    "${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat/avformat.h"
    HAVE_AVFORMAT_OPEN_INPUT)
  if(NOT HAVE_AVFORMAT_OPEN_INPUT)
    message(FATAL_ERROR
      "Function avformat_open_input missing. Please use a newer FFmpeg release.")
  endif()

Let me know if that works.

The cause may be the way ffmepg/libav is packaged on your distribution, I don't know for sure.

Ciao, Antonio

Hi Antonio! Thanks for the

Anonymous's picture

Hi Antonio!
Thanks for the help, but the problem eventually decided a little differently. I think I need somewhere to specify what is necessary to put the library, so people do not make the same mistakes. I have things working after I performed the following:

apt-get install libavdevice-dev 
apt-get install libavcodec-dev 
apt-get install libavformat-dev 
apt-get install libswscale-dev 
apt-get install libav-tools

and this patch
http://git.ao2.it/libam7xxx.git/blob_plain/refs/heads/debian:/debian/pat...

I am not sure libav-tools is

ao2's picture

I am not sure libav-tools is strictly needed; about the other dependencies, they are listed in HACKING.asciidoc already.

And now I've also added a mention about the patch needed for older libav versions, thanks!

Ciao, Antonio

Glad to hear you figured it

Anonymous's picture

Glad to hear you figured it out. I'm curious what methods you used to decompile the Windows software/usb traffic?

I was trying to set up a Tronsmart Mirror2TV (also an ActionsMicro device), I wonder if you have tried this device, it might be doing the same protocol, except over network instead of usb? It's supposed to be uPnP/dlna, but before sending a file it's sending some binary jibberish, then the media file, over the network using a couple tcp sockets.

I used IDA to disassemble and

ao2's picture

I used IDA to disassemble and navigate the code (bokken or objdump can be used too) and some vim+gcc scripting to get to the correspondent C code (I'll write about this approach sooner or later).

About the USB data: I captured it with usbmon+tcpdump and analyzed it in wireshark.

The device you mention seems to use Miracast, it's unlikely it uses the same protocol as in am7xxx projectors.

You can take a look at OpenWFD and see if it works with it.

Ciao, Antonio

Hello, great work! PPX 2230

Anonymous's picture

Hello, great work!

PPX 2230 works?

Cheers.

Hi, the PPX 2330 is

ao2's picture

Hi,

the PPX 2330 is supported, I don't know how different it is from the 2230.

Can you please provide the USB ids of the PPX 2230 in Display mode?

Join the #am7xxx IRC channel on Freenode or send me an email if you need directions about how to get the USB ids.

Ciao, Antonio

Hello, The PPX 2230 don't

Anonymous's picture

Hello,

The PPX 2230 don't have Display Mode :(

Any hack possibility?

Cheers.

Maybe, I need more details,

ao2's picture

Maybe, I need more details, join the IRC channel or write me an email so I can give you directions on how to know more about the device.

Ciao, Antonio

The driver works fine with my

C's picture

The driver works fine with my random-brand projector.
Thank you very much, Antonio. For the driver and the help in IRC.
C.

PS: i'll blog soon about it in my site (in spanish).

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
R
V
g
n
u
8
Enter the code without spaces.