Anda di halaman 1dari 4

Lorenzo ROSSI

Robotics, Brain and Cognitive sciences

Video streaming over bluetooth


Page | 1
This paper will show you how to broadcast a jpeg video stream over bluetooth using a FOX board.
We tested what is hereafter with two different dongles
• Nortek BT600
• Trust BT2100P
And two different webcams, anyway any webcam supported by the ov51x driver should be ok
• Creative Webcam Vista
• Hercules Classic Webcam
The development environment is a Microsoft Windows XP PC with VMWare Player 2.0.2 running an image of Fedora 8 and the
latest SDK downloaded from www.acmesystems.it. You must have Microsoft Visual C++ 2005 Express Edition + PSDK installed in
order to run or recompile the windows client. You can freely download the Microsoft Visual C++ 2005 Express Edition + PSDK
from www.microsft.com.
To test the jpeg over bluetooth video streaming we had the best performance using the cheap Creative Webcam Vista (640x480
30 fps) with a customized version of the ov51x driver.

SDK configuration

First of all you should generate an image of the kernel with bluetooth support.

Fig.1
SDK configuration

Inside the FOX board root directory type

# make menuconfig

Select your FOX board type then the Kernel version 2.6.15.
Select Driver settings then Enable Webcam support and then Bluetooth BlueZ libraries and tools and the sub-menus Open-Obex
and ussp-push as in Fig.1. Please note that we’re not going to use the servfox so you can leave the Webcam tools option
unselected.

Save, exit the menuconfig and rebuild the kernel typing


Lorenzo ROSSI
Robotics, Brain and Cognitive sciences

# ./configure
… Page | 2
# make

At the end reflash the FOX board with the new fimage, according to the instructions you can find on www.acmesystems.it
website.

Installation and configuration

The bt.tar.gz tarball available at http://rossi.lorenzo.googlepages.com/foxboard contains, in the fox directory, three files you
have copy in the right position, in order to have the installation process completed.

Namely you can find the following files


• /mnt/flash/job.sh
• /mnt/flash/ov51x.ko
• /mnt/flash/jpegbt

The first one is the jpeg over bluetooth configuration shell script. The second one is the webcam driver, compiled as kernel
module and the last one is the jpeg over bluetooth server.
To test the dongle, simply copy these files in the specified directories, plug the bluetooth dongle and plug the camera.
Then insert the bluetooth and ov51x kernel modules and start the server, please be sure that the job.sh script has the execute
flag set.

# cd /mnt/flash
# chmod +x job.sh
# ./job.sh
Using /lib/modules/2.6.15/kernel/net/bluetooth/bluetooth.ko
Using /lib/modules/2.6.15/kernel/net/bluetooth/l2cap.ko
Using /lib/modules/2.6.15/kernel/net/bluetooth/rfcomm/rfcomm.ko
Using /lib/modules/2.6.15/kernel/drivers/bluetooth/hci_usb.ko
Using /lib/modules/2.6.15/kernel/drivers/media/video/videodev.ko
Using /mnt/flash/ov51x.ko

Check the kernek messages

# dmesg
...
usb 1-1: new full speed USB device using hc-crisv10 and address 3
usb 1-2: new full speed USB device using hc-crisv10 and address 4
Bluetooth: Core ver 2.8
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP ver 2.8
Bluetooth: L2CAP socket layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM ver 1.6
Bluetooth: HCI USB driver ver 2.9
usbcore: registered new driver hci_usb
Linux video capture interface: v1.00
/projects/fox/ov51x/ov51x.c: USB OV519 video device found
/projects/fox/ov51x/ov51x.c: Sensor is an OV7670
/projects/fox/ov51x/ov51x.c: Device at usb-hc-crisv10.0-2 registered to minor 0
usbcore: registered new driver ov51x
/projects/fox/ov51x/ov51x.c: v1.65-1.12-lr : ov51x USB Camera Driver

Finally run the jpeg over bluetooth server.


Lorenzo ROSSI
Robotics, Brain and Cognitive sciences

# ./jpegbt –r 30000
Page | 3

