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.
โดยจุดสิ้นสุดของโครงการนี้ ผมจะเริ่มโทรบนแล็ปท็อปหรือมาร์ทโฟนของฉันของฉันและเริ่มต้นการสนทนากับใครก็ตามที่ยืนอยู่ข้างๆ r2d2 ใครจะ holographically โครงการอุปมาของฉัน ที่ r2d2 รูปแบบยังสามารถสร้างและฉายยังมาไม่ถึง ฉันใช้เวลาทั้งอาทิตย์แรกของฉันพยายามที่จะได้รับการประชุมทางวิดีโอการทำงานในราสเบอร์รี่ พี 2 คุณรู้ขั้นตอนทารก
ซอฟต์แวร์เมื่อฉันพูดว่าการประชุมทางวิดีโอคุณอาจทันทีคิดของ Skype ซึ่งจะใช้กันอย่างแพร่หลายซอฟต์แวร์การประชุมผ่านวิดีโอ . ในขณะที่ Skype จะมีลูกค้า Linux , พวกเขาไม่ได้เผยแพร่ที่วิ่งบนแขน ) บน Skype สนับสนุนเวทีมีคนกล่าวถึงว่า เว็บใหม่ ลูกค้าที่ web.skype.com ทำงานบน Raspberry Pi แต่น่าเสียดายที่เวลาของการเขียนนี้Skype เว็บไคลเอ็นต์ยังอยู่ในเบต้าปิดและฉันไม่ได้มีการเชิญ ไม่ว่ายังไง ฉันก็ไม่ได้รักโดยเฉพาะอย่างยิ่งของ Skype อยู่แล้ว
มีคู่ของทางเลือกที่เปิดแหล่งที่มาและที่ผมชอบที่สุดคือ Ekiga ( เดิมเรียกว่า GnomeMeetingGenericName ) และ linphone ( ส่วนหนึ่งของตอนนี้หยุด linspire กระจาย ) ทั้งคู่ และมีบัญชีลูกค้าจิบจิบฟรีlinphone ชนะคะแนนโบนัสใหญ่สำหรับการปพลิเคชันสำหรับทั้ง iOS และ Android และมีงูเหลือมห่อสำหรับราสเบอร์รี่ Pi ห่อเหล่านี้โดดเด่นในหน้าแรก ซึ่งเชื่อมโยงไปยังหน้ารูปภาพกับเอกสารและตัวอย่างสคริปต์ที่ใกล้ชิดกับสิ่งที่ฉันต้องการเพื่อให้บรรลุ สุดยอด !
ชุดฮาร์ดแวร์ เราได้รับความท้าทายนี้รวมถึงราสเบอร์รี่พายกล้องบอร์ดเอกสารที่ raspberrypi.org กล่าวถึงวิธีการถ่ายภาพภาพนิ่งและบันทึกวิดีโอด้วยกล้องนี้ สิ่งที่ฉันต้องการสำหรับโครงการนี้ อย่างไรก็ตาม มีบางสิ่งบางอย่างที่ฉันสามารถใช้เป็นเว็บแคม ผมใช้เวลามากเวลาเล่นซอด้วยสิ่งที่เรียกว่า v4l2loopback . แผนคือการจับภาพนิ่งหรือวิดีโอสตรีมกับสคริปต์หลาม ส่งเหล่านั้นไปยังอุปกรณ์ที่ใช้ gstreamer v4l2loopback ,แล้วการเข้าถึงวิดีโอผ่านอุปกรณ์ที่มีซอฟต์แวร์ มันเป็นรุ่นที่ใหม่กว่ามาก ฉันพบว่าทั้งหมดนี้ไม่จำเป็น มีอยู่แล้วคือโมดูลเคอร์เนล v4l2 สำหรับราสเบอร์รี่พายกล้องและเรียกมันว่า bcm-2835-v4l2 . linphone ราสเบอรี่พายหน้าวิกิที่ผมกล่าวถึงก่อนหน้านี้ยังทำให้การกล่าวถึงนี้เคอร์เนลโมดูล ฉันหวังว่าฉันได้พบมันก่อนหน้านี้ . . . . . . . โอ้ดี
ได้บทเรียนแล้วโหลดโมดูลง่ายจริง ๆ :
bcm2835-v4l2 sudo modprobe echo " bcm2835-v4l2 " | sudo ตี๋ - / etc / โมดูล
ถ้าคุณเห็นข้อผิดพลาด : ไม่สามารถแทรก ' ' : bcm2835_v4l2 การดำเนินการไม่ได้รับอนุญาต " เมื่อพยายามที่จะโหลดโมดูล ให้แน่ใจว่า สายริบบิ้นมีการเชื่อมต่ออย่างถูกต้องกับฟ้าจบ กับอีเธอร์เน็ตพอร์ต
2015-04-26 18.42.34 . jpgฉัน propped ขึ้นกล้อง โดยบรรจุสายริบบิ้นในธนาคารผู้ถือบัตร
ชุดนี้ยังรวมถึงตรรกะ Cirrus เสียงการ์ด แต่ของผมยังไม่มาเลย ฉันหวังว่าจะให้เนื่องจากกับ USB อะแดปเตอร์เสียง ราคาถูก ผมได้โกหกรอบ ลินุกซ์จะเป็น tenx เทคโนโลยี , Inc tp6911 การ์ดเสียง หลังจากการ modprobe โหลด snd_usb_audio ไดรเวอร์สำหรับมันไม่ได้ดูเหมือนจะได้รับการสนับสนุนอย่างเต็มที่ในราสเบอร์รี่ Pi และฉันไม่สามารถรับสัญญาณเสียง เพื่อทำงาน ถ้าใครรู้วิธีที่ทำให้ทั้งอินพุตและเอาต์พุตของสิ่งนี้ทำงานบนปี่ โปรดแจ้งให้เราทราบในความคิดเห็น
อีกสอง USB อุปกรณ์ที่คุณเห็นในรูปด้านบนเป็น วีพี Dongle ที่มาในชุดและอุปกรณ์รับสัญญาณไร้สายแป้นพิมพ์และเมาส์ .
2015-04-26 19.14.39 . jpg
โคลสอัพของเทคโนโลยี tenx ราคาถูก , Inc tp6911 เสียง USB อะแดปเตอร์
ผมติดตั้งสาธิต iceweasel ( ~ = Firefox ก็เรื่องยาว ) เพราะว่าปริยายนิมิตเบราว์เซอร์ที่ไม่สนับสนุนและ raspbian webrtc เข้าชม vline.com ทำวิดีโออย่างรวดเร็วโดยไม่เกี่ยวข้องกับการประชุมการทดสอบซอฟต์แวร์เช่นใด ๆจิบ linphone . vline สร้างห้อง และเมื่อผมเข้าเยี่ยมชมการเชื่อมโยงกับแล็ปท็อปของฉัน มันได้ผล
ey0vytu .ผล
ของโลกที่เรียกประชุม
ภาพนี้ถ่ายเมื่อปี่แล้วจริงและภาพในกล้องด้านขวาล่าง เช่นที่คุณเห็นในมุมขวาด้านบน นี้มากต้องบนซีพียู เราหวังว่านี้จะไม่กลายเป็นปัญหาในภายหลัง ฉันไม่ได้กังวล เพราะผมมีปัญหาเร่งด่วนมากตอนนี้ฉันไม่สามารถเอากล้องไปทำงานอีกแล้ว
หลังจากถ่ายบนหน้าจอผมลบการ์ด SD ของฉันที่จะเริ่มต้นจากรอยขีดข่วนเพื่อให้แน่ใจว่าฉันมีทั้งหมดที่จำเป็นขั้นตอนเอกสาร ผมติดตั้ง raspbian เปิดใช้งานกล้องใน raspi config และโหลดโมดูล bcm2835-v4l2 โดยไม่มีข้อผิดพลาด แต่กล้องก็ไม่ทำงาน ฉันใช้เวลาบางส่วนแตกตื่นและการแก้ไขปัญหา , พยายามที่จะคิดออกว่าสรุปขั้นตอนที่ผมลืมผมมีคำใบ้ : raspistill และเครื่องมือ raspivid เคยแสดงเต็มหน้าจอกล้องแสดงตัวอย่าง ตอนนี้พวกเขาแสดงข้อผิดพลาดนี้ :
mmal ได้รับการควบคุมกล้องที่ไม่คาดคิดจากเหตุการณ์ 0x4f525245
ดูจากกระทู้นี้ในราสเบอร์รี่ Pi ฟอรั่ม , ฉันจัดการกับฮาร์ดแวร์ล้มเหลว บางทีการบรรจุที่สายริบบิ้นที่ผู้ถือบัตรของธนาคารไม่ได้เช่นความคิดที่สดใส
หลังจากทั้งหมด
การแปล กรุณารอสักครู่..
