#131210 - Noda - Tue Jun 12, 2007 12:43 pm
Hello,
I'm currently working on simulatneous decoding of 2 mp3, streamed from fat, on the arm9.
The tests I made on the decoded showed that it is logically possible to do so (229% realtime for a 44k 320kbps stereo mp3, around 400% at 128kbps bitrate, for an mp3 played from ram)
The engine is already built, with a nice streaming system (based on an example posted on this forum) and working nicely when only 1 mp3 is played at a time.
But I have problem for interleaving the 2 mp3 decoding, I don't know what could be the best way to do it (as there's no threads on the DS)...
One issue could also be reading from fat (I hope it's fast enough, as decoding 2 320kbps would require a 80KB/s read speed, and 2 128kbps a 32KB/s read speed...).
I don't think the CPU time is the issue (and if it was the case I could eventually decode the second mp3 on the arm7), but I tried adjusting the buffer size and the mp3 decoded audio filling methods, with no concluant results.
My system is made of 5 buffers for each mp3:
- the current audio buffer, which is played by the NDS sound hardware, X 2 for stereo
- the decoded audio buffer, which is where the mp3 decoded data goes, it's made of 2 buffers (for swapping), when one buffer is feeding the NDS audio buffer, the second is getting filled by decoding mp3 frames, and I swap them when it needs (again, X2 for stereo)
- the read buffer (encoded mp3 data), contains the mp3 streamed from fat. Its refill is currently triggered when it does not contains enough data to decode a mp3 frame, and could possibly a source of issue.
One other thing which is bothering me is the display & command system, which is done in the current version in the VBL handler: currently it's just made of some printf and basic command checks, but when a little more complicated display will be added, I fear that this solution will causes some problems, as it might not be interrupt-friendly...
I would like to have your ideas, opinions/suggestions concerning all this system, as I run out of ideas for now :(
I'm currently working on simulatneous decoding of 2 mp3, streamed from fat, on the arm9.
The tests I made on the decoded showed that it is logically possible to do so (229% realtime for a 44k 320kbps stereo mp3, around 400% at 128kbps bitrate, for an mp3 played from ram)
The engine is already built, with a nice streaming system (based on an example posted on this forum) and working nicely when only 1 mp3 is played at a time.
But I have problem for interleaving the 2 mp3 decoding, I don't know what could be the best way to do it (as there's no threads on the DS)...
One issue could also be reading from fat (I hope it's fast enough, as decoding 2 320kbps would require a 80KB/s read speed, and 2 128kbps a 32KB/s read speed...).
I don't think the CPU time is the issue (and if it was the case I could eventually decode the second mp3 on the arm7), but I tried adjusting the buffer size and the mp3 decoded audio filling methods, with no concluant results.
My system is made of 5 buffers for each mp3:
- the current audio buffer, which is played by the NDS sound hardware, X 2 for stereo
- the decoded audio buffer, which is where the mp3 decoded data goes, it's made of 2 buffers (for swapping), when one buffer is feeding the NDS audio buffer, the second is getting filled by decoding mp3 frames, and I swap them when it needs (again, X2 for stereo)
- the read buffer (encoded mp3 data), contains the mp3 streamed from fat. Its refill is currently triggered when it does not contains enough data to decode a mp3 frame, and could possibly a source of issue.
One other thing which is bothering me is the display & command system, which is done in the current version in the VBL handler: currently it's just made of some printf and basic command checks, but when a little more complicated display will be added, I fear that this solution will causes some problems, as it might not be interrupt-friendly...
I would like to have your ideas, opinions/suggestions concerning all this system, as I run out of ideas for now :(