Friday, June 26, 2009

ArmadilloでWebカメラを使用しようとしているが...

Armadillo300でWebカメラを使用しようとしているが,まだわからないことがたくさんあって,苦労するわ~.疲れるなこの作業...

とりあえずメモしておこう.Qcam Pro 4000を使用する.カーネルの再構築でpwcドライバモジュール,Video for Linuxも入れ,カメラを差し込んだら認識してくれた.ただffmpegを起動するとI/Oエラーが出る...

■ffmpeg-0.4.8はMLでも書いてあったが,gcc 3.xでやらないとダメみたい.下のエラーが出た
make -C libavcodec all
make[1]: ディレクトリ `/tmp/ffmpeg-0.4.8/libavcodec' に入ります
gcc -g -O3 -Wall -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 \
-D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o common.o common.c
In file included from avcodec.h:14,
from common.c:27:
common.h:66: error: array type has incomplete element type
common.h:70: error: array type has incomplete element type
make[1]: *** [common.o] エラー 1
make[1]: ディレクトリ `/tmp/ffmpeg-0.4.8/libavcodec' から出ます
make: *** [lib] エラー 2
■で,疲れたのでもう辞めたいだが,一旦全部リセットしてやり直し...ソース取得からやろう.今度はsvnではなくgitで.理由:成功した先行者がいたからだ...意味ない...
$ git clone git://git.mplayerhq.hu/ffmpeg/
$ cd ffmpeg/
$ git clone git://git.mplayerhq.hu/libswscale/
$ ./configure
$ make
ffmpegをコンパイルするとき赤の部分でconfigureする.MLから抜き出した.これ助かるわ~
ファイルの先頭に、configure時に指定したオプションが表示されていませんでしたか?
それを見せて欲しかったです。。

こちらの環境では、以下のようになっています。

config.logの先頭
ffmpeg$ cat config.log | head -10
% ./configure --cross-prefix=arm-linux-gnu- --enable-cross-compile \
--cc=arm-linux-gnu-gcc --arch=arm --logfile=config.log

ARCH_EXT_LIST='
altivec
armv5te
armv6
armvfp
iwmmxt
mmi
mmx
mmx2

config.makの先頭
ffmpeg$ cat config.mak | head -10
# Automatically generated by configure - do not modify!
FFMPEG_CONFIGURATION=--cross-prefix=arm-linux-gnu- --enable-cross-compile \
--cc=arm-linux-gnu-gcc --arch=arm --logfile=config.log
prefix=/usr/local
LIBDIR=$(DESTDIR)${prefix}/lib
SHLIBDIR=$(DESTDIR)${prefix}/lib
INCDIR=$(DESTDIR)${prefix}/include
BINDIR=$(DESTDIR)${prefix}/bin
MANDIR=$(DESTDIR)${prefix}/share/man
CC=arm-linux-gnu-gcc
YASM=arm-linux-gnu-yasm

という感じに、CCにarm-linug-gnu-gccを使うように指定できています。

■で,無事コンパイルできた.特権ユーザでコンパイルする必要がない.

■後Armadilloに移動してやってみるだけ.だけどArmadillo300がない.なぜならコンパイルができたのは家に帰ってからだ.明日続きを...

Armadillo 300にPingしても応答なし



Armadillo-300にPingしても応答なし.iptablesが原因

Tuesday, June 23, 2009

Call for Papers VNC2009

Call for Papers
Scope and Purpose:

This conference will seek to bring together researchers, professionals, and practitioners to present and discuss recent developments and challenges in vehicle-to-vehicle and vehicle-to-infrastructure networking technologies, and their applications.

Topics of interest are:

* Vehicle-to-vehicle (V2V) communications
* Vehicle-to-infrastructure (V2I) communications
* Vehicular ad hoc networks
* Potential applications of V2V and V2I communications including ITS
* Protocols for V2V and V2I communications (MAC, routing, mobility management, etc.)
* Security and authentication issues in V2V and V2I networks
* Physical layer and RF level technologies for V2V and V2I communications
* Antenna system technologies for V2V and V2I communications
* Radio resource management and QoS support for V2V and V2I communications
* Information networking over V2V, V2R and next-generation networks
* Simulation / performance evaluation techniques for V2V and V2I communications
* Algorithms, protocols and systems for data dissemination in V2V and V2I communications
* Experimental systems and testbeds for V2V and V2I communications
* Standardization updates on V2V and V2I communications

Paper submission date: August 3, 2009
Notification of acceptance date: September 7, 2009
Final paper submission date: October 2, 2009

General Chairs:

Dr. Onur Altintas, Toyota InfoTechnology Center, Japan
Dr. Wai Chen, Telcordia Technologies, USA

Contact:

Dr. Onur Altintas
Toyota InfoTechnology Center, Japan
onur[at]computer.org

Dr. Wai Chen
Telcordia Technologies, USA
waichen[at]ieee.org

Monday, June 08, 2009

SerialPortのDataReceivedイベントについて

鈴木@KEG と申します。

だいぶ前の投稿への返信ですけど、他のみなさまのためにも。

DataRecieved イベント で、受信したバイト数を取得するには、BytesToRead プロパティを参照します。例外の補足を除いたシンプルなコードは、以下のように書けます。

if (serialPort1.BytesToRead > 0)
{
// 受信バッファからデータを取得
byte[] b = new byte[serialPort1.BytesToRead];
Read(b, 0, b.Length);
}

DataRecieved イベントを受け取った後も、刻々と受信バッファにデータが入るので、BytesToRead を参照するときには注意して下さい( 上の例だと、Read(b, 0, serialPort1.BytesToRead); はNG )。

ReadBufferSize は、バッファのサイズそのものです。また、ReceivedBytesThreshold は、受信バッファに溜まったデータが何バイトになったら、DataRecived イベントを発生させるか、といったプロパティです。初期値はいずれも 0を越えていますのでサンプルに挙げられたソースでは、常に真となってしまわれると思います。

DataRecieved イベント内の処理が多かったり、イベント内で複数回のReadを行っていると、DataRecieved イベントは受信バッファにReceivedBytesThreshold の分だけデータが溜まった時に呼ばれるので、イベントがスタックする事もあるかと思います(フロー制御を行っていると、大抵は相手の送信が止まるので確認できませんけれど)。イベントが来ることを防止するのでは無く、BytesToRead で読み取り可能なバイト数を確認する事と、Read の例外をcatch するのが良い方法だと思います。