2008-06-20 08:35:10 BF561 EZ-Kit Lite and ffmpeg
Thomas Langås (NORWAY)
Message: 57630
Hi!
I'm having some various issues with ffmpeg, and getting it to run on the BF561 EZ-Kit. First of all, there's a compilation-issue when trying to compile trunk of uclinux with ffmpeg using the below gcc-version.
$ bfin-uclinux-gcc -v
Using built-in specs.
Target: bfin-uclinux
Configured with: /home/tlan/src/external/blackfin_toolchain/trunk/gcc-4.1/configure
--build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu
--target=bfin-uclinux --prefix=/home/tlan/builds/output-uclinux
--enable-threads=posix
--with-sysroot=/home/tlan/builds/output-uclinux/bfin-uclinux/runtime
--disable-libstdcxx-pch --disable-symvers --disable-libssp --disable-libffi
--enable-clocale=generic --enable-version-specific-runtime-libs
--enable-__cxa_atexit Thread model: posix
gcc version 4.1.2 (ADI svn)
From build-output:
../ffmpeg-svn-11114/configure \
--prefix=/usr \
--source-path=$PWD/../ffmpeg-svn-11114 \
--target-os=Linux \
--cpu=bfin \
--arch=bfin \
--extra-ldflags=" -Wl,-elf2flt -mcpu=bf561-0.3" \
--enable-static \
--enable-gpl \
--enable-pp \
--disable-strip \
--cross-compile \
--cross-prefix=bfin-uclinux-
bfin-uclinux-gcc is unable to create an executable file.
C compiler test failed.
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.
make[3]: *** [build/Makefile] Error 1
make[3]: Leaving directory `/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg'
make[2]: *** [ffmpeg] Error 2
make[2]: Leaving directory `/home/tlan/src/external/uClinux_for_blackfin/trunk/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/tlan/src/external/uClinux_for_blackfin/trunk/lib'
make: *** [subdirs] Error 1
config.err:
check_cc
BEGIN /tmp/ffmpeg-conf--31021-.c
1 int main(void){
2 return 0;
3 }
END /tmp/ffmpeg-conf--31021-.c
bfin-uclinux-gcc -pipe -Wall -g -O2 -mcpu=bf561-0.3 -fomit-frame-pointer -mfdpic -c -o /tmp/ffmpeg-conf--31021-.o /tmp/ffmpeg-conf--31021-.c
/tmp/ffmpeg-conf--31021-.c:1: error: -mfdpic is not supported, please use a bfin-linux-uclibc target
C compiler test failed.
If I change the configure-script and remove the -mfdpic flag, I get this far in the build-process (the Makefile is changed, as reflected above, I've removed --enable-shared, because that gives an error about ID of shared libraries not given):
bfin-uclinux-gcc -L"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavdevice -L"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavformat -L"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavcodec -L"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavutil -Wl,-elf2flt -mcpu=bf561-0.3 -Wl,-elf2flt -mcpu=bf561-0.3 -Wl,--warn-common -Wl,-rpath-link,"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavcodec -Wl,-rpath-link,"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavformat -Wl,-rpath-link,"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavutil -g -o ffmpeg_g ffmpeg.o cmdutils.o -lavdevice -lavformat -lavcodec -lavutil -lz -lm
bfin-uclinux-gcc -L"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavdevice -L"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavformat -L"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavcodec -L"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavutil -Wl,-elf2flt -mcpu=bf561-0.3 -Wl,-elf2flt -mcpu=bf561-0.3 -Wl,--warn-common -Wl,-rpath-link,"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavcodec -Wl,-rpath-link,"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavformat -Wl,-rpath-link,"/home/tlan/src/external/uClinux_for_blackfin/trunk/lib/ffmpeg/build"/libavutil -g -Wl,-E -o ffserver ffserver.o cmdutils.o -lavdevice -lavformat -lavcodec -lavutil -lz -lm
/home/tlan/builds/from_trunk/blackfin-20080527-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.2/../../../../bfin-uclinux/bin/ld.real: section .l1.text [0000000000000000 -> 0000000000000dcf] overlaps section .text [0000000000000000 -> 00000000002dee7f]
/home/tlan/builds/from_trunk/blackfin-20080527-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.2/../../../../bfin-uclinux/bin/ld.real: ffserver.gdb: section .text lma 0x0 overlaps previous sections
collect2: ld returned 1 exit status
make[4]: *** [ffserver] Error 1
make[4]: *** Waiting for unfinished jobs....
/home/tlan/builds/from_trunk/blackfin-20080527-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.2/../../../../bfin-uclinux/bin/ld.real: section .l1.text [0000000000000000 -> 0000000000000dcf] overlaps section .text [0000000000000000 -> 00000000002e167f]
/home/tlan/builds/from_trunk/blackfin-20080527-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.2/../../../../bfin-uclinux/bin/ld.real: ffmpeg_g.gdb: section .text lma 0x0 overlaps previous sections
collect2: ld returned 1 exit status
make[4]: *** [ffmpeg_g] Error 1
If I choose to compile ffmpeg from ffmpeg svn, I get it up and running on my platform, but I get an error before getting any output data. This error crashes the platform:
root:/> ffmpeg -v 2 -r 20 -f video4linux -s 320x200 -i /dev/video0 -an -f avi /var/tmp/test.avi
FFmpeg version SVN-r13644, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-cross-compile --arch=bfin --cross-prefix=bfin-uclinux- i-2xcr--addaapst-elr- li22lc -m0p:= fs6e-n.d b-yitaels-:n oeersr-odrs b-e dbcadirs --disable-demuxers --disable-muxers --disable-parsers --disable-bsfs --disable-protocols --enable-decoder=rawvideo --enable-encoder=rawvideo --enable-encoder=mpeg4 --enable-encoder=mpeg2video --enable-muxer=avi --enable-muxer=mp4 --enable-muxer=mpeg2video --enable-parser=mpeg4video --enable-protocol=file --enable-protocol=http --enable-protocol=tcp --enable-protocol=pipe --enable-protocol=rtp --enable-protocol=tcp --enable-protocol=udp --disable-stripping
libavutil version: 49.7.0
libavcodec version: 51.57.1
libavformat version: 52.14.0
libavdevice version: 52.0.0
built on Jun 20 2008 09:47:41, gcc: 4.1.2 (ADI svn)
lout.
i2c-adapter i2c-0: sendbytes: error - bailout.
i2c-adapter i2c-0: sendbytes: error - bailout.
i2c-adapter i2c-0: sendbytes: error - bailout.
i2c-adapter i2c-0: sendbytes: error - bailout.
i2c-adapter i2c-0: sendbytes: error - bailout.
Input #0, video4linux, from '/dev/video0':
Duration: N/A, start: 1167609691.020000, bitrate: 10240 kb/s
Stream #0.0, 1/1000000: Video: rawvideo, gray, 320x200, 1/20, 10240 kb/s, 20.00 tb(r)
Output #0, avi, to '/var/tmp/test.avi':
Stream #0.0, 1/90000: Video: mpeg4, yuv420p, 320x200, 1/20, q=2-31, 200 kb/s, 20.00 tb(c)
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
Allocation of length 36073472 from process 190 failed
DMA per-cpu:
CPU 0: Hot: hi: 18, btch: 3 usd: 11 Cold: hi: 6, btch: 1 usd: 0
Active:120 inactive:1668 dirty:0 writeback:0 unstable:0
free:7556 slab:481 mapped:0 pagetables:0 bounce:0
DMA free:30224kB min:952kB low:1188kB high:1428kB active:480kB inactive:6672kB present:56896kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 2*4kB 1*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 1*512kB 1*1024kB 0*2048kB 1*4096kB 1*8192kB 1*16384kB 0*32768kB = 30224kB
Allocation of length 36073472 from process 190 failed
DMA per-cpu:
CPU 0: Hot: hi: 18, btch: 3 usd: 10 Cold: hi: 6, btch: 1 usd: 0
Active:120 inactive:1668 dirty:0 writeback:0 unstable:0
free:7556 slab:481 mapped:0 pagetables:0 bounce:0
DMA free:30224kB min:952kB low:1188kB high:1428kB active:480kB inactive:6672kB present:56896kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 2*4kB 1*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 1*512kB 1*1024kB 0*2048kB 1*4096kB 1*8192kB 1*16384kB 0*32768kB = 30224kB
av_Jnuemlpa et_or tN_UrLmL( address
Deferred Exception context
CURRENT PROCESS:
COMM=ffmpeg PID=190
TEXT = 0x02000040-0x02174e60 DATA = 0x02174e64-0x0218e984
BSS = 0x0218e984-0x02267084 USER-STACK = 0x02268ec4
return address: [0x00000008]; contents of:
SEQUENCER STATUS: Not tainted
SEQSTAT: 0006002d IPEND: 0030 SYSCFG: 0006
HWERRCAUSE: 0x18
EXCAUSE : 0x2d
RETE: <0x00000000> /* Maybe null pointer? */
RETN: <0x00ee4000> /* unknown address */
RETX: <0x00000480> /* Maybe fixed code section */
RETS: <0x02170e08> [ ffmpeg + 0x170dc8 ]
PC : <0x00000008> /* Maybe null pointer? */
DCPLB_FAULT_ADDR: <0x02266a24> [ ffmpeg + 0x266a24 ]
ICPLB_FAULT_ADDR: <0x00000008> /* Maybe null pointer? */
PROCESSOR STATE:
R0 : 00000001 R1 : 02170ee8 R2 : 0218e850 R3 : 00a75f7c
R4 : 00000000 R5 : 00000001 R6 : 00000001 R7 : 02267b48
P0 : 00a6afc0 P1 : 00a75f70 P2 : 00000008 P3 : 0218ecd4
P4 : 0218e9a4 P5 : 0218ebe4 FP : 02267b58 SP : 00ee3f24
LB0: 0216e401 LT0: 0216e3fe LC0: 00000000
LB1: 0216d499 LT1: 0216d498 LC1: 00000000
B0 : 0323c2c0 L0 : 00000000 M0 : 00000006 I0 : 00001628
B1 : 00000003 L1 : 00000000 M1 : 000000ac I1 : 00000000
B2 : 0218e394 L2 : 00000000 M2 : 00000003 I2 : 00001628
B3 : 0218e380 L3 : 00000000 M3 : 00000008 I3 : 00000000
A0.w: 00000000 A0.x: 00000000 A1.w: 00000000 A1.x: 00000000
USP : 02267b3c ASTAT: 02003004
Hardware Trace:
0 Target : <0x008035d8> { _trap_c + 0x0 }
Source : <0xffa006e0> { _exception_to_level5 + 0x9c }
1 Target : <0xffa00644> { _exception_to_level5 + 0x0 }
Source : <0xffa0059e> { _ex_trap_c + 0x72 }
2 Target : <0xffa0052c> { _ex_trap_c + 0x0 }
Source : <0xffa00768> { _trap + 0x28 }
3 Target : <0xffa00740> { _trap + 0x0 }
Source : <0x02170e06> [ ffmpeg + 0x170dc6 ]
4 Target : <0x02170df6> [ ffmpeg + 0x170db6 ]
Source : <0x02170ef4> [ ffmpeg + 0x170eb4 ]
5 Target : <0x02170ee8> [ ffmpeg + 0x170ea8 ]
Source : <0x02170df4> [ ffmpeg + 0x170db4 ]
6 Target : <0x02170de4> [ ffmpeg + 0x170da4 ]
Source : <0x02170f04> [ ffmpeg + 0x170ec4 ]
7 Target : <0x02170ef8> [ ffmpeg + 0x170eb8 ]
Source : <0x02170de2> [ ffmpeg + 0x170da2 ]
8 Target : <0x02170dbc> [ ffmpeg + 0x170d7c ]
Source : <0x02000b40> [ ffmpeg + 0xb00 ]
9 Target : <0x02000b3e> [ ffmpeg + 0xafe ]
Source : <0x02000b1c> [ ffmpeg + 0xadc ]
10 Target : <0x02000b10> [ ffmpeg + 0xad0 ]
Source : <0x021627c4> [ ffmpeg + 0x162784 ]
11 Target : <0x021627c4> [ ffmpeg + 0x162784 ]
Source : <0x021627be> [ ffmpeg + 0x16277e ]
12 Target : <0x021627bc> [ ffmpeg + 0x16277c ]
Source : <0x02000b0c> [ ffmpeg + 0xacc ]
13 Target : <0x02000b02> [ ffmpeg + 0xac2 ]
Source : <0x021627c4> [ ffmpeg + 0x162784 ]
14 Target : <0x021627c4> [ ffmpeg + 0x162784 ]
Source : <0x021627be> [ ffmpeg + 0x16277e ]
15 Target : <0x021627bc> [ ffmpeg + 0x16277c ]
Source : <0x02000afe> [ ffmpeg + 0xabe ]
Stack from 00ee3f04:
00000006 ffa006e4 ffa00c44 02267b48 0000ffff 00bf9f7c 00000000 0216b55e
00000480 00000030 0006002d 00000000 00ee4000 00000480 00000008 02170e08
00000001 02003004 0216d499 0216e401 0216d498 0216e3fe 00000000 00000000
00000000 00000000 00000000 00000000 0218e380 0218e394 00000003 0323c2c0
00000000 00000000 00000000 00000000 00000008 00000003 000000ac 00000006
00000000 00001628 00000000 00001628 02267b3c 02267b58 0218ebe4 0218e9a4
Call Trace:
: Error while opening file
SIGSEGV
:/>
(I can use /mnt/test.avi instead of /var/tmp/test.avi with the same error, the failing allocation length varies from each run)
--
Thomas
QuoteReplyEditDelete
2008-06-20 09:08:50 Re: BF561 EZ-Kit Lite and ffmpeg
Mike Frysinger (UNITED STATES)
Message: 57631
as the errors indicate, ffmpeg does not work with FLAT ... build it as FDPIC
it's making ffmpeg allocate a 36meg contigious chunk of memory, and that isnt going to work
QuoteReplyEditDelete
2008-06-20 10:07:24 Re: BF561 EZ-Kit Lite and ffmpeg
Thomas Langås (NORWAY)
Message: 57632
And I do that by just removing -Wl,-elf2flt in the --extra-ldflags, right? (the -mfdpic-option isn't available with the gcc-version I'm using)
--
Thomas
QuoteReplyEditDelete
2008-06-20 11:32:23 Re: BF561 EZ-Kit Lite and ffmpeg
Mike Frysinger (UNITED STATES)
Message: 57633
http://docs.blackfin.uclinux.org/doku.php?id=toolchain:executable_file_formats