#176015 - spinal_cord - Fri Mar 18, 2011 9:44 pm
Is there any mp3 source around that will compile with a recent devkitarm/libnds?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage
#176016 - elhobbs - Sat Mar 19, 2011 4:41 am
I am using helix for cquake. there is a link to the svn in my signature.
#177408 - hacker013 - Thu May 31, 2012 12:05 pm
@Elhobbs
I copied your code from cQuake (the mp3 & helix part) but when I try to use it, it just does nothing, als hearing nothing either. But when I press the L+R+SELECT+START combination the ds shutdown so it isn't hanging. My arm7 is the same as yours and my arm9 is this:
Open and Play Mp3
Code: |
iprintf("Init MP3 Streamer...");
if(!mp3_init())
{
iprintf("failed!");
while(1)
{
swiWaitForVBlank();
}
}
file=fopen("test.mp3", "rb");
if(file==NULL)
{
iprintf("failed!");
while(1)
{
swiWaitForVBlank();
}
}
iprintf("loaded!\nPlay MP3...");
if(!mp3_play_file(file, 1))
{
iprintf("failed!");
while(1)
{
swiWaitForVBlank();
}
}
iprintf("succes!\n");
iprintf("Set Volume to 127...");
mp3_set_volume(127);
iprintf("succes!\n");
|
I swapped the return values from mp3_init & mp3_play_file so it returns true on succes.
And after the swiWaitForVBlank(); this
Code: |
//mp3_print();
mp3_fill_buffer();
|
[/code]
_________________
Website / Blog
Let the nds be with you.
#177413 - elhobbs - Thu May 31, 2012 2:46 pm
hard to say without looking at the complete project. anywhere I can see this along with your sample mp3? I can say that this does work in cquake with the current toolchains. so, there must be something with your code or with the encoding on your mp3.
#177416 - hacker013 - Thu May 31, 2012 5:29 pm
It is from some bigger project and I don't want to show the rest of it, but like, I already posted the relevant parts. I'm busy with a video library. So I'm testing things and trying to understand the way fifo and such works.
I just copied mp3_7.arm.s & mp3_7.c & mp3_9.c & mp3_shared.h from your cQuake. I had helix already lying around. I copied your arm7 code & checked in your CDAudio file how you did the arm9 side. And used that for the arm9 (see part in first post). I googled also on it and found out the specs needed for playing with your code. And if I use mp3_print the values printed never change.
_________________
Website / Blog
Let the nds be with you.
#177418 - elhobbs - Thu May 31, 2012 5:54 pm
so, you have access to code that works in cquake. and you are unwilling to provide sample code... yet for some reason I am still going to try to help you.
create a new test project that just plays mp3s - and go from there. if that does not work then share what you have.
#177419 - hacker013 - Thu May 31, 2012 6:14 pm
I just don't like to share unfinished code, i like to provide finished projects =\
- Download Source
Contains your mp3 code, and some old ogg code laying around, also still not working :'(. I've tried both to get working, the mp3 code from your cQuake works in your cQuake and the ogg code did work in some old project of mine. I hope you can something with it ^^
_________________
Website / Blog
Let the nds be with you.
#177420 - elhobbs - Thu May 31, 2012 6:41 pm
I will take a look at this tonight. at quick glance the only issue I saw was that your code is looking for test.mp3 but the file in the archive is testNormal.mp3. also, I am not sure the mp3 is encoded at a rate that I recommended. looks like it is 128 kbps - I want to say I could only get 96 kbps to play successfully - without stuttering.
#177421 - hacker013 - Thu May 31, 2012 6:48 pm
I know, I forgot to add testRec.mp3 >< testNormal.mp3 is a normal mp3 and testRec.mp3 is the mp3 with the specifications for your code. And I renamed everytime one of the 2 to test.mp3 tot test my code.
_________________
Website / Blog
Let the nds be with you.
#177422 - elhobbs - Fri Jun 01, 2012 3:28 am
ok. you need to change your makefile to optimize for size. change -O2 to -Os
not enough memory otherwise.
you also need to make a few changes to the asm to mark the assembly as functions - see here
in these files:
mp3_7.arm.s - 1 function
asmpoly_gcc.s - 2 functions
(the code in the svn does not work with the current tools because these 3 changes were not commited - I was wrong when I said that it worked. sorry about that)
you will need to do a full rebuild.
#177426 - hacker013 - Fri Jun 01, 2012 10:17 am
Thank you very much. It is working now ^^. I made an example with it for everybody else so they can enjoy it.
http://forum.gbadev.org/viewtopic.php?t=17859
_________________
Website / Blog
Let the nds be with you.
#177438 - hacker013 - Tue Jun 05, 2012 8:14 pm
It has some wierd bug, on my nds pat it does work perfectly, but on my nds lite it will hang random at mp3_play_file and mp3_fill_buffer :S
_________________
Website / Blog
Let the nds be with you.
#177440 - elhobbs - Tue Jun 05, 2012 9:34 pm
are you using the same card on both or different cards? it may be a file system issue if you are using different cards.