Welcome! Log In Create A New Profile

Advanced

Problem installing SndLib

Posted by GeekyLink 
Problem installing SndLib
September 08, 2008 05:24AM
Hello, I have been trying to install Sndlib. There are two methods to install the library. The directions state for the second method to merge the libogc folder with the libogc_patch folder that came with the download and compile it. However, when I attempt to compile the new libogc folder I get the following error:
C:\devkitPro\libogc>make
make[1]: Entering directory `/c/devkitPro/libogc/wii'
make[1]: *** No rule to make target `snd.o', needed by `/wii/libogc.a'.  Stop.
make[1]: Leaving directory `/c/devkitPro/libogc/wii'
make: *** [wii] Error 2

When I try to use the first method of merging the libogc with the libogc folder that came with Sndlib I get this error:
C:\devkitPro\libogc>make
/bin/sh: gc/ogc/libversion.h: No such file or directory
make: *** [gc/ogc/libversion.h] Error 1

I found the libversion.h file in the folder 'include\ogc' so I tried updating the makefile to get the libversion.h file from the 'include\ogc' directory, but it then gave me the error that I recieved when I tried the second method(the first error).

I have also tried copying the contents of 'C:\devkitpro\libogc' to both the libogc and the libogc_patch folders and compiling in those two folders, but it gave me the same error.

If anybody could tell me what I'm doing wrong I'd be very grateful. Thanks in advance. ;)
Re: Problem installing SndLib
September 08, 2008 09:04AM
why can't you just do it manually? copy the files into their corosponding folders directly?
Re: Problem installing SndLib
September 08, 2008 12:52PM
Does anyone know why sndlib insists on patching libogc? I just compiled it as a seperate library and the examples and stuff seemed to work fine without any patching (I ignored the libogc patch dirs).

Can't help you though, my "installation" of SndLib was just to make my own makefile for it that compiled snd.c without the libogc stuff into its own static library.



Edited 1 time(s). Last edit at 09/08/2008 01:07PM by AerialX.
Re: Problem installing SndLib
September 09, 2008 05:29AM
AerialX, that sounds like a good idea. Unfortunately my experience with writing my own makefiles is very limited. Is it possible for someone to upload the patched libogc library or just an upload of the compiled form of snd.c somewhere? I'd be happy with just a makefile to compile the snd.c file. Any method that will get Sndlib working is fine with me.

WiiPhlex, just manually copying the files into their corresponding directories didn't work. Were you able to get it working by doing that?

Also, is this a common problem? Thanks for your suggestions so far.
Re: Problem installing SndLib
September 09, 2008 09:20AM
I haven't tried using this particular library, but I have had it work fine before yes.
Re: Problem installing SndLib
September 09, 2008 06:32PM
Quote
WiiPhlex
I haven't tried using this particular library, but I have had it work fine before yes.
Uh, contradiction much? :P
How've you had it work fine before if you've never used it?

GeekyLink: Here, link to this library (sndlib.a) and include snd.h to use this: Download
EDIT: Note that that's just snd.c compiled... It'll work with the sndlib libtremor example, but will probably fail with the example that plays MODs since the majority of the libogc patch seems to change libmodplay (it also includes a patched lwp_queue.inl, so it's possible that you'll run into thread issues; I didn't when I ran the ogg example though).
So yeah, just no guarantees on the stability of my compiled version since it's not the "preferred" method of using the library.



Edited 1 time(s). Last edit at 09/09/2008 08:55PM by AerialX.
Re: Problem installing SndLib
September 10, 2008 12:05AM
Thank you! All I really needed it for was for ogg anyway. ;) I had to change a couple of the include lines in the example because it seemed that everything was included in the local directory to the example. But it works now. Thanks again.
Re: Problem installing SndLib
September 10, 2008 12:17AM
No problem :)

Tonight I'm messing with sndlib to get MikIT to play through it. I may end up looking at the libmodplay patch instead though depending on how it goes.
Re: Problem installing SndLib
September 10, 2008 08:38AM
AerialX, there are other lib's than this sound one and such a method of installation has worked fine previously.

Edit: I just tried to install this lib, and I'll admit it is rather finiky, and given he has two folders named libogc, that confused things further, although got it in the end :p



Edited 1 time(s). Last edit at 09/10/2008 02:55PM by WiiPhlex.
Re: Problem installing SndLib
September 10, 2008 04:41PM
Mm, well any patch you apply to libogc is going to end up different... Especially when it's not a patch as much as a file replacement; you'd better carefully check your versions. Personally I try to avoid patching libogc for a specific library unless absolutely necessary.

I got MikIT outputting sound through sndlib last night though :D... There is one bug where it seems to be writing further than I want it to on the buffer (causing playback skips) but it's mainly playing properly. It seems to be a good enough mixer library to use.
Re: Problem installing SndLib
September 11, 2008 07:21AM
Honestly, I think that the people that are editing the libogc directory are insane. There is no need to edit it just to use a 3rd party library that doesn't do any file edits. That's just sloppy work to do that.
Re: Problem installing SndLib
September 11, 2008 01:13PM
henke37: Well, it seems that the main part of what changed was libmodplay to work through sndlib. It seems understandable enough since if a fixed libmodplay were distributed seperately, newbs would probably end up linking to the old one without knowing and that'd be hell. It's still not a good idea though, agreed.
Re: Problem installing SndLib
December 18, 2008 12:37AM
Can anyone share how to load an ogg from the SD and play it back. I've been trying to figure this out for a while.

Thanks :)
Re: Problem installing SndLib
December 19, 2008 01:09AM
Here is an example of a simple ogg player using libogc 1.7.0

To start with use tempalte from the devkitpro examples as a base. Add these lines to the template.c file.
#include
#include
#include
#include
#include "oggplayer.h"

// open ogg file and play it
fatInitDefault();
SND_Init(INIT_RATE_48000);
FILE* ogg;
ogg = fopen ("sd:/txtcodes/wiicm.ogg","r");
if( ogg ) {
fclose(ogg);
int fd;
fd=open("fat:/txtcodes/wiicm.ogg",O_RDONLY, 0);
PlayOgg(fd,0,OGG_INFINITE_TIME);
}

You also need oggplayer.c, oggplayer.h and /tremor/ distributed with the original examples for sndlib. There is one change to oggplayer.h originaly it had include "snd.h" this is changed to include "asndlib.h"

Finally you need to add the libs to the makefile.

LIBS := -lasnd -lfat -lwiiuse -lbte -logc -lm ../../tremor/libtremor.a

this is a link to a package containing the example with all the required files. Just extract the archive, cd to the template directory and do make.
[www.mediafire.com]
Re: Problem installing SndLib
December 19, 2008 03:23AM
Thanks. Also thanks to AerialX your library works great for ogg's. Saves having to messing with rebuilding libogc.
Re: Problem installing SndLib
December 19, 2008 08:14AM
If you are using the newset libogc 1.7.0 libasnd is included. So there is no need to add anything or recomplie it for use with oggplayer/modplay/mp3player/ or raw audio
Re: Problem installing SndLib
December 30, 2008 06:14PM
Hi!

linus, i followed your instructions, but when i try to compile i get this error:

'O_RDONLY' undeclared (first use in this function)
and
implicit declaration of function 'open'

code:

void PlayOGG(const char *filename)
{
	fatInitDefault();
	SND_Init(INIT_RATE_48000);
	FILE* ogg;
	ogg = fopen ("sd:/txtcodes/wiicm.ogg","r");
	if(ogg)
	{
		fclose(ogg);
		int fd;
		fd=open("fat:/txtcodes/wiicm.ogg",O_RDONLY, 0);
		PlayOgg(fd,0,OGG_INFINITE_TIME);
	}
}

added the corect headers and it works now, my project also didnt need sysdir.h



Edited 1 time(s). Last edit at 12/30/2008 06:33PM by GizmoTheGreen.
Sorry, only registered users may post in this forum.

Click here to login