Updated libtremor in DevKitPPC

Issue #48 resolved
Andrew Waters created an issue

Original [issue 48](https://code.google.com/p/genplus-gx/issues/detail?id=48) created by ccfreak2k on 2009-10-14T04:34:47.000Z:

What steps will reproduce the problem? 1. Grab latest revision of genplus-gx 2. Grab latest stable version of devkitppc 3. Attempt to compile.

What is the expected output? What do you see instead? I expected a binary. I got errors from gcc.

What version of the emulator are you using? r355

Please provide any additional information below (video settings, console region,...) Not being the kind of person to sit on my ass and whine (at least, not anymore), I decided to find out why it didn't work. Turns out genplus-gx's ogg-related code wasn't updated for the newer version of libtremor. I spent some time diffing the code between this and vba-wii, which revealed the culprit code. Attached is a diff that can be applied to r355 that causes it to compile without error, although I haven't tested it yet. Since it's also only slightly better than a copy-and-paste from vba-wii, there's possible issues dealing with threading that would need to be ironed out before inclusion, if the patch even works.

The code taken from vba-wii's oggplayer.c has the same license as genplus-gx's, with two additional lines in the header:

Proper (standard) vorbis usage by Tantric, 2009 Threading modifications/corrections by Tantric, 2009

Additionally, the single changed line in gx\_audio.c comes from gui\_sound.cpp from vba-wii, which has this near the top:

\* Tantric 2009

Hopefully this will be useful to anyone else, including the maintainer(s) of genplus\_gx.

Comments (9)

  1. Former user Account Deleted
    • changed status to open

    Comment # 1 originally posted by ekeeke31 on 2009-10-14T07:11:28.000Z:

    Well, I didn't have the time to test the new libtremor and the libs package in the dowload page still use the older compiled one, hence why the code wouldn't need to be modified so far.

    Anyway, thanks for the patch, at first sight, it seems it only re-implement functions that were originally in libtremor and probably was removed (memopen, ...) as well as taking in account the fact the name of the libray changed. I didn't even noticed there were PORTLIBS now, I should maybe took a look at it, the emulator seems to crash everytime I try to write a file with libfat since I've updated to last devkitPPC btw... very weird

    Btw, what are the differences/improvments with the new libtremor? There wasn't any issue with the current one, as far as I tested it, ogg support worked perfectly in this emulator...

  2. Former user Account Deleted

    Comment # 2 originally posted by ekeeke31 on 2009-10-14T08:15:54.000Z:

    About portlibs, the compiled libpng is now 450 KB bigger than the old one, which is not really neglegctable. I think I will stick with the old versions that already do the job perfectly, at least for a while...

    Now, if anyone has any idea why writing savestate files to SD now crash with the new devkitPPC, please tell me.... It seems the size of the file does matter (SRM and config files are fine). I guess the fact that IO are now unbuffered means I can't read file in one pass anymore, like this fread(buffer, 1, 1048576, sdfile) ?

    But what is the maximal chunk size ? Any help would be appreciated...

  3. Andrew Waters reporter

    Comment # 3 originally posted by ccfreak2k on 2009-10-14T18:05:38.000Z:

    You're probably right about the re-implementation. mem\_open() and mem\_close() were unresolved at link time if the new libtremor was used, which is probably why they were added.

    I'm not sure when PORTLIBs were added, but vba-wii and snes9x-gc both use them, and the emulator seems to at least run when using them, so using them from now on seems the best choice to me.

    Also, I did get an opportunity to test the patched code briefly last night. The emulator seems to run fine, but for some reason pad 1 was inputting for Genesis controllers 1 AND 2. I'm not sure if it was a configuration error or not (I didn't have the presence of mind to check), but I have my doubts it has anything to do with sound, heh.

  4. Former user Account Deleted

    Comment # 4 originally posted by dborth on 2009-10-15T00:44:55.000Z:

    The libtremor from devkitpro portlibs in a stock copy from http://svn.xiph.org/branches/lowmem-branch/Tremor/. The libtremor eke-eke is using is a modified version that Hermes did. I'm unsure why Hermes chose to hack up tremor, but my modified oggplayer.c uses the built-in callback hooks for tremor, so that we can use a stock tremor. It doesn't work any better really, but removes the reliance on the hacked tremor.

    You should be deleting all compiled libs (png, tremor, jpeg, etc) located in /libogc and downloading the portlibs and placing them in /portlibs. Those older libs were compiled on an older gcc, so can have unpredictable results. Wintermute intends to update the devkitpro installer to also offer installing the portlibs.

    Also, eke-eke - there's no need now to offer libogc, libpng, etc for download here, now that it's all compileable from devkitpro :)

  5. Former user Account Deleted

    Comment # 5 originally posted by dborth on 2009-10-15T00:46:01.000Z:

    As for libfat, any chunk size is \*supposed\* to work, but for your reference I use 4kb chunks.

  6. Former user Account Deleted

    Comment # 6 originally posted by ekeeke31 on 2009-10-15T07:03:08.000Z:

    yeah, I fixed it by using 2KB as generic chunk size (and I was inverting blocksize and blockcnt in fread/fwrite functions)

    Thanks for the clarifications, I fully agree there is no more need to store precompiled libs here and that it's better to use up-to-date & gcc compliant libraries, this should be fixed soon.

  7. Andrew Waters reporter

    Comment # 8 originally posted by ccfreak2k on 2009-10-17T15:47:04.000Z:

    Looks like the patch made its way into the main trunk. Might as well close this as fixed or something.

  8. Former user Account Deleted

    Comment # 9 originally posted by ekeeke31 on 2009-10-17T18:13:17.000Z:

    It is indeed closed (verified means it has been confirmed to be fixed);-)

  9. Log in to comment