注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

hhfighting的博客

以责人之心责己,以恕己之心恕人

 
 
 

日志

 
 
 
 

IEEE 1394 card usage  

2013-02-27 02:55:18|  分类: ubuntu 下程序开 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

My goal is using phantom device and camera through the same IEEE1394 card. My system is Ubuntu 12.04.
First step: using phantom
Phantom require raw1394 module, however Ubuntu 12.04 don't use this module again, so I need to dummy raw1394 kernel module. This operation refer to "https://wiki.sofa-framework.org/tdev/wiki/HowTo/SensableWithoutRaw1394"
and then run the following command.(In order to load this module when startup, the specific is following)

auto load raw1394 module when startup:
sudo gedit /etc/modules: add a line written raw1394
and at the same time, put raw1394.ko
theia@Theia:~$ sudo mkdir /lib/modules/3.2.0-31-generic/kernel/drivers/raw1394
theia@Theia:~$ sudo cp Phantom/raw1394Dummy/raw1394.ko /lib/modules/3.2.0-31-generic/kernel/drivers/raw1394/
and then
theia@Theia:~$ sudo depmod -a

and set permissions

theia@Theia:~$ sudo gedit /etc/rc.local

ln -s /dev/fw2 /dev/raw1394
chmod a+rw /dev/fw0
chmod a+rw /dev/fw1
chmod a+rw /dev/fw2
chmod a+rw /dev/raw1394


and lastly reboot.

Check loaded modules:

theia@Theia:~$ lsmod | grep -e 1394 -e fire
raw1394                12349  0 [permanent]
firewire_ohci          41000  0
firewire_core          63558  1 firewire_ohci
crc_itu_t              12707  1 firewire_core


By then, using PHANToMTest to test Phantom device, it can be working correctly.

But I found camera can't work correctly. The error messages using coriander:

libdc1394 warning: Could not open video1394 device file in /dev
libdc1394 error: Error: Failed to setup DMA capture
Failed to setup capture. Error code -1

The possible reason : 

There are two firewire systems running at the same time in my Ubuntu system:

One is raw1394.Another is the new stack (firewire*). Maybe this is the root of the error.

One interpretation from internet: http://comments.gmane.org/gmane.comp.multimedia.libdc1394.devel/620

Generally, if ohci1394 is bound to the controller(s) and firewire-ohci is loaded too, userspace clients won't have a problem because
firewire-core won't create any /dev/fw* file in the first place.

The other way around, i.e. firewire-ohci bound to the controller and ohci1394 loaded but doing nothing, fully works with libraw1394.  This is
because libraw1394 ignores /dev/raw1394 if it finds /dev/fw*.  But a quick test with coriander (current CVS) shows that either libdc1394 or
coriander has an issue if raw1394 is loaded while firewire-{ohci,core} are at the helm.  Coriander detects the camera but is subsequently
unable to start reception:
>>>
libdc1394 warning: Could not open video1394 device file in /dev
libdc1394 error: Error: Failed to setup DMA capture
Failed to setup capture. Error code -1
<<<

Check blacklist:

theia@Theia:~$ gedit /etc/modprobe.d/blacklist-firewire.conf

# Select the legacy firewire stack over the new CONFIG_FIREWIRE one.
blacklist ohci1394
blacklist sbp2
blacklist dv1394
blacklist raw1394
blacklist video1394
#blacklist firewire-ohci
#blacklist firewire-sbp2



One solution:

Cancel auto-load raw1394. Only require raw1394 (using phantom) , load this module:

sudo modprobe raw1394

sudo chmod a+rw /dev/fw2

And then, when using camera, only remove phantom is okay. From this point, I can still auto-load raw1394.  Correctly!!!
Notice: Every time after re-connect device, need set permission:
sudo chmod a+rw /dev/fw2

 
Unsolved question: how to use camera and phantom at the same time.
  评论这张
 
阅读(287)| 评论(3)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017