I meant comment it<br><br><div class="gmail_quote">2012/7/31 Pierre-Hugues Husson <span dir="ltr"><<a href="mailto:phhusson@gmail.com" target="_blank">phhusson@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In capture.c, uncomment the define DISP_PREVIEW line<div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">2012/7/31 Hubert Liao <span dir="ltr"><<a href="mailto:liao.hubertt@gmail.com" target="_blank">liao.hubertt@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Tue, Jul 31, 2012 at 10:09 AM, Piyush Verma <<a href="mailto:piyush.pv@gmail.com" target="_blank">piyush.pv@gmail.com</a>> wrote:<br>
><br>
</div><div>> Could u try to run with strace then see where it stuck ?<br>
><br>
</div>>From strace output, the last system call is<br>
ioctl(6, 0x102, 0x1f1f0) = 0<br>
<br>
and the kernel print:<br>
[DISP WRN] file:drivers/video/sun4i/disp/de_bsp/de/disp_scaler.c,line:181:<br>
not supported type:0 in Scaler_sw_para_to_reg<br>
<br>
strace ./EncoderDemo >> EncoderDemo.strace<br>
execve("./EncoderDemo", ["./EncoderDemo"], [/* 20 vars */]) = 0<br>
brk(0) = 0x1e81000<br>
uname({sys="Linux", node="ubuntu", ...}) = 0<br>
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)<br>
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,<br>
0) = 0x40084000<br>
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)<br>
open("/etc/ld.so.cache", O_RDONLY) = 3<br>
fstat64(3, {st_mode=S_IFREG|0644, st_size=58764, ...}) = 0<br>
mmap2(NULL, 58764, PROT_READ, MAP_PRIVATE, 3, 0) = 0x400e9000<br>
close(3) = 0<br>
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)<br>
open("/usr/lib/libstdc++.so.6", O_RDONLY) = 3<br>
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\220t\4\0004\0\0\0"...,<br>
512) = 512<br>
fstat64(3, {st_mode=S_IFREG|0644, st_size=710388, ...}) = 0<br>
mmap2(NULL, 768792, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,<br>
0) = 0x401e8000<br>
mprotect(0x40291000, 32768, PROT_NONE) = 0<br>
mmap2(0x40299000, 20480, PROT_READ|PROT_WRITE,<br>
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa9) = 0x40299000<br>
mmap2(0x4029e000, 23320, PROT_READ|PROT_WRITE,<br>
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4029e000<br>
close(3) = 0<br>
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)<br>
open("/lib/libm.so.6", O_RDONLY) = 3<br>
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\3701\0\0004\0\0\0"...,<br>
512) = 512<br>
fstat64(3, {st_mode=S_IFREG|0644, st_size=407152, ...}) = 0<br>
mmap2(NULL, 438440, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,<br>
0) = 0x400f8000<br>
mprotect(0x4015b000, 28672, PROT_NONE) = 0<br>
mmap2(0x40162000, 8192, PROT_READ|PROT_WRITE,<br>
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x62) = 0x40162000<br>
close(3) = 0<br>
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)<br>
open("/lib/libgcc_s.so.1", O_RDONLY) = 3<br>
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\340+\0\0004\0\0\0"...,<br>
512) = 512<br>
fstat64(3, {st_mode=S_IFREG|0644, st_size=38572, ...}) = 0<br>
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,<br>
0) = 0x40062000<br>
mmap2(NULL, 69908, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,<br>
0) = 0x4008b000<br>
mprotect(0x40094000, 28672, PROT_NONE) = 0<br>
mmap2(0x4009b000, 8192, PROT_READ|PROT_WRITE,<br>
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8) = 0x4009b000<br>
close(3) = 0<br>
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)<br>
open("/lib/libpthread.so.0", O_RDONLY) = 3<br>
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\305B\0\0004\0\0\0"...,<br>
512) = 512<br>
fstat64(3, {st_mode=S_IFREG|0755, st_size=104536, ...}) = 0<br>
mmap2(NULL, 111136, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,<br>
0) = 0x400bb000<br>
mprotect(0x400cc000, 28672, PROT_NONE) = 0<br>
mmap2(0x400d3000, 8192, PROT_READ|PROT_WRITE,<br>
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10) = 0x400d3000<br>
mmap2(0x400d5000, 4640, PROT_READ|PROT_WRITE,<br>
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x400d5000<br>
close(3) = 0<br>
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)<br>
open("/lib/libc.so.6", O_RDONLY) = 3<br>
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0AU\1\0004\0\0\0"...,<br>
512) = 512<br>
fstat64(3, {st_mode=S_IFREG|0755, st_size=918976, ...}) = 0<br>
mmap2(NULL, 955668, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,<br>
0) = 0x402a4000<br>
mprotect(0x40380000, 32768, PROT_NONE) = 0<br>
mmap2(0x40388000, 12288, PROT_READ|PROT_WRITE,<br>
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xdc) = 0x40388000<br>
mmap2(0x4038b000, 9492, PROT_READ|PROT_WRITE,<br>
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4038b000<br>
close(3) = 0<br>
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,<br>
0) = 0x400e2000<br>
set_tls(0x400e24c0, 0xf0005, 0x400e2ba8, 0x400e24c0, 0x40089000) = 0<br>
mprotect(0x40388000, 8192, PROT_READ) = 0<br>
mprotect(0x400d3000, 4096, PROT_READ) = 0<br>
mprotect(0x4009b000, 4096, PROT_READ) = 0<br>
mprotect(0x40162000, 4096, PROT_READ) = 0<br>
mprotect(0x40299000, 12288, PROT_READ) = 0<br>
mprotect(0x1e000, 4096, PROT_READ) = 0<br>
mprotect(0x40088000, 4096, PROT_READ) = 0<br>
munmap(0x400e9000, 58764) = 0<br>
set_tid_address(0x400e2068) = 1081<br>
set_robust_list(0x400e2070, 0xc) = 0<br>
futex(0xbeda2c0c, FUTEX_WAKE_PRIVATE, 1) = 0<br>
futex(0xbeda2c0c, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1,<br>
NULL, 400d4000) = -1 EAGAIN (Resource temporarily unavailable)<br>
rt_sigaction(SIGRTMIN, {0x400bf221, [], SA_SIGINFO|0x4000000}, NULL, 8) = 0<br>
rt_sigaction(SIGRT_1, {0x400bf119, [],<br>
SA_RESTART|SA_SIGINFO|0x4000000}, NULL, 8) = 0<br>
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0<br>
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0<br>
brk(0) = 0x1e81000<br>
brk(0x1ea2000) = 0x1ea2000<br>
open("/dev/cedar_dev", O_RDWR) = 3<br>
ioctl(3, 0x101, 0x1e8100c) = 0<br>
mmap2(NULL, 2048, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0xdc8d8) = 0x40164000<br>
ioctl(3, 0x200, 0) = 0<br>
ioctl(3, FDGETPRM, 0) = 0<br>
ioctl(3, 0x203, 0) = 0<br>
open("/dev/cedar_dev", O_RDWR) = 4<br>
ioctl(4, 0x101, 0x1e8103c) = 0<br>
open("/dev/video0", O_RDWR|O_NONBLOCK) = 5<br>
ioctl(5, VIDIOC_QUERYCAP or VT_OPENQRY, 0xbeda29bc) = 0<br>
ioctl(5, VIDIOC_S_FMT or VT_RELDISP, 0xbeda28f0) = -1 EINVAL (Invalid argument)<br>
ioctl(5, VIDIOC_REQBUFS or VT_DISALLOCATE, 0xbeda28d8) = 0<br>
ioctl(5, VIDIOC_QUERYBUF or VT_RESIZE, 0xbeda2894) = 0<br>
mmap2(NULL, 614400, PROT_READ|PROT_WRITE, MAP_SHARED, 5, 0) = 0x4038e000<br>
ioctl(5, VIDIOC_QUERYBUF or VT_RESIZE, 0xbeda2894) = 0<br>
mmap2(NULL, 614400, PROT_READ|PROT_WRITE, MAP_SHARED, 5, 0x96) = 0x4050f000<br>
ioctl(5, VIDIOC_QUERYBUF or VT_RESIZE, 0xbeda2894) = 0<br>
mmap2(NULL, 614400, PROT_READ|PROT_WRITE, MAP_SHARED, 5, 0x12c) = 0x405f0000<br>
ioctl(5, VIDIOC_QUERYBUF or VT_RESIZE, 0xbeda2894) = 0<br>
mmap2(NULL, 614400, PROT_READ|PROT_WRITE, MAP_SHARED, 5, 0x1c2) = 0x4072b000<br>
ioctl(5, VIDIOC_QBUF, 0xbeda2850) = 0<br>
ioctl(5, VIDIOC_QBUF, 0xbeda2850) = 0<br>
ioctl(5, VIDIOC_QBUF, 0xbeda2850) = 0<br>
ioctl(5, VIDIOC_QBUF, 0xbeda2850) = 0<br>
fstat64(1, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0<br>
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,<br>
0) = 0x408bd000<br>
open("/dev/disp", O_RDWR) = 6<br>
ioctl(6, 0x140, 0x1f1f0) = 0<br>
ioctl(6, 0x40, 0x1f1f0) = 101<br>
ioctl(6, 0x4a, 0x1f1f0) = 0<br>
ioctl(6, 0x42, 0x1f1f0) = 0<br>
open("/dev/fb0", O_RDWR) = 7<br>
ioctl(7, 0x4700, 0xbeda2828) = 0<br>
mmap2(NULL, 925696, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,<br>
-1, 0) = 0x40958000<br>
write(7, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"...,<br>
921600) = 921600<br>
close(7) = 0<br>
ioctl(6, 0x57, 0x1f1f0) = 0<br>
ioctl(6, 0x100, 0x1f1f0) = 0<br>
ioctl(3, 0x103, 0) = 0<br>
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0xc4000) = 0x40aa8000<br>
mmap2(NULL, 471040, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0xc4800) = 0x41319000<br>
mmap2(NULL, 471040, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0xc4873) = 0x41484000<br>
mmap2(NULL, 81920, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0xc48e6) = 0x41576000<br>
mmap2(NULL, 81920, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0xc48fa) = 0x41663000<br>
mmap2(NULL, 1280, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0xc490e) = 0x41739000<br>
open("h264.buf", O_RDWR|O_CREAT|O_TRUNC, 0666) = 7<br>
ioctl(5, VIDIOC_STREAMON, 0xbeda2a20) = 0<br>
gettimeofday({1343744285, 681708}, NULL) = 0<br>
gettimeofday({1343744285, 695660}, NULL) = 0<br>
select(6, [5], NULL, NULL, {2, 0}) = 1 (in [5], left {1, 532811})<br>
ioctl(5, VIDIOC_DQBUF, 0xbeda2900) = 0<br>
ioctl(6, 0x102, 0x1f1f0) = 0<br>
<div><div><br>
> On Tue, Jul 31, 2012 at 3:07 AM, Hubert Liao <<a href="mailto:liao.hubertt@gmail.com" target="_blank">liao.hubertt@gmail.com</a>> wrote:<br>
>><br>
>> Hi:<br>
>><br>
>> I got the video source code from<br>
>> <a href="https://github.com/amery/allwinner-a10-video" target="_blank">https://github.com/amery/allwinner-a10-video</a>,<br>
>> and try the EncoderDemo on Mele A1000 with a usb webcam, when I run it,<br>
>> the<br>
>> output file h264.buf size is always 0.<br>
>><br>
>> ./EncoderDemo<br>
>> w: 640, h: 480, preview_left: 80, preview_top: 0, preview_h: 480,<br>
>> preview_w : 640<br>
>> video layer hdl:101<br>
>> MODE: 2, format: 13<br>
>> fb_layer hdl: 100<br>
>> open H264Enc ok<br>
>> to stream on<br>
>> V4L2Camera::v4l2StartStreaming<br>
>> V4L2Camera::v4l2StartStreaming OK<br>
>> cru: 1586005820, last: 1586005799, 21<br>
>> VIDIOC_DQBUF id: 0<br>
>><br>
>> I found it stop at<br>
>> g_pCedarV->encode(g_pCedarV);<br>
>> in the while(1) loop, main.c line 139<br>
>><br>
>> lack of the encode library source code, so I can not find the real stuck<br>
>> point<br>
>> using gdb, maybe it stop at InitSPS @H264enclib.c<br>
>><br>
>> (gdb) r<br>
>> Starting program:<br>
>><br>
>> /root/Downloads/amery-allwinner-a10-video-9fa91df/a10_h264_encode/EncoderDemo<br>
>> [Thread debugging using libthread_db enabled]<br>
>> w: 640, h: 480, preview_left: 80, preview_top: 0, preview_h: 480,<br>
>> preview_w : 640<br>
>> video layer hdl:101<br>
>> MODE: 2, format: 13<br>
>> fb_layer hdl: 100<br>
>> open H264Enc ok<br>
>> to stream on<br>
>> V4L2Camera::v4l2StartStreaming<br>
>> V4L2Camera::v4l2StartStreaming OK<br>
>> cru: -1547703669, last: -1547703690, 21<br>
>> VIDIOC_DQBUF id: 0<br>
>> ^C<br>
>> Program received signal SIGINT, Interrupt.<br>
>> 0x0000d4c0 in InitSPS (pDev=0x21090) at F20/H264encLib.c:81<br>
>> 81 F20/H264encLib.c: No such file or directory.<br>
>> in F20/H264encLib.c<br>
>> (gdb) bt<br>
>> #0 0x0000d4c0 in InitSPS (pDev=0x21090) at F20/H264encLib.c:81<br>
>> #1 0x0000c1fc in H264EncEncode (pDev=0x21090) at F20/H264encDrv.c:843<br>
>> #2 0x0000a4dc in main () at main.c:139<br>
>><br>
>> Any help ? Thanks!<br>
>><br>
>> _______________________________________________<br>
>> arm-netbook mailing list <a href="mailto:arm-netbook@lists.phcomp.co.uk" target="_blank">arm-netbook@lists.phcomp.co.uk</a><br>
>> <a href="http://lists.phcomp.co.uk/mailman/listinfo/arm-netbook" target="_blank">http://lists.phcomp.co.uk/mailman/listinfo/arm-netbook</a><br>
>> Send large attachments to <a href="mailto:arm-netbook@files.phcomp.co.uk" target="_blank">arm-netbook@files.phcomp.co.uk</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Thanks & Regards<br>
><br>
> Piyush Verma<br>
><br>
><br>
><br>
> _______________________________________________<br>
> arm-netbook mailing list <a href="mailto:arm-netbook@lists.phcomp.co.uk" target="_blank">arm-netbook@lists.phcomp.co.uk</a><br>
> <a href="http://lists.phcomp.co.uk/mailman/listinfo/arm-netbook" target="_blank">http://lists.phcomp.co.uk/mailman/listinfo/arm-netbook</a><br>
> Send large attachments to <a href="mailto:arm-netbook@files.phcomp.co.uk" target="_blank">arm-netbook@files.phcomp.co.uk</a><br>
<br>
_______________________________________________<br>
arm-netbook mailing list <a href="mailto:arm-netbook@lists.phcomp.co.uk" target="_blank">arm-netbook@lists.phcomp.co.uk</a><br>
<a href="http://lists.phcomp.co.uk/mailman/listinfo/arm-netbook" target="_blank">http://lists.phcomp.co.uk/mailman/listinfo/arm-netbook</a><br>
Send large attachments to <a href="mailto:arm-netbook@files.phcomp.co.uk" target="_blank">arm-netbook@files.phcomp.co.uk</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>