基于视频采集卡驱动的错误修改CX26828
基于視頻采集卡驅(qū)動(dòng)的錯(cuò)誤修改CX26828
?
1、 設(shè)置root密碼
command:sudo passwd root?
?
2、查看系統(tǒng)狀態(tài)
? 輸入命令:lsmod
?root@ubuntu:/home/yu# lsmod
iroot@yu-desktop:/home/yu# lsmod
Module?????????????????Size? Used by
cx26828???????????????75734? 0
videodev??????????????86588? 1 cx26828
videobuf_dma_sg???????18786? 1 cx26828
videobuf_core?????????25409? 2 cx26828,videobuf_dma_sg
btcx_risc?????????????13400? 1 cx26828
nls_iso8859_1?????????12617? 0
?
3、卸載cx26828
如有上述信息可以看到有cx26828,執(zhí)行命令 rmmod cx26828
如運(yùn)行這個(gè)命令不能卸載就關(guān)閉機(jī)器把采集卡拔掉先安裝好驅(qū)動(dòng)再插上
?
4、 安裝驅(qū)動(dòng)
?進(jìn)入驅(qū)動(dòng)安裝目錄運(yùn)行:make install
成功后運(yùn)行 make load
注意這兒會(huì)出錯(cuò):
使用make install時(shí)會(huì)成功:
但執(zhí)行make load的時(shí)候出錯(cuò)誤:
然后執(zhí)行make也出錯(cuò):
修改方法:
1、由于缺少btcx-risc.h頭文件(該頭文件為內(nèi)核里面的找出來)
將下面代碼復(fù)制到btcx-risc.h文件中
structbtcx_riscmem {
unsignedint?? size;
__le32???????? *cpu;
?__le32????????*jmp;
??? dma_addr_t???? dma;
};
?
structbtcx_skiplist {
??? int start;
?? int end;
};
?
int? btcx_riscmem_alloc(struct pci_dev *pci,
??????????? struct btcx_riscmem *risc,
??????????? unsigned int size);
?
void btcx_riscmem_free(struct pci_dev *pci, structbtcx_riscmem *risc);
int btcx_screen_clips(int swidth, int sheight, structv4l2_rect *win,struct v4l2_clip *clips, unsigned int n);
int btcx_align(struct v4l2_rect *win, struct v4l2_clip*clips,unsigned int n, int mask);
voidbtcx_sort_clips(struct v4l2_clip *clips, unsigned int nclips);
void btcx_calc_skips(int line, int width, int*maxy,struct btcx_skiplist *skips, unsigned int *nskips,const struct v4l2_clip*clips, unsigned int nclips);
2、再執(zhí)行make,cx26828-core.c程序出現(xiàn)錯(cuò)誤
修改:
<1>去掉程序中711行的?_devinit
<2>驅(qū)動(dòng)程序中793行的? _devinit
<3>注銷掉878行? //.remove = __devexit_p(cx26828_finidev)
3、修改完后再make
成功編譯出模塊cx26828.ko文件
4、執(zhí)行make install
5、執(zhí)行make
6、查看是否插入到內(nèi)核中l(wèi)smod
7、使用ls /dev/video+table出現(xiàn)
?
總結(jié)
以上是生活随笔為你收集整理的基于视频采集卡驱动的错误修改CX26828的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 小程序 百度地图获取当前经纬度
- 下一篇: 反编译Delphi软件DEDE的使用