2008-07-29 02:43:17 ffmpeg run error
zhechong yuan (CHINA)
Message: 59506
I use ffmpeg library in BF531.
The kernel is 2008R1-RC2.
when i run the ffmpeg, some error is below:
//////////////////////////////////////////////
root:/proc> ffmpeg
ffmpeg:561: L1 allocation failed
ffmpeg:582: can't map '/usr/lib/libavcodec.so.51'
ffmpeg:561: L1 allocation failed
ffmpeg:582: can't map '/usr/lib/libavcodec.so.51'
ffmpeg: can't load library 'libavcodec.so.51'
//////////////////////////////////////////////
what's the meaning of 'L1 allocation failed' ?
the /proc/sram is below:
//////////////////////////////////////////
root:/proc> cat sram
--- L1 Scratchpad Size PID State
ffb00000-ffb00008 8 0 ALLOCATED
ffb00008-ffb01000 4088 0 FREE
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
--- L1 Instruction Size PID State
ffa09f10-ffa0c000 8432 0 FREE
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
///////////////////////////////////////
what can i do for solve the problem?
thanks!
TranslateQuoteReplyEditDelete
2008-07-29 02:58:01 Re: ffmpeg run error
Mike Frysinger (UNITED STATES)
Message: 59509
ffmpeg uses L1 data which you dont have ... you'll have to edit the source code in the meantime
QuoteReplyEditDelete
2008-07-29 02:59:32 Re: ffmpeg run error
Yi Li (CHINA)
Message: 59510
BF531 does not L1 BankB data SRAM, while ffmpeg tries to put some data in bank B.
This is a known toolchain bug (and will be fixed in the future), since gcc should report error when compiling.
But if you want to use ffmpeg in BF531, you need to modify ffmpeg code, in "uclinux-dist/lib/ffmpeg/ffmpeg-svn-11114/libavcodec/bfin/", and do not use l1.data.B.
QuoteReplyEditDelete
2008-07-29 03:02:43 Re: ffmpeg run error
Yi Li (CHINA)
Message: 59512
I've add a bug for ffmpeg to track it. Hope ffmpeg can handle the case of BF531 correctly.
QuoteReplyEditDelete
2008-07-29 03:40:56 Re: ffmpeg run error
zhechong yuan (CHINA)
Message: 59515
Li Yi, thanks for your help. i will try it!
TranslateQuoteReplyEditDelete
2008-07-29 13:53:19 Re: ffmpeg run error
Cameron Barfield (UNITED STATES)
Message: 59564
I get the same error on a BF536. Is that to be expected?
Edit:
Just found this thread: blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&forum_id=39&thread_id=23266&_forum_action=ForumMessageBrowse
QuoteReplyEditDelete
2008-07-29 16:03:38 Re: ffmpeg run error
Robin Getz (UNITED STATES)
Message: 59569
Cameron:
Yes - this is expected. - 536 does not have the same amount of L1 on it.
-Robin
QuoteReplyEditDelete
2008-07-29 23:27:19 Re: ffmpeg run error
zhechong yuan (CHINA)
Message: 59574
i turn off d_cache and modify "l1.data.B" to "1l.data.A", then ffmpeg work all right. anyone have better methord?
TranslateQuoteReplyEditDelete
2008-10-21 05:18:45 Re: ffmpeg run error
Jun Ai (CHINA)
Message: 63985
hi, I get the same error, I only change code "l1.data.A" instead of "l1.data.B", but it fails still. how to closed "d_cache"
the document tell me these:
Customise Kernel Settings
Device Drivers
Network Device Support
Ethernet (10 or 100Mbit)
[ ] Use L1 memory for rx/tx packets
but I havn't found the item
TranslateQuoteReplyEditDelete
2008-10-21 09:59:04 Re: ffmpeg run error
Robin Getz (UNITED STATES)
Message: 63988
Jun:
What chip are you using? and what version of kernel/uClinux-dist?
-Robin
QuoteReplyEditDelete
2008-10-21 21:38:39 Re: ffmpeg run error
Jun Ai (CHINA)
Message: 64004
Robin:
My cpu is BF531, the uclinux version is uClinux-dist-2008R1.5-RC3.
TranslateQuoteReplyEditDelete
2008-10-21 22:37:53 Re: ffmpeg run error
Sonic Zhang (CHINA)
Message: 64008
There are too few L1 data SRAM on bf531. You have to disable dcache in kernel and disallow any other drivers to use L1 data cache.
QuoteReplyEditDelete
2008-10-21 22:51:15 Re: ffmpeg run error
Sonic Zhang (CHINA)
Message: 64009
This document is only for bf537/bf548/bf527, not for bf531.
QuoteReplyEditDelete
2008-10-21 22:52:02 Re: ffmpeg run error
Jun Ai (CHINA)
Message: 64010
your meaning is : We must turn off all setting about L1 MEMORY , eg:spin, memcpy ..... in kernel setting, but it will be very slow? who have tested ffmpeg speed with bf531?
TranslateQuoteReplyEditDelete
2008-10-21 23:01:56 Re: ffmpeg run error
Sonic Zhang (CHINA)
Message: 64011
Current test results are based on bf537. There is a bug about your issue on bf531.
QuoteReplyEditDelete
2008-10-22 02:08:24 Re: ffmpeg run error
Jun Ai (CHINA)
Message: 64014
Does ffmpeg have a bug with bf531? how do you know? Could you give me the link? I am testing which close all L1 CATCH in kernel item. when I only close d_catch, it display the same problem with l1 allocation fail!
TranslateQuoteReplyEditDelete
2008-10-22 02:18:24 Re: ffmpeg run error
Mike Frysinger (UNITED STATES)
Message: 64016
ffmpeg uses some L1 data. if you dont have any (like the BF531), then you have to modify the source code yourself.
QuoteReplyEditDelete
2008-10-22 02:40:27 Re: ffmpeg run error
Jun Ai (CHINA)
Message: 64017
Mike:
BF531 should have 16k L1 Data SRam/Catch, So I think it should have L1.DATA.A, not l1.data.b, if we only modify l1.data.b to l1.data.a, and reduce the l1 data used in kernel, I think it do , right?
TranslateQuoteReplyEditDelete
2008-10-22 02:43:50 Re: ffmpeg run error
Mike Frysinger (UNITED STATES)
Message: 64018
there is no dedicated data section. you'd have to turn off dcache in the kernel and i imagine the resulting performance degradation would not justify things.
QuoteReplyEditDelete
2008-10-22 03:18:52 Re: ffmpeg run error
Jun Ai (CHINA)
Message: 64020
Mike:
thanks,your meaning is which I must modify ffmpeg code without l1 data, other problem is which I must turn off all sub item s in"blackfin kernel Optimizations"? they are using l1 data.
TranslateQuoteReplyEditDelete
2008-10-26 23:55:29 Re: ffmpeg run error
Jun Ai (CHINA)
Message: 64212
I have modifyed all l1.data to .data in bfin/*.s, and
#define mL1 .text //#define mL1 .l1.text
#define attribute_l1_text //__attribute__ ((l1_text))
and turn off all sub item s in"blackfin kernel Optimizations", but I have still get the same error message "l1 allocation fail". Should I do more work? Please give me some advice, thanks!
TranslateQuoteReplyEditDelete
2008-10-26 23:58:09 Re: ffmpeg run error
Jun Ai (CHINA)
Message: 64213
need I turn off "FDPIC" ? I read old FFMPEG code, if we define FDPIC, it will use L1.data, but document say we must turn it on.
TranslateQuoteReplyEditDelete
2008-10-27 02:17:08 Re: ffmpeg run error
Mike Frysinger (UNITED STATES)
Message: 64217
if you still get the L1 message, then your binary is still referring to L1. so either you didnt update the sources properly, or you didnt rebuild everything, or ...
QuoteReplyEditDelete
2008-10-27 02:39:23 Re: ffmpeg run error
Jun Ai (CHINA)
Message: 64219
I have done these, 1.make clean; 2. make mrproper 3, make menuconfig, 4.make , I am sure I have rebuild everything,
these message can give any useful information? , Should we only modify source file in bfin directory ?
root:/> cd usr/bin/
root:/usr/bin> ffmpeg
ffmpeg:561: L1 allocation failed
ffmpeg:582: can't map '/usr/lib/libavcodec.so.51'
ffmpeg:561: L1 allocation failed
ffmpeg:582: can't map '/usr/lib/libavcodec.so.51'
ffmpeg: can't load library 'libavcodec.so.51'
root:/usr/bin> car /proc/sram
car: not found
root:/usr/bin> cat /proc/sram
--- L1 Scratchpad Size PID State
ffb00000-ffb00008 8 0 ALLOCATED
ffb00008-ffb01000 4088 0 FREE
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
--- L1 Instruction Size PID State
ffa0823c-ffa0c000 15812 0 FREE
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
00000000-00000000 0 0 NULL
TranslateQuoteReplyEditDelete
2008-10-27 02:57:50 Re: ffmpeg run error
Jun Ai (CHINA)
Message: 64220
Mike:
thanks, ffmpeg have been ok, I forgot to modify "static uint8_t vtmp_blk[256] __attribute__((l1_data_B));" in middle of dsputil_bfin.c
TranslateQuoteReplyEditDelete
2008-10-27 05:04:49 Re: ffmpeg run error
Mike Frysinger (UNITED STATES)
Message: 64223
could you post a diff of the changes you've made ? that way if someone else wants to do what you've done, they can grab your patch ...
thanks!
QuoteReplyEditDelete
2008-10-27 23:07:15 Re: ffmpeg run error
Jun Ai (CHINA)
Message: 64254
ok, I will test it again with some item ,and commit the difference.
TranslateQuoteReplyEditDelete
2008-10-30 02:16:31 Re: ffmpeg run error
Jun Ai (CHINA)
Message: 64393
these file is which I am useing!
bfin.tar.gz
TranslateQuoteReplyEditDelete
2009-04-21 10:29:46 Re: ffmpeg run error
Chellouf sabri (FRANCE)
Message: 72994
Hello,
We can avoid all this, by a simple kernel configuration which is indicated in this link :
docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:ffmpeg
TranslateQuoteReplyEditDelete
2009-04-21 11:53:00 Re: ffmpeg run error
Robin Getz (UNITED STATES)
Message: 73004
Chellouf:
That has nothing to do with the orginal person's questions - which was about BF531.
Please don't add random comments to old threads.
-Robin