gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > [RESOLVED]Sound problem libnds

#161477 - sepro - Mon Aug 04, 2008 7:57 pm

I stumbled upon a problem with my sound I really can't seem to fix.

So I tried to re-compile my rubik's cube sim with the new devkitarm, libnds, ... I was able to cope with the small differences but the sound is crumbled (this wasn't the case using devkitARM r21). Weird thing is that the sound code worked well when I tested it in a small test prog. Any thought were I should look for the problem.

Any other methods to play sounds, now it's basically the simplesound code included in devkitpro i've used.

Solution: Although I can't figure out why... for some reason the size of the sound wasn't correct (check wntrmute's simplesound). So it played the sound, then started reading parts that weren't sound at all resulting in random bits and bleeps. I fixed it by manually adding the size of the sound file (not a proper solution but for me it works)

#161632 - preussie - Fri Aug 08, 2008 1:50 pm

I had a similar problem when I upgraded to r23b. It seems that the size of some files processed by 'bin2s.exe' have a wrong size. Using the old version of 'bin2s.exe' ( from r20 ) worked for me.
_________________
My NDS Homebrew projects...

#161647 - josath - Sat Aug 09, 2008 2:13 am

You guys manually process your data files, instead of using the template Makefile and having it magically compile them in for you?

#161654 - preussie - Sat Aug 09, 2008 10:42 am

I use sox to generate a raw data file and drop it into my projects 'data' directory and it gets processed by the bin2s tool during the make process ( using the common devkitARM make rules ).

In general I have no problem with sound/data files but I noticed that the size of at least one ( out of 54 ) converted data files seems to be wrong. Using the old bin2s solved the issue for me.

Nevertheless I still consider that I might have problem with a 'wild' pointer or something and this is not a general problem ;). But reading that some one else has a similar problem is interesting :)
_________________
My NDS Homebrew projects...

#161656 - sepro - Sat Aug 09, 2008 11:49 am

josath wrote:
You guys manually process your data files, instead of using the template Makefile and having it magically compile them in for you?


No I use the template makefile. By manually adding the size I mean doing this:

Code:
playGenericSound(shuffle_raw,28692);


when you want to play the sound. Instead of (like in the sample)

Code:
playGenericSound(shuffle_raw,shuffle_raw_size);



The problem seems to be rather atypical. Sometimes it happens... But in the simplesound example + small test program I wrote myself it doesn't happen. So this is definitely not a general problem, making it pretty hard to track. Maybe I'll try to (temporarily) remove my menu, to test the 'wild' pointer theory. (this is the only part of my project that uses pointers, but uses them heavily. Although I've used the menu class for several things and never had any troubles so far :s)

#161662 - tepples - Sat Aug 09, 2008 4:33 pm

josath wrote:
You guys manually process your data files, instead of using the template Makefile and having it magically compile them in for you?

The DS, GBA, and Windows/Allegro targets of one of my projects all share one source tree. The template makefile would try and fail to compile those translation units that do not apply to a given platform, such as dssound.c on the GBA or pcjoy.c on the DS. So I still roll my own makefile for some more complex projects, especially those whose files need three layers of processing by custom data tools written in (native-compiled) C before they even hit devkitARM.

preussie wrote:
I use sox to generate a raw data file and drop it into my projects 'data' directory and it gets processed by the bin2s tool during the make process ( using the common devkitARM make rules ).

Did you also manage to figure out a way to get the template makefile to run sox for you?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#161669 - preussie - Sat Aug 09, 2008 8:14 pm

tepples wrote:

Did you also manage to figure out a way to get the template makefile to run sox for you?


No, I convert the sounds manually :/. Not really a problem for me because they don't change too often - but it would be nice if it would work automatically... :)
_________________
My NDS Homebrew projects...