Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Android, Wii & 3DS toolchains #915

Merged
merged 7 commits into from Jul 19, 2016

Conversation

Ghabry
Copy link
Member

@Ghabry Ghabry commented Jun 21, 2016

Fixes #116
Fixes #859
Fixes #918

Adds
-DHAVE_LIBSNDFILE -DHAVE_LIBSPEEXDSP

Should solve all our WAV problems (SDL_mixer .)

I'm aware that the 3DS has a hardware resampler but tempo change is not possible with this one correctly because tempo is adjusted via the frequency and this fails when it gets to high.

Wiimote got SHIFT mapped on B (upon request)
Classic Controller got remapped to be Yume Nikki friendly (1, 3, 5 and 9), before the mapping was arbitrary.

Code got updated to build again with latest ctrulib.

Android Wii (Emu) Wii (HW) 3DS
libsndfile X X X Test pending
speexdsp X X X Test pending
ogg X X X Test pending
+DUSE_CACHE -DNO_DEBUG -DHAVE_MPG123 -DWANT_FMMIDI=1 \
+               -DHAVE_LIBSNDFILE -DHAVE_LIBSPEEXDSP -DHAVE_TREMOR

decoded*=sizeof(int32_t);
#endif
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChristianBreitwieser
Does this look okay for you?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ghabry
Yeah it does, but why not drop int32_t altogether (no ifdef) and use int instead for all architectures.
The interface of libsndfile uses int anyway. sf_count_t sf_read_int (SNDFILE *sndfile, int *ptr, sf_count_t items);

I just used int32_t for clarification (and to stay uniform with the int16_t above.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, was just unsure about the code :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using int_least32_t?

@Rinnegatamante
Copy link
Member

What are libsndfile and speexdsp needed for?

@carstene1ns
Copy link
Member

libsndfile can decode various wave formats, so they can be used as streaming audio and speexdsp is a resampler, that for example makes pitch changes independent from hardware support.

@Rinnegatamante
Copy link
Member

Are they used internally by Audio Decoder? Cause if not, i think they're both unused on 3DS port.

@carstene1ns
Copy link
Member

Yes, they will be used if available. There is a file magic check in audio_decoder.cpp. This means the 3ds audio stuff needs to be reworked a bit, but in the end we have proper wave support (no more noise).

@Ghabry
Copy link
Member Author

Ghabry commented Jun 27, 2016

As carsten said ^^.

libsndfile makes our AudioDecoders more complete (only OGG missing, patches welcome), this replaces your WAV code in the near future (sorry). This lib supports many different WAV formats, like ADPCM.

This will also make the Wii port much more enjoyable, because SDL for Wii was totally broken (no audio resampling, everything played at fixed frequency), this got all solved for all platforms with 2 extra classes 👍

@carstene1ns
Copy link
Member

btw. the ogg vorbis music decoder is almost finished: 45561e0.

@Ghabry
Copy link
Member Author

Ghabry commented Jul 10, 2016

libsndfile appears to be totally broken on Wii :(

@Ghabry
Copy link
Member Author

Ghabry commented Jul 12, 2016

Tested on Android: libsndfile, speex and ogg work perfect.

On Wii Ogg+speex work only

3DS has test pending for all

@@ -180,7 +197,13 @@ SdlAudio::SdlAudio() :
if (Mix_OpenAudioDevice(frequency, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 2048,
NULL, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE) < 0)
#else
if (Mix_OpenAudio(frequency, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 2048) < 0)
# ifdef WORDS_BIGENDIAN
int format = AUDIO_S16MSB;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least for SDL Wii MIX_DEFAULT_FORMAT = AUDIO_S16SYS = AUDIO_S16MSB.
This should also be true for all "serious" SDL ports.

@Ghabry
Copy link
Member Author

Ghabry commented Jul 18, 2016

Still waiting for Wii-feedback. The 3DS build is confirmed totally broken, crashes after the EasyRPG logo when loading the file browser. Behaviour can't be reproduced in emulator :(

@carstene1ns
Copy link
Member

I can confirm now, that all music + pitch change works on Wii.
Tested Ib (mp3), Oneshot (ogg) and your Testgame 2000 with changed title music.

@Ghabry
Copy link
Member Author

Ghabry commented Jul 18, 2016

Because of the brokeness of the 3DS build I will remove all changes besides the ctrulib buildfix and handle the rest with an additional PR

@Ghabry
Copy link
Member Author

Ghabry commented Jul 18, 2016

I can confirm that audio works on Linux and Wii with the S16SYS setting. So this is ready 👍

@carstene1ns carstene1ns merged commit 1e3ce39 into EasyRPG:master Jul 19, 2016
@Ghabry Ghabry deleted the toolchain_love branch September 13, 2016 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

5 participants