Thanks to your simple but revealing test, I think I know what's going
on. There's a known issue in the MP3 decoder where the codec writes to
the inBuf during process(). (Depending on the release you have, you may
find this tracked as 'known issue' CDMR00002443 in the release notes).
This 'write to inBuf' is a bug - xDM defines inBuf is an IN buf, not
IN/OUT buf.
Because the Codec Engine skeletons on the DSP side manage the inBuf's
cache as an IN, rather than an IN/OUT buffer, the codec writing to inBuf
results in a cache incoherency - the 'writes' will happen 'some time
later' and could corrupt whatever contents are in that buffer.
[ For those interested, the default CE skeletons on the DSP don't
writeback the cache for the inBuf after the process() call - because it
shouldn't have been written to. Cache maintenance is a significant
percentage of the overhead of a dual-core device, and as such we
minimize cache operations when possible. ]
There is a codec-specific fix available (essentially plugs in a new
skeleton for this codec only and does the writeback of inBuf). In fact,
if you have the DVEVM, you'll see references to this fix in the
packaging in codec_servers_1_00/packages/ti/sdo/codecs/mp3dec -
getLibs() in package.xs returns a codec-specific
'lib/mp3auddecskel.a64P', and in MP3DEC.xdc, the MP3DEC.serverFxn is
configured to "MP3DEC_INBUFCACHEFLUSH" rather than the default
skeletons. Unfortunately, the DVEVM didn't include the codec libraries
- so you won't find the 'real' fix there.
When you received the eval codec, did you just get the MP3DEC's .lib
file? Or did you get a complete 'package'? If you got the entire codec
'package', you may already be linking in that 'skeleton workaround'
library. If you only received the library, you'll have to ask your
supplier for the entire package.
Chris
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Pradeep Sriram
Sent: Thursday, February 22, 2007 6:08 AM
To: [email protected]
Subject: AUDDEC_process corrupting input buffer during mp3
playback
Hi all,
I am having trouble playing mp3 files. The playback is garbled
and noisy. Also note that the problem is observed in some mp3 files
only.
After debugging I came to conclusion that somewhere
AUDDEC_process function "corrupts" the input buffer.
I changed decodeAudioBuffer function in demos/decode/audio.c as
below
copy inBuf to a temporary buffer
/* Decode the audio buffer */
status = AUDDEC_process(hDecode, &inBufDesc, &outBufDesc,
&inArgs, &outArgs);
compare inBuf to the temporary buffer
I build a combo server with TI's evaluation MP3 library
(mp3dec_tii_l1l2l3.l64P size:432806 bytes)
Regards,
Pradeep Sriram
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source