Skip navigation

Sci Fi Your Pi

4 Posts authored by: kenny_r

A component that is very important for my project arrived: the projector!

projector-box.jpg

The very generic-looking box

Projectors can get really expensive, but as you can see I went with a budget version. For around 50 bucks you can find yourself a Chinese-made projector that does 480x320 and has a brightness of 100 lumen. If you're thinking that's pretty pathetic, I agree. I decided to spend a little extra and got myself one that did 640x480 (at only 80 lumen) for 70 bucks. This way R2-D2's projector would at least meet the VGA standard.

 

After unboxing and inspecting it at work, one of my colleagues remarked that it made a rattling noise. Some part was loose inside the projector. He handed me a screwdriver and convinced me to take apart the projector I'd owned for all of 10 minutes.

 

2015-05-05 17.15.17.jpg

Don't worry, I put it back together again


The rattling sound came from one of the speakers. It was supposed to be hot-glued to the case but had come loose. Opening it up really drove home how cheaply it was made. The plastic lens is something you'd find in a pair of toy binoculars.

 

After I took it home I hooked it up to a Pi and saw if they would play nice. Initially, they didn't. I was using a bargain bin HDMI cable and I just couldn't get the Pi to detect anything. I swapped it out with an AmazonBasics cable that I had a bit more confidence in and after that it worked fine.

projector.jpg

Hooked up to HDMI and happy

The projected image itself is very blurry, even after fiddling with the lens. I could get it into focus but even then it wasn't really.. sharp. I logged in on the Pi with ssh and set up x11vnc. This allowed me to get a better look at what was going on.

Compare a screenshot of  my VNC client to the actual image being projected.

pi-vnc.png

pi-projector.jpg

It's hard to believe but that's exactly the same image being shown. The projector presents itself with 720p as its only available resolution and then squishes that widescreen image down to 640x480. The result is predictably awful. I don't really need amazing image quality for this project but this is just awful. If you're at all interested in buying a projector, I really can't recommend a device like this. Literally save yourself the headache and get something decent.

After probably having broken my pi camera last week, I tried to revive it, but to no avail. At this point it's probably safe to call it a lost cause. I wasn't too worried over it. I have 2 USB webcams lying around and I figured I might be able to just use one of those instead instead.

In fact, these USB webcams have a built-in microphone. In absence of the Cirrus Logic audio card, that would really come in handy!

 

2015-05-08 23.25.44.jpg

Meet Laurel and Hardy

 

The left one is a Microsoft LifeCam VX-3000, the right one is an MSI StarCam 370i. They might look like a wacky duo but both have served me well and are fully functional webcams. That being said, I can't seem to make them work on the Pi.

They are both correctly detected when I connect them.

Here's dmesg and lsusb for the MSI camera:

 

[  252.049044] usb 1-1.2: new full-speed USB device number 6 using dwc_otg

[  252.151553] usb 1-1.2: New USB device found, idVendor=0c45, idProduct=60fc

[  252.151579] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0

[  252.151597] usb 1-1.2: Product: USB camera

[  252.205066] gspca_main: v2.14.0 registered

[  252.211258] gspca_main: sonixj-2.14.0 probing 0c45:60fc

[  252.214266] input: sonixj as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/input/input2

[  252.215734] usbcore: registered new interface driver sonixj

[  252.302998] usbcore: registered new interface driver snd-usb-audio

pi@raspberrypi ~ $ lsusb

Bus 001 Device 006: ID 0c45:60fc Microdia PC Camera with Mic (SN9C105)


And Microsoft:

[  417.699011] usb 1-1.2: new full-speed USB device number 7 using dwc_otg

[  417.801644] usb 1-1.2: New USB device found, idVendor=045e, idProduct=00f5

[  417.801672] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0

[  417.801690] usb 1-1.2: Product: USB camera

[  417.803249] gspca_main: sonixj-2.14.0 probing 045e:00f5

[  417.806077] input: sonixj as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/input/input3

pi@raspberrypi ~ $ lsusb

Bus 001 Device 007: ID 045e:00f5 Microsoft Corp. LifeCam VX-3000

 

The drivers appear to be correctly loaded and Iceweasel shows that both the camera and the built-in microphone are available.

camerasharingprompt.png

why yes, I would like that

 

As soon as I try to actually use either camera though, no video or audio comes through and I see hundreds of these errors in dmesg:

[12380.380712] gspca_main: ISOC data error: [8] len=0, status=-71

[12380.380721] gspca_main: ISOC data error: [9] len=0, status=-71

[12380.380730] gspca_main: ISOC data error: [10] len=0, status=-71

[12380.380738] gspca_main: ISOC data error: [11] len=0, status=-71

[12380.380747] gspca_main: ISOC data error: [12] len=0, status=-71

 

...and these:

[12452.042127] sonixj 1-1.2:1.0: URB error -71, resubmittingsonixj 1-1.2:1.0: URB error -71, resubmitting

[12452.170150] sonixj 1-1.2:1.0: URB error -71, resubmittingsonixj 1-1.2:1.0: URB error -71, resubmitting

[12452.298154] sonixj 1-1.2:1.0: URB error -71, resubmittingsonixj 1-1.2:1.0: URB error -71, resubmitting

[12452.426173] sonixj 1-1.2:1.0: URB error -71, resubmittingsonixj 1-1.2:1.0: URB error -71, resubmitting

[12452.554196] sonixj 1-1.2:1.0: URB error -71, resubmittingsonixj 1-1.2:1.0: URB error -71, resubmitting

[12452.682204] sonixj 1-1.2:1.0: URB error -71, resubmittingsonixj 1-1.2:1.0: URB error -71, resubmitting

[12452.810219] sonixj 1-1.2:1.0: URB error -71, resubmittingsonixj 1-1.2:1.0: URB error -71, resubmitting

[12452.938235] sonixj 1-1.2:1.0: URB error -71, resubmittingsonixj 1-1.2:1.0: URB error -71, resubmitting

 

Searching the web for what that error -71 means lead me to this Debian bug report. The issue appears to be very generic and I don't think I could get any webcam to work on Raspbian right now. It's really too bad but for the time being I'm going to give up on getting a camera to work with the Raspberry Pi.

By the end of this project I want to be able to start a call on my laptop or my smartphone and start a conversation with whoever is standing next to R2D2, who will holographically project my likeness. That R2D2 model has yet to be built and the projector hasn't arrived yet, so I spent my first week trying to get video conferencing working on the Raspberry Pi 2. You know, baby steps.

 

Software

When I say video conferencing you might immediately think of Skype, which is probably the most widely used video conferencing software. While Skype does have a Linux client, they don't distribute one that runs on ARM processors. On the Skype support forums someone mentions that the new web client at web.skype.com does work on the Raspberry Pi. Unfortunately, at the time of this writing, the Skype Web client is still in closed beta and I don't have an invitation. Whatever, I'm not particularly fond of Skype anyway.

 

There are a couple of open source alternatives and the ones I like best are Ekiga (formerly known as GnomeMeeting) and Linphone (part of the now-discontinued Linspire distribution). Both are SIP clients and offer free SIP accounts. Linphone wins major bonus points for having apps for both iOS and Android and for having python wrappers for the Raspberry Pi. These wrappers are featured on their home page, which links to a wiki page with documentation and an example script that is pretty close to what I want to achieve. Fantastic!

 

Hardware

The kit we received for this challenge includes the Raspberry Pi camera board. The documentation at raspberrypi.org mentions methods for snapping stills and recording video with this camera. What I need for this project however, is something that I can use as a webcam. I spent a lot of time fiddling with something called v4l2loopback. The plan was to capture stills or a video stream with the python scripts, send those to the v4l2loopback device using gstreamer, and then access that video device with the conferencing software. It was much later that I found out that all this wasn't necessary. There already is a V4L2 kernel module for the Raspberry Pi camera and it's called bcm-2835-v4l2. Linphone's raspberry pi wiki page I mentioned earlier also makes mention of this kernel module. I wish I had found it earlier... Oh well, lesson learned.

 

Loading the module is really easy:


sudo modprobe bcm2835-v4l2

echo "bcm2835-v4l2" | sudo tee -a /etc/modules

 

If you see "ERROR: could not insert 'bcm2835_v4l2': Operation not permitted" when trying to load the module, make sure the ribbon cable is connected correctly with the blue end facing the Ethernet port.

2015-04-26 18.42.34.jpg

I propped up the camera by stuffing the ribbon cable in a bank card holder

 