Now you should be able to receive the jpeg video stream using the simple client for windows that you can find in the windows
directory of the bt.tar.gz tarball.
Plug the bluetooth dongle in your PC and in windows double-click the FOXJS.exe.
From the upper combo box select the bluetooth interface then please wait for the scan of the bluetooth devices in range.
When the scan completes, in the lower combo you should find a list, MAC address and name, of the devices in the range of your
PC. Select the device named IIT then from the Bluetooth menu, select Video.
In a few moments you should be able to see the video streaming.

Please note that the window client is only a small demo and in order to quit correctly you have to first uncheck the Video menu
voice and then close the window.

With the –r option, we choose to limit the bandwidth to approx 30 Kbps because some dongles we tested simply crashed under a
heavy load, the best performer was the Nortek BT600, with this dongle we were able to have 6 fps without bandwidth limitation.

Fig.2
jpeg over bluetooth windows client

Source code

In the bt.tar.gz tarball you can also find the directory src containing the source files and Makefile to build the the jpeg over
bluetooth server, in the same directory you can find the code of the windows client in the windows folder.
You can find the source code at http://rossi.lorenzo.googlepages.com/foxboard
At the same address you can find the ov51x driver for the supported webcams.
Lorenzo ROSSI
Robotics, Brain and Cognitive sciences

You can compile the kernel modules simply typing make clean and then make.
Page | 4
[root@localhost ov51x]# make clean
rm -f ov51x.o *.o
rm -f /projects/fox/ov51x/ov51x.o /projects/fox/ov51x/*.o
rmdir include/linux 2>/dev/null || true
rmdir include 2>/dev/null || true
[root@localhost ov51x]# make
make[1]: Entering directory `/projects/fox/ov51x'
make -C /home/fox/devboard-R2_01/os/linux-2.6 SUBDIRS=/projects/fox/ov51x EXTRA_CFLAGS="-DNOKERNEL -D__KERNEL__
-Wall -Wstrict-prototypes -D_GNU_SOURCE -O2 " modules
make[2]: Entering directory `/home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1'
LD /projects/fox/ov51x/built-in.o
CC [M] /projects/fox/ov51x/ov51x.o
Building modules, stage 2.
MODPOST
CC /projects/fox/ov51x/ov51x.mod.o
LD [M] /projects/fox/ov51x/ov51x.ko
make[2]: Leaving directory `/home/fox/devboard-R2_01/os/linux-2.6-tag--devboard-R2_01-1'
gcc-cris -isystem /home/fox/devboard-R2_01/target/cris-axis-linux-gnu/include -mlinux -mno-mul-bug-workaround -
Wall -Wshadow -O2 -g -DNOKERNEL -D__KERNEL__ -Wall -Wstrict-prototypes -D_GNU_SOURCE -O2 -c -o ov51x.o ov51x.c
make[1]: Leaving directory `/projects/fox/ov51x'

[root@localhost btjpegserver]# make clean


rm -f jpegbt *.o core
[root@localhost btjpegserver]# make
gcc-cris -isystem /home/fox/devboard-R2_01/target/cris-axis-linux-gnu/include -mlinux -Wall -Wshadow -O2 -g
-c -o jpegbt.o jpegbt.c
gcc-cris -isystem /home/fox/devboard-R2_01/target/cris-axis-linux-gnu/include -mlinux -L/home/fox/devboard-
R2_01/target/cris-axis-linux-gnu/lib -Wl,-rpath-link,/home/fox/devboard-R2_01/target/cris-axis-linux-gnu/lib -
lpthread -D_REENTRANT jpegbt.o -o jpegbt

The windows client doesn’t need installation, just double-click on the FOXJS.exe. Keep in mind that you have to have the Visual
C++ 2005 Express Edition + SDK installed.

About…

Lorenzo ROSSI
Robotics, Brain and Cognitive Sciences

iit Italian Institute of Technology


Via Morego, 30
16163 Genova, ITALY

mobile : +393346532958

lorenzo.rossi@iit.it

http://www.iit.it

http://rossi.lorenzo.googlepages.com
http://www.linkedin.com/in/lorenzorossi