Device Drivers --> <*>Multimedia support -> <*> video for linux [*] enable vide for linux api 1
[*] video capture adapters ---> [*] V4L USB devices ---> <*> USB Video Class (UVC) [*] UVC input event device support
板子上電後~插上webcam出現以下訊息:
# usb 1-1: new full speed USB device using s3c2410-ohci and address 2 usb 1-1: configuration #1 chosen from 1 choice uvcvideo: Found UVC 1.00 device Microsoft� LifeCam HD-3000 (045e:0779) input: Microsoft� LifeCam HD-3000 as /class/input/input2 usb 1-1: New USB device found, idVendor=045e, idProduct=0779 usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 usb 1-1: Product: Microsoft� LifeCam HD-3000 usb 1-1: Manufacturer: Microsoft
這樣應該是表示有驅動成功了~~~
原本在/dev中有/dev/video0,/dev/video14 現在多了/dev/video2
但是在測試時,mjpg streamer一直找不到..........
# ls bin etc lib mjpg proc sys usr www dev home linuxrc mnt sbin tmp var # cd bin # mjpg_streamer ./mjpg_streamer -i "input_uvc.so -d /dev/video2" MJPG-streamer [1113]: starting application MJPG Streamer Version.: 2.0 MJPG-streamer [1113]: MJPG Streamer Version.: 2.0
ERROR: could not find input plugin MJPG-streamer [1113]: ERROR: could not find input plugin
Perhaps you want to adjust the search path with: MJPG-streamer [1113]: Perhaps you want to adjust the search path with:
dlopen: input_uvc.so: cannot open shared object file: No such file or directory MJPG-streamer [1113]: dlopen: input_uvc.so: cannot open shared object file: No such file or directory
dlopen: /mjpg/output_http.so: cannot open shared object file: No such file or directory MJPG-streamer [1155]: dlopen: /mjpg/output_http.so: cannot open shared object file: No such file or directory
我很確定我有把output_http.so放到/mjpg裡面~~怪怪~~居然找不到 # cd mjpg/ # ls input_gspcav1.so input_uvc.so output_file.so input_testpicture.so output_autofocus.so output_http.so
我如果單單用一個usb(例如Webcam or WIFI)這樣連接著開機~就沒問題~ 但如果用usb hub同時連接著兩個usb device(Webcam and WIFI)就會出現問題 需要在開機後拔掉再插一次,這樣系統才會抓到~ 細看開機訊息,發現以下的訊息: s3c2410-ohci s3c2410-ohci: S3C24XX OHCI s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1 s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000 usb usb1: configuration #1 chosen from 1 choice hub 1-0:1.0: USB hub found hub 1-0:1.0: 2 ports detected usb usb1: New USB device found, idVendor=1d6b, idProduct=0001 usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 usb usb1: Product: S3C24XX OHCI usb usb1: Manufacturer: Linux 2.6.27 ohci_hcd usb usb1: SerialNumber: s3c24xx Initializing USB Mass Storage driver... usb 1-1: new full speed USB device using s3c2410-ohci and address 2 usb 1-1: configuration #1 chosen from 1 choice hub 1-1:1.0: USB hub found hub 1-1:1.0: 4 ports detected usb 1-1: New USB device found, idVendor=05e3, idProduct=0608 usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0 usb 1-1: Product: USB2.0 Hub usb 1-1.2: new full speed USB device using s3c2410-ohci and address 3 usb 1-1.2: device descriptor read/64, error -110 usb 1-1.2: device descriptor read/64, error -110
jpeg_utils.c:27:21: error: jpeglib.h: No such file or directory jpeg_utils.c:35: error: field 'pub' has incomplete type jpeg_utils.c:37: error: expected specifier-qualifier-list before 'JOCTET' jpeg_utils.c:53: warning: return type defaults to 'int' jpeg_utils.c: In function 'METHODDEF': jpeg_utils.c:53: error: expected declaration specifiers before 'init_destination' jpeg_utils.c:70: error: expected declaration specifiers before 'METHODDEF' jpeg_utils.c:89: error: expected declaration specifiers before 'METHODDEF' jpeg_utils.c:105: error: expected declaration specifiers before 'GLOBAL' jpeg_utils.c:133: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
1.usb webcam為微軟HD-5000,修改kernel (2.6.29版) 打開 [*] video capture adapters ---> [*] V4L USB devices ---> <*> USB Video Class (UVC) [*] UVC input event device support
編譯重新燒寫後開機,插入webcam,出現下列訊息
[ 60.065095] usb 1-1: new full speed USB device using s3c2410-ohci and address 2 [ 60.227691] usb 1-1: New USB device found, idVendor=045e, idProduct=076d [ 60.228784] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 60.235929] usb 1-1: Product: Microsoft▒ LifeCam HD-5000 [ 60.241207] usb 1-1: Manufacturer: Microsoft [ 60.248872] usb 1-1: configuration #1 chosen from 1 choice [ 60.255877] uvcvideo: Found UVC 1.00 device Microsoft▒ LifeCam HD-5000 (045e:076d) [ 60.274234] input: Microsoft▒ LifeCam HD-5000 as /class/input/input2
[ 60.065095] usb 1-1: new full speed USB device using s3c2410-ohci and address 2 [ 60.227691] usb 1-1: New USB device found, idVendor=045e, idProduct=076d [ 60.228784] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 60.235929] usb 1-1: Product: Microsoft▒ LifeCam HD-5000 [ 60.241207] usb 1-1: Manufacturer: Microsoft [ 60.248872] usb 1-1: configuration #1 chosen from 1 choice [ 60.255877] uvcvideo: Found UVC 1.00 device Microsoft▒ LifeCam HD-5000 (045e:076d) [ 60.274234] input: Microsoft▒ LifeCam HD-5000 as /class/input/input2
一開始是這樣: input_uvc.c: In function 'input_init': input_uvc.c:307: warning: implicit declaration of function 'input_cmd' /usr/local/arm/4.3.1-eabi-armv6/usr/lib/crt1.o: In function `_start': init.c:(.text+0x30): undefined reference to `main' /tmp/ccy2AUwU.o: In function `cam_thread': input_uvc.c:(.text+0x8bc): undefined reference to `__pthread_register_cancel' input_uvc.c:(.text+0x9a8): undefined reference to `__pthread_unregister_cancel' /tmp/ccy2AUwU.o: In function `input_run': input_uvc.c:(.text+0xaf8): undefined reference to `pthread_create' input_uvc.c:(.text+0xb00): undefined reference to `pthread_detach' /tmp/ccy2AUwU.o: In function `input_stop': input_uvc.c:(.text+0xb6c): undefined reference to `pthread_cancel'
後來加上-pthread參數後重編,錯誤消失了,但又出現新錯誤: input_uvc.c: In function 'input_init': input_uvc.c:307: warning: implicit declaration of function 'input_cmd' /usr/local/arm/4.3.1-eabi-armv6/usr/lib/crt1.o: In function `_start': init.c:(.text+0x30): undefined reference to `main' collect2: ld returned 1 exit status make: *** [input_uvc.so] Error 1
.id = CONFIG_VIDEO_FIMC_CAM_CH,
.type = CAM_TYPE_ITU,
.mode = ITU_601_YCBCR422_8BIT,
.order422 = CAM_ORDER422_8BIT_YCBYCR,
.clockrate = 24000000,
.width = 640,
.height = 480,
其中應該是表示其output是YUB422~8bit的格式
hclk = 166500000
camera : request_irq(IRQ_CAMIF_C) fail !!!
insmod: cannot insert 'camera.ko': Input/output error (-1): Input/output error
# insmod camera.ko (重複再insmod一次)
camera : Can't get major 1001
insmod: cannot insert 'camera.ko': Device or resource busy (-1): Device or resource busy
retval = request_irq(IRQ_CAMIF_C, code_interrupt, IRQF_SAMPLE_RANDOM, "code_interrupt", NULL);
if (retval != 0)
{
printk("%s : request_irq(IRQ_CAMIF_C) fail !!!\n", CAMERADEV_NAME);
retval = -EIO;
goto err_map;
}
包括成功移植JPEG資料庫等,並把MJPG streamer執行檔拷貝到bin中~
其他的so檔copy到板子的mjpg folder裡面~
然後又去買了一個網路上有驗證成功的UVC Webcam:Microsoft HD3000
然後編譯kernel~讓他支援UVC選項:
Device Drivers -->
<*>Multimedia support ->
<*> video for linux
[*] enable vide for linux api 1
[*] video capture adapters --->
[*] V4L USB devices --->
<*> USB Video Class (UVC)
[*] UVC input event device support
板子上電後~插上webcam出現以下訊息:
# usb 1-1: new full speed USB device using s3c2410-ohci and address 2
usb 1-1: configuration #1 chosen from 1 choice
uvcvideo: Found UVC 1.00 device Microsoft� LifeCam HD-3000 (045e:0779)
input: Microsoft� LifeCam HD-3000 as /class/input/input2
usb 1-1: New USB device found, idVendor=045e, idProduct=0779
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1: Product: Microsoft� LifeCam HD-3000
usb 1-1: Manufacturer: Microsoft
這樣應該是表示有驅動成功了~~~
原本在/dev中有/dev/video0,/dev/video14
現在多了/dev/video2
但是在測試時,mjpg streamer一直找不到..........
# ls
bin etc lib mjpg proc sys usr www
dev home linuxrc mnt sbin tmp var
# cd bin
# mjpg_streamer ./mjpg_streamer -i "input_uvc.so -d /dev/video2" MJPG-streamer [1113]: starting application
MJPG Streamer Version.: 2.0
MJPG-streamer [1113]: MJPG Streamer Version.: 2.0
ERROR: could not find input plugin
MJPG-streamer [1113]: ERROR: could not find input plugin
Perhaps you want to adjust the search path with:
MJPG-streamer [1113]: Perhaps you want to adjust the search path with:
# export LD_LIBRARY_PATH=/path/to/plugin/folder
MJPG-streamer [1113]: # export LD_LIBRARY_PATH=/path/to/plugin/folder
dlopen: input_uvc.so: cannot open shared object file: No such file or directory
MJPG-streamer [1113]: dlopen: input_uvc.so: cannot open shared object file: No such file or directory
阿阿~~都依照google大神指示的在做~~怎會指定video2會找不到呢???
是不是還要弄V4l的架構???還是哪些地方有錯?
ERROR opening V4L interface: No such file or directory
Init v4L2 failed !! exit fatal
i: init_VideoIn failed
MJPG-streamer [1120]: init_VideoIn failed
慘~~這.........WHY??
但.......................................................沒錯~~~又有新問題了:
當我下命令:
./mjpg_streamer -i "/mjpg/input_uvc.so -d /dev/video2" -o "/mjpg/output_http.so -w /www"
會出現Error:
ERROR: could not find output plugin /mjpg/output_http.so
MJPG-streamer [1155]: ERROR: could not find output plugin /mjpg/output_http.so
Perhaps you want to adjust the search path with:
MJPG-streamer [1155]: Perhaps you want to adjust the search path with:
# export LD_LIBRARY_PATH=/path/to/plugin/folder
MJPG-streamer [1155]: # export LD_LIBRARY_PATH=/path/to/plugin/folder
dlopen: /mjpg/output_http.so: cannot open shared object file: No such file or directory
MJPG-streamer [1155]: dlopen: /mjpg/output_http.so: cannot open shared object file: No such file or directory
我很確定我有把output_http.so放到/mjpg裡面~~怪怪~~居然找不到
# cd mjpg/
# ls
input_gspcav1.so input_uvc.so output_file.so
input_testpicture.so output_autofocus.so output_http.so
看網路上~好像是關於WWW這個folder的問題~~~我的確沒有這個WWW資料夾
不知道是不是這個問題~~記得老師給的原始碼中~好像有看過這個資料夾~~
先研究一下~~
以下是完整的輸出資訊:
# mjpg_streamer -i "/mjpg/input_uvc.so -d /dev/video2" -o "/mjpg/output_http.so -w /www"
MJPG-streamer [1111]: starting application
MJPG Streamer Version.: 2.0
MJPG-streamer [1111]: MJPG Streamer Version.: 2.0
i: Using V4L2 device.: /dev/video2
MJPG-streamer [1111]: Using V4L2 device.: /dev/video2
i: Desired Resolution: 640 x 480
MJPG-streamer [1111]: Desired Resolution: 640 x 480
i: Frames Per Second.: 5
MJPG-streamer [1111]: Frames Per Second.: 5
i: Format............: MJPEG
MJPG-streamer [1111]: Format............: MJPEG
ERROR: could not find output plugin /mjpg/output_http.so
MJPG-streamer [1111]: ERROR: could not find output plugin /mjpg/output_http.so
Perhaps you want to adjust the search path with:
MJPG-streamer [1111]: Perhaps you want to adjust the search path with:
# export LD_LIBRARY_PATH=/path/to/plugin/folder
MJPG-streamer [1111]: # export LD_LIBRARY_PATH=/path/to/plugin/folder
dlopen: /mjpg/output_http.so: cannot open shared object file: No such file or directory
看樣子Webcam應該已經和mjpg streamer連上線了~format也是MJPG~好像快搞定了~
但是.....事情總是很多曲折..........
看樣子又有新問題~~但真的是不知道WHY~明明output_http.so跟上次input_uvc.so都放在同一個folder:/mjpg
# cd mjpg/
# ls
input_gspcav1.so input_uvc.so output_file.so
input_testpicture.so output_autofocus.so output_http.so
但是找得到/mjpg/input_uvc.so卻是找不到/mjpg/output_http.so???
我很確定我有把output_http.so放到/mjpg裡面~~怪怪~~居然找不到
我還執行了:export LD_LIBRARY_PATH=/mjpg
網路上說:如果提示找不到input_uvc.so或者output_http.so,那么就在其前面加上路径即可。
我也有在命令列上加上路徑~多管齊下~~就是找不到~怪怪~
剛剛研究了一下講義Toolchain~應該就是要讓系統找得到.so檔~
我命令列上加了路徑~也export LD_LIBRARY_PATH~不知道why系統就是找不到....???
目前WIFI的部份還算滿順利的~成功的編譯出.ko檔~
然後應該也成功的insmod到板子上:
# insmod rt5370sta.ko
rtusb init rt2870 --->
=== pAd = c6082000, size = 508568 ===
<-- RTMPAllocTxRxRingMemory, Status=0
<-- RTMPAllocAdapterBlock, Status=0
usbcore: registered new interface driver rt2870
# lsmod
Module Size Used by
rt5370sta 752680 0 - Live 0xbf000000
# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:E0:4A:BC:15:E7
inet addr:192.168.2.235 Bcast:192.168.2.255 Mask:255.255.255.0
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:1045 errors:0 dropped:0 overruns:0 frame:0
TX packets:1901 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:73540 (71.8 KiB) TX bytes:2423388 (2.3 MiB)
Interrupt:101 Base address:0x8300
gre0 Link encap:UNSPEC HWaddr 00-00-00-00-0D-40-64-09-00-00-00-00-00-00-00-00
NOARP MTU:1476 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:522 (522.0 B) TX bytes:522 (522.0 B)
ra0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
tunl0 Link encap:UNSPEC HWaddr 00-00-00-00-0D-40-64-09-00-00-00-00-00-00-00-00
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
# ifconfig ra0 up 192.168.2.235
(Efuse for 3062/3562/3572) Size=0x2d [2d0-2fc]
RTMP_TimerListAdd: add timer obj c60c9880!
RTMP_TimerListAdd: add timer obj c60c98ac!
RTMP_TimerListAdd: add timer obj c60c98d8!
RTMP_TimerListAdd: add timer obj c60c9854!
RTMP_TimerListAdd: add timer obj c60c97d0!
RTMP_TimerListAdd: add timer obj c60c97fc!
RTMP_TimerListAdd: add timer obj c6094414!
RTMP_TimerListAdd: add timer obj c6083d64!
RTMP_TimerListAdd: add timer obj c6083d98!
RTMP_TimerListAdd: add timer obj c60944ac!
RTMP_TimerListAdd: add timer obj c60943bc!
RTMP_TimerListAdd: add timer obj c609447c!
-->RTUSBVenderReset
<--RTUSBVenderReset
Key1Str is Invalid key length(0) or Type(0)
Key2Str is Invalid key length(0) or Type(0)
Key3Str is Invalid key length(0) or Type(0)
Key4Str is Invalid key length(0) or Type(0)
1. Phy Mode = 5
2. Phy Mode = 5
phy mode> Error! The chip does not support 5G band 5!
RTMPSetPhyMode: channel is out of range, use first channel=1
(Efuse for 3062/3562/3572) Size=0x2d [2d0-2fc]
3. Phy Mode = 9
AntCfgInit: primary/secondary ant 0/1
<7>hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0000
MCS Set = ff 00 00 00 01
<==== rt28xx_init, Status=0
0x1300 = 00064300
# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:522 (522.0 B) TX bytes:522 (522.0 B)
ra0 Link encap:Ethernet HWaddr 7C:DD:90:05:99:27
inet addr:192.168.2.235 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:68631 (67.0 KiB) TX bytes:10500 (10.2 KiB)
# iwlist ra0 scan
/bin/sh: iwlist: not found
網路上說這樣就算啟動成功~不過還是要確實偵測到網路訊號,然後ping得出去才算數,所以用了iwlist去作scan,好像沒這個指令~我猜想應該是busybox沒有選到~結果回到busybox選單中去找~沒找到~這個部份不知道我理解得對嗎?
剛裝了wireless_tools.29.tar.gz
解壓縮更改一下Makefile,make成功後
產生一些iwspy,iwpriv,iwlist以及iwconfig等等得文件,cp到bin後再把libiw.so.29 cp到lib,就可以用了
目前是iwlist scan可以掃描到,但是卻ping不出去~看來還是有些設定要研究一下~~~
# iwlist ra0 scan
===>rt_ioctl_giwscan. 12(12) BSS returned, data->length = 1684
ra0 Scan completed :
Cell 01 - Address: 34:08:04:99:0D:4A
Protocol:802.11b/g
ESSID:"HSU"
Mode:Managed
Frequency:2.412 GHz (Channel 1)
Quality=23/100 Signal level=-81 dBm Noise level=-76 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
Cell 02 - Address: 40:4A:03:6A:58:C0
Protocol:802.11b/g
ESSID:""
Mode:Managed
Frequency:2.417 GHz (Channel 2)
Quality=7/100 Signal level=-87 dBm Noise level=-95 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
# ping www.yahoo.com
ping: bad address 'www.yahoo.com'
# ping 98.139.127.62
PING 98.139.127.62 (98.139.127.62): 56 data bytes
ping: sendto: Network is unreachable
我如果單單用一個usb(例如Webcam or WIFI)這樣連接著開機~就沒問題~
但如果用usb hub同時連接著兩個usb device(Webcam and WIFI)就會出現問題
需要在開機後拔掉再插一次,這樣系統才會抓到~
細看開機訊息,發現以下的訊息:
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: S3C24XX OHCI
usb usb1: Manufacturer: Linux 2.6.27 ohci_hcd
usb usb1: SerialNumber: s3c24xx
Initializing USB Mass Storage driver...
usb 1-1: new full speed USB device using s3c2410-ohci and address 2
usb 1-1: configuration #1 chosen from 1 choice
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 1-1: Product: USB2.0 Hub
usb 1-1.2: new full speed USB device using s3c2410-ohci and address 3
usb 1-1.2: device descriptor read/64, error -110
usb 1-1.2: device descriptor read/64, error -110
請問這是說兩個有衝突之類的嗎?
如果是開機後在同時插兩個usb裝置就都沒問題,不知道開機前同時插這兩個usb裝置why會出現這些訊息?
另外,關於servo的部份,想請教在dc_motor.c中有一些function我都一直找不到在哪邊?
例如__raw_writel(tcmpb, S3C_TCMPB(0));
感覺這個function應該是關鍵..........這個function一直找不到在哪邊~
想說應該是在某一個lib中,但有些lib也是找不到~
例如:
#include <plat/regs-gpio.h>
#include <plat/gpio-cfg.h>
#include <plat/regs-clock.h>
#include <asm/uaccess.h>
#include <asm/io.h>
這些我在/work/kernel/linux-2.6.x的資料夾中都找不到說~~~
另外~我試著去驅動另外一顆輪子~
於是我在每一個__raw_writel(tcmpb, S3C_TCMPB(0));
我都在下面加了一行__raw_writel(tcmpb, S3C_TCMPB(1);
想說這樣雖然兩顆輪子會亂動~但至少會動~我再來微調~
我以為S3C_TCMPB(0)裡面的0與1應該是指pwm channel的意思~
但怎樣另外一個pwm就是不會動~感覺好像沒有被初始化~
是不是在static int __init dcm_init(void)這邊要加一些東西?
從Log上看來:
第1個紅色框框表示S3C24xx 的OHCI (USB 1.1)向 USB core註冊,
它的root hub共有2個port.
第2個紅色框框表示root hub偵測到有外部的hub (4個port)被attached.
usb 1-1.2: new full speed USB device using s3c2410-ohci and address 3
usb 1-1.2: device descriptor read/64, error -110
usb 1-1.2: device descriptor read/64, error -110
但接下來初步從上面的error message看來,host是要向address 3下get_descriptor的request command,但卻等不到資料而發生Timeout(error –110).
可以先確定一下在這樣的scenario下,當開機到這邊時HUB和其下的2個device都已處於ready狀態?
艾鍗學院講師-- kangta
不過~~問一個很笨的問題.......
請問開機對板子上電出現上述問題時,要如何確定HUB及其下的2個device都處於ready的狀態?
我想到的是用示波器量板子接HUB的1、4腳,看看電壓有沒有被拉下來~如果有~應該就是驅動能力不夠所致?
To Joseph老師:
servo的驅動寫好嚕!!.....可以向前,向後,向左,向右
只是說,很多東西其實都是一知半解,因為找不到一些function在哪邊,
所以其實不是很知道其原理,例如
__raw_writel(tcmpb, S3C_TCMPB(0));
argument 1: tcmpb在timer0是這樣,但在timer1要變四倍!!這是try and error出來的~
__raw_writel(tcmpb*4, S3C_TCMPB(1));
這樣兩個timer才會pulse寬度一致
所以就很想知道__raw_writel,S3C_TCMPB以及S3C_TCNTB等等,這些function內部是怎樣寫的~
可以的話,再請老師告知這些function是在那個資料夾下??
目前進度應該就剩下整合~
看了一下WWW資料夾~跟後端互動的好像在functions.js這個資料夾下~有用到AJAX語法等
這部份不知道老師那邊有無資源可利用?感恩感恩!
感恩感恩!希望星期天前可以順利完成!
但還是來請教一下把mpeg-streamer移植到長高6410的問題
將mpeg-streamer的各層Makefile檔的cc路徑都改成交叉編譯器的路徑後
make後會出問題:
jpeg_utils.c:27:21: error: jpeglib.h: No such file or directory
jpeg_utils.c:35: error: field 'pub' has incomplete type
jpeg_utils.c:37: error: expected specifier-qualifier-list before 'JOCTET'
jpeg_utils.c:53: warning: return type defaults to 'int'
jpeg_utils.c: In function 'METHODDEF':
jpeg_utils.c:53: error: expected declaration specifiers before 'init_destination'
jpeg_utils.c:70: error: expected declaration specifiers before 'METHODDEF'
jpeg_utils.c:89: error: expected declaration specifiers before 'METHODDEF'
jpeg_utils.c:105: error: expected declaration specifiers before 'GLOBAL'
jpeg_utils.c:133: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
我已經google過且試過所有可能的方法了...但怎樣就過不了這關
請高手求解了拜託
但還是沒辦法啟動mjpg_streamer
有些問題求教:
1.usb webcam為微軟HD-5000,修改kernel (2.6.29版) 打開
[*] video capture adapters --->
[*] V4L USB devices --->
<*> USB Video Class (UVC)
[*] UVC input event device support
編譯重新燒寫後開機,插入webcam,出現下列訊息
[ 60.065095] usb 1-1: new full speed USB device using s3c2410-ohci and address 2
[ 60.227691] usb 1-1: New USB device found, idVendor=045e, idProduct=076d
[ 60.228784] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 60.235929] usb 1-1: Product: Microsoft▒ LifeCam HD-5000
[ 60.241207] usb 1-1: Manufacturer: Microsoft
[ 60.248872] usb 1-1: configuration #1 chosen from 1 choice
[ 60.255877] uvcvideo: Found UVC 1.00 device Microsoft▒ LifeCam HD-5000 (045e:076d)
[ 60.274234] input: Microsoft▒ LifeCam HD-5000 as /class/input/input2
[ 63.493268] android_power: wakeup (0->0) at 63313240572 (2000-02-11 05:24:43.228028680 UTC)
[ 63.511348] init: untracked pid 2055 exited
[ 63.555947] init: untracked pid 1971 exited
[ 63.556132] init: untracked pid 2034 exited
[ 63.556306] init: untracked pid 2078 exited
[ 63.559235] init: untracked pid 2089 exited
[ 63.562197] init: untracked pid 2014 exited
[ 63.563773] init: untracked pid 1991 exited
[ 63.565268] init: untracked pid 2070 exited
[ 63.566859] init: untracked pid 2020 exited
[ 63.568682] init: untracked pid 2040 exited
[ 63.574767] init: untracked pid 1973 exited
[ 63.579277] init: untracked pid 1977 exited
[ 63.582104] init: untracked pid 1876 exited
[ 63.685484] gsensor : ------- gsensor_release() entered
[ 64.770550] IRQ 74/AC97 PCM Stereo out: IRQF_DISABLED is not guaranteed on shared IRQs
[ 99.870125] android_power: wakeup (0->0) at 99690101262 (2000-02-11 05:25:19.604889394 UTC)
[ 103.367306] android_power: wakeup (0->0) at 103187294679 (2000-02-11 05:25:23.102083075 UTC)
[ 103.372703] init: untracked pid 2171 exited
[ 104.495467] IRQ 74/AC97 PCM Stereo out: IRQF_DISABLED is not guaranteed on shared IRQs
然後6410開發板的LCD就沒法操控了,只剩下"android"字樣,要把WEBCAM拔掉才會回到android桌面,
請問這樣是正常的嗎?
ls /dev 只找的到video0和video1 沒有看到有新增/video2
是否代表webcam沒註冊成功?
[ 60.227691] usb 1-1: New USB device found, idVendor=045e, idProduct=076d
[ 60.228784] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 60.235929] usb 1-1: Product: Microsoft▒ LifeCam HD-5000
[ 60.241207] usb 1-1: Manufacturer: Microsoft
[ 60.248872] usb 1-1: configuration #1 chosen from 1 choice
[ 60.255877] uvcvideo: Found UVC 1.00 device Microsoft▒ LifeCam HD-5000 (045e:076d)
[ 60.274234] input: Microsoft▒ LifeCam HD-5000 as /class/input/input2
這樣插入WEBCAM就沒有出現那些訊息了
但執行mjpg-streamer-r63的時候還有一個問題
訊息如下
./mjpg_streame# # r -i "./input_uvc.so -f 30 -r 640x480" -o "./output_http.so -w ./www"
MJPG-streamer [1950]: starting application
MJPG Streamer Version.: 2.0
MJPG-streamer [1950]: MJPG Streamer Version.: 2.0
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 30
i: Format............: MJPEG
o: www-folder-path...: ./www/
o: HTTP TCP port.....: 8080
o: username:password.: disabled
o: commands..........: enabled
MJPG-streamer [1950]: starting input plugin
mjpg_streamer: symbol lookup error: ./input_uvc.so: undefined symbol: pthread_create
#
我有去檢查過input_uvc.c 和pthread.h 但還是不懂怎麼會有這個錯誤?
google過也沒有人有這問題,還請老師幫忙了 感謝
gcc toolchain版本:
arm-linux-gcc (for S3C64XX Samsung Electronics AP Development Team) 4.3.1
kernel版本: dma6410L-linux-2.6.29
mjpg-stremer版本: -r63
jpeglib版本:jpeg-8b
目標板: dma6410L
編譯用作業系統: ubuntu 12.04.4 32bit
1.我去我的toolchain資料夾內把所有有關於libpthread*的so檔都copy到目標板上了,LD_LIBRARY_PATH也指定了
可是還是一樣的錯誤訊息
2.有辦法把uvc_input.so編譯成靜態函式嗎?(我在想會不會是因為我的板子是使用android函式庫,所以一般linux程式完全不能執行,連cross compile個hello.c 都要加上-static才能在板子上執行..)
有試過在Makefile 的CC後面加上-static,把CFLAGS的-shared去掉
但還是會有問題
一開始是這樣:
input_uvc.c: In function 'input_init':
input_uvc.c:307: warning: implicit declaration of function 'input_cmd'
/usr/local/arm/4.3.1-eabi-armv6/usr/lib/crt1.o: In function `_start':
init.c:(.text+0x30): undefined reference to `main'
/tmp/ccy2AUwU.o: In function `cam_thread':
input_uvc.c:(.text+0x8bc): undefined reference to `__pthread_register_cancel'
input_uvc.c:(.text+0x9a8): undefined reference to `__pthread_unregister_cancel'
/tmp/ccy2AUwU.o: In function `input_run':
input_uvc.c:(.text+0xaf8): undefined reference to `pthread_create'
input_uvc.c:(.text+0xb00): undefined reference to `pthread_detach'
/tmp/ccy2AUwU.o: In function `input_stop':
input_uvc.c:(.text+0xb6c): undefined reference to `pthread_cancel'
後來加上-pthread參數後重編,錯誤消失了,但又出現新錯誤:
input_uvc.c: In function 'input_init':
input_uvc.c:307: warning: implicit declaration of function 'input_cmd'
/usr/local/arm/4.3.1-eabi-armv6/usr/lib/crt1.o: In function `_start':
init.c:(.text+0x30): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [input_uvc.so] Error 1
然後就無解了...如果真的再不成功可能就打算換板子了(至少raspberry pi可以正常使用mjpg-streamer)
(還是說可以重新移植有c函式庫的linux kernel到6410?)