The kit also includes the Cirrus Logic Audio Card, but mine hasn't arrived yet. I was hoping to make due with a cheap USB sound adapter I already had lying around. Linux recognizes it as the Tenx Technology, Inc. TP6911 sound card. After configuring modprobe to load the snd_usb_audio driver for it, it doesn't appear to be fully supported on the Raspberry Pi and I can't get the audio input to work. If anyone knows a way of making both input and output of this thing to work on the Pi, please let me know in the comments.

 

The other two USB devices you see in the picture above are the Wi-Pi dongle that came in the kit and a wireless receiver for keyboard and mouse.

 

2015-04-26 19.14.39.jpg

Closeup of the cheap Tenx Technology, Inc. TP6911 USB audio adapter

 

Demo

I installed iceweasel (~= Firefox, it's a long story) because the default Epiphany browser on Raspbian doesn't support WebRTC and visited vline.com to do a quick video conferencing test without involving any SIP software like Linphone. vLine generated a room and when I visited the link with my laptop, it worked!

Ey0VyTU.png

The world's loneliest conference call.

 

This screenshot was taken on the Pi so the actual Pi Camera footage is in the lower right. As you can see in the top right corner, this is very demanding on the CPU. Hopefully this won't become a problem later. I'm not particularly worried about that because I have a more urgent problem right now: I can't get the camera to work anymore.

 

Shortly after taking the above screenshot I wiped my SD card to start from scratch, just to make sure I had all the necessary steps documented. I reinstalled Raspbian, enabled the camera in raspi-config and loaded the bcm2835-v4l2 module without errors, but the camera just won't work. I spent some time panicking and troubleshooting, trying to figure out what essential step I forgot. Then I got this clue: the raspistill and raspivid tools used to show me a full-screen camera preview. Now they show me this error:

mmal: Received unexpected camera control callback event, 0x4f525245

 

Judging by this thread on the Raspberry Pi forums, I'm dealing with a hardware failure. Maybe stuffing that ribbon cable in that bank card holder wasn't such a bright idea after all.

 

To be continued...

"Help me, Obi-Wan Kenobi. You're my only hope." - Princess Leia

alec-guinness-as-ben-obi-wan-kenobi-in-star.jpg

(Star Wars Episode IV: A New Hope)

 

Synopsys

Holograms have appeared in many works of science fiction, most notably in the Star Wars trilogies. Through these projections, pre-recorded messages could be displayed in the air and Jedi Masters are able to attend council meetings even when they are away from Coruscant.

These projections were blue-hued and jittery but spoke to the imagination of the audience despite these shortcomings. They were clearly advanced technology, bordering on magic.

 

Tupac Shakur's appearance on Coachella in 2012 was a sudden reminder to the world that we have had this technology for a while. Through a technique called Pepper's Ghost, an image can be projected onto a transparent surface and appear as if it's really there. In essence, a hologram.

6944469180_d2817860bb_z.jpg

(Image credit: Flickr user evsmitty, CC BY 2.0)

 

For this design challenge, I will attempt to leverage Pepper's Ghost to give an R2-D2 model a real-life holographic projector to be used for telepresence video conferencing.

 

Project Overview

 

The platform

I considered the officially licensed R2-D2 trash can to serve as the base platform, but at 129 dollars, it's too expensive. I'll probably have to build my own. R2-D2 is essentially just a cylinder with a dome on top and two legs at the side.

r2_trashcan_other.jpg

(ThinkGeek's officially licensed R2-D2 trash can)


The holographic projector

 

The projector would be the centerpiece of this project, and is most likely the hardest thing to get right. Pepper's ghost requires a transparent surface angled at 45 degrees to both the viewer and the light source. In this case, the light source is a video projector that will be connected to the HDMI port of a Raspberry Pi. If I really can't pull off a convincing hologram, I can fall back on using the video projector to project on a wall. Let's hope it doesn't come to that. I'll be working on this first, as soon as the projector I bought online arrives in the mail.

 

Video conferencing

The kit we're given to compete in this challenge includes a Raspberry Pi Camera Board. Together with the projector, that means I've got video input and output. Add a microphone and some speakers into the mix and I can do video conferencing! I can get started on setting up the software for this first using a computer monitor while I wait for the projector to arrive.

Council_RotS.png

(Star Wars Episode III: Revenge Of The Sith)

Conclusion

I'm excited about participating in this challenge. I'm curious to see the progress of the other contestants as well, there are some really neat proposals. Let me know what you think about my project in the comments!