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

PSVITA port and fix for audio decoder on 3DS port. #973

Merged
merged 24 commits into from Aug 8, 2016

Conversation

Projects
None yet
3 participants
@Rinnegatamante
Member

Rinnegatamante commented Aug 4, 2016

As the title says.
PSVITA port lacks only of OGG support (both sounds and musics).
Everything else is fully working.

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Aug 4, 2016

Member

For the pics I propose: Any other suggestions?

pics.zip
image1 crushed
pngout

Member

Ghabry commented Aug 4, 2016

For the pics I propose: Any other suggestions?

pics.zip
image1 crushed
pngout

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Aug 5, 2016

Member

Great. Some BGM features are missing. Though to implement them you need a reference to the AudioDecoder.

The missing fade is noticable in the Ib video, the music should fade out when the light begins to flicker iirc.

Here are the important lines, copied from sdl_audio:

BGM_Play
// You can use GetVolume in the BGM thread to get the current volume, it takes care of fades
audio_decoder->SetFade(0, volume, fadein);
audio_decoder->SetPitch(pitch); // pitch is commented out in the argument list
bgm_starttick = DisplayUi->GetTicks();

BGM_GetTicks
return audio_decoder->GetTicks();

BGM_PlayedOnce
return audio_decoder->GetLoopCount() > 0;

BGM_Volume
// Only a convenience function, you have to still set it for the hardware using something like
// sceAudioOutSetVolume(audio_decoder->GetVolume(), ....)
audio_decoder->SetVolume(volume);

BGM_SetPitch
audio_decoder->SetPitch(pitch);

BGM_Fade
audio_decoder->SetFade(audio_decoder->GetVolume(), 0, fade);
bgm_starttick = DisplayUi->GetTicks();

SE_Play
Also has pitch and volume

Update
// The Fade needs a time delta to work:
if (audio_decoder && bgm_starttick > 0) {
    int t = DisplayUi->GetTicks();
    audio_decoder->Update(t - bgm_starttick);
    bgm_starttick = t;
}
Member

Ghabry commented Aug 5, 2016

Great. Some BGM features are missing. Though to implement them you need a reference to the AudioDecoder.

The missing fade is noticable in the Ib video, the music should fade out when the light begins to flicker iirc.

Here are the important lines, copied from sdl_audio:

BGM_Play
// You can use GetVolume in the BGM thread to get the current volume, it takes care of fades
audio_decoder->SetFade(0, volume, fadein);
audio_decoder->SetPitch(pitch); // pitch is commented out in the argument list
bgm_starttick = DisplayUi->GetTicks();

BGM_GetTicks
return audio_decoder->GetTicks();

BGM_PlayedOnce
return audio_decoder->GetLoopCount() > 0;

BGM_Volume
// Only a convenience function, you have to still set it for the hardware using something like
// sceAudioOutSetVolume(audio_decoder->GetVolume(), ....)
audio_decoder->SetVolume(volume);

BGM_SetPitch
audio_decoder->SetPitch(pitch);

BGM_Fade
audio_decoder->SetFade(audio_decoder->GetVolume(), 0, fade);
bgm_starttick = DisplayUi->GetTicks();

SE_Play
Also has pitch and volume

Update
// The Fade needs a time delta to work:
if (audio_decoder && bgm_starttick > 0) {
    int t = DisplayUi->GetTicks();
    audio_decoder->Update(t - bgm_starttick);
    bgm_starttick = t;
}
@Rinnegatamante

This comment has been minimized.

Show comment
Hide comment
@Rinnegatamante

Rinnegatamante Aug 5, 2016

Member

PlayedOnce is already implemented. Working on the other things.

Member

Rinnegatamante commented Aug 5, 2016

PlayedOnce is already implemented. Working on the other things.

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Aug 5, 2016

Member

People who play Yume Nikki will need the buttons N1, N3, N5 and N9 btw. (SHIFT is already mapped) Are there some keys on the controller available to map them? Maybe abuse one of the analog sticks.

There are also much more buttons, but because everybody plays Yume Nikki these are enough ;)

Member

Ghabry commented Aug 5, 2016

People who play Yume Nikki will need the buttons N1, N3, N5 and N9 btw. (SHIFT is already mapped) Are there some keys on the controller available to map them? Maybe abuse one of the analog sticks.

There are also much more buttons, but because everybody plays Yume Nikki these are enough ;)

@Rinnegatamante

This comment has been minimized.

Show comment
Hide comment
@Rinnegatamante

Rinnegatamante Aug 5, 2016

Member

Mhhh maybe we can map the retrotouch or the touchscreen. OR the right analog. Cause there aren't other buttons available.

Member

Rinnegatamante commented Aug 5, 2016

Mhhh maybe we can map the retrotouch or the touchscreen. OR the right analog. Cause there aren't other buttons available.

@Rinnegatamante

This comment has been minimized.

Show comment
Hide comment
@Rinnegatamante

Rinnegatamante Aug 5, 2016

Member

Little note: retrotouch and touchscreen = PSVITA TV not compatible.

Member

Rinnegatamante commented Aug 5, 2016

Little note: retrotouch and touchscreen = PSVITA TV not compatible.

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Aug 5, 2016

Member

The right analog offers at least 4 directions, so this sounds like a plan.

Member

Ghabry commented Aug 5, 2016

The right analog offers at least 4 directions, so this sounds like a plan.

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Aug 5, 2016

Member

Oh and you have to set the paths where the Runtime Package is searched.

This is in this function:
https://github.com/EasyRPG/Player/blob/master/src/filefinder.cpp#L388

Default is

add_rtp_path("/data/rtp/" + version_str + "/");

If you think this path is fine just keep it and don't modify the function :)

This is also not altered for the 3DS version, though not sure if that's a big deal.

Member

Ghabry commented Aug 5, 2016

Oh and you have to set the paths where the Runtime Package is searched.

This is in this function:
https://github.com/EasyRPG/Player/blob/master/src/filefinder.cpp#L388

Default is

add_rtp_path("/data/rtp/" + version_str + "/");

If you think this path is fine just keep it and don't modify the function :)

This is also not altered for the 3DS version, though not sure if that's a big deal.

Show outdated Hide outdated src/psp2_ui.cpp
@Rinnegatamante

This comment has been minimized.

Show comment
Hide comment
@Rinnegatamante

Rinnegatamante Aug 6, 2016

Member

Talking back to this i previously said:
"Little note: retrotouch and touchscreen = PSVITA TV not compatible."

I discovered it's wrong since even on PSVITA TV there's a setting to emulate touchpad and touchscreen with analogs (basically pressing analogs + moving = emulating touch).
Looks still pretty uncomfortable to use but can be used if we need two extra buttons (just touchscreen tap and retrotouch tap).

Member

Rinnegatamante commented Aug 6, 2016

Talking back to this i previously said:
"Little note: retrotouch and touchscreen = PSVITA TV not compatible."

I discovered it's wrong since even on PSVITA TV there's a setting to emulate touchpad and touchscreen with analogs (basically pressing analogs + moving = emulating touch).
Looks still pretty uncomfortable to use but can be used if we need two extra buttons (just touchscreen tap and retrotouch tap).

Show outdated Hide outdated builds/psvita/Makefile
@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Aug 7, 2016

Member

After adding the mentioned makefile lines, fixing the whitespacing in psp2_ui.cpp (some lines use spaces instead of tabs) and doing a rebase on master to get rid of the merge commits I think this one here is okay in it's current state.

(make a backup of your before if you are afraid)

git rebase upstream/master
git push -f origin

As a long term solution I think we should add another audio system that mixes BGM+SE together in software so the porter only has to play that buffer, also works around the channel limits some hardware has. Will make the life much easier for all non-SDL ports 👍

Member

Ghabry commented Aug 7, 2016

After adding the mentioned makefile lines, fixing the whitespacing in psp2_ui.cpp (some lines use spaces instead of tabs) and doing a rebase on master to get rid of the merge commits I think this one here is okay in it's current state.

(make a backup of your before if you are afraid)

git rebase upstream/master
git push -f origin

As a long term solution I think we should add another audio system that mixes BGM+SE together in software so the porter only has to play that buffer, also works around the channel limits some hardware has. Will make the life much easier for all non-SDL ports 👍

Rinnegatamante added some commits Aug 4, 2016

PSVITA: First commit.
PSVITA: First commit.
PSVITA: Deadlock and conditions order fix.
PSVITA: Deadlock and conditions order fix.
Removed unused code.
Removed unused code.
PSVITA: First attempt for sounds support.
PSVITA: First attempt for sounds support.
PSVITA: Now sounds are correctly working.
PSVITA: Now sounds are correctly working.
PSVITA: Centered image for zoomed res.
PSVITA: Centered image for zoomed res.
PSVITA: Properly closing sfx threads.
PSVITA: Properly closing sfx threads.
Fix for BGM crashes when audio decoder called twice.
Fix for BGM crashes when audio decoder called twice.
Bugfixes for sounds. Added pitch and fade support.
Bugfixes for sounds. Added pitch and fade support.
Increased heap size to 192 MB.
Increased heap size to 192 MB.
PSVITA: Added RTP support.
PSVITA: Added RTP support.
Reduced stuttering when sounds are spammed.
Reduced stuttering when sounds are spammed.
Added analogs support and 444 Mhz mode usage.
Added analogs support and 444 Mhz mode usage.
Makefile flags fix and a bit of libraries cleanup.
Makefile flags fix and a bit of libraries cleanup.
PSVITA: Added OGG support.
PSVITA: Added OGG support.
Bugfix for Y axis inversion on left analog.
Bugfix for Y axis inversion on left analog.
Fix for Windows build.
Fix for Windows build.
Added vpk template and assets.
Added vpk template and assets.

Rinnegatamante added some commits Aug 7, 2016

Cleanup and adjustments.
Cleanup and adjustments.
Ident fix.
Ident fix.
Show outdated Hide outdated builds/psvita/Makefile
Compilation fixes.
Compilation fixes.
@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Aug 7, 2016

Member

Jenkins: Test this please

Member

Ghabry commented Aug 7, 2016

Jenkins: Test this please

Show outdated Hide outdated src/filefinder.cpp
Show outdated Hide outdated src/filefinder.cpp
Show outdated Hide outdated src/main_data.cpp
Show outdated Hide outdated src/psp2_decoder.h
Show outdated Hide outdated src/psp2_ui.h
Show outdated Hide outdated builds/psvita/Makefile
Minor adjustments.
Minor adjustments.
@carstene1ns

This comment has been minimized.

Show comment
Hide comment
@carstene1ns

carstene1ns Aug 7, 2016

Member

This is my working Makefile rule:

$(TARGET).vpk: $(TARGET).velf
    vita-make-fself $< release/eboot.bin
    vita-mksfoex -s TITLE_ID=$(APP_ID) "$(APP_TITLE)" release/sce_sys/param.sfo
    7za a -tzip $(TARGET).vpk ./release/sce_sys ./release/eboot.bin
Member

carstene1ns commented Aug 7, 2016

This is my working Makefile rule:

$(TARGET).vpk: $(TARGET).velf
    vita-make-fself $< release/eboot.bin
    vita-mksfoex -s TITLE_ID=$(APP_ID) "$(APP_TITLE)" release/sce_sys/param.sfo
    7za a -tzip $(TARGET).vpk ./release/sce_sys ./release/eboot.bin
Show outdated Hide outdated src/psp2_ui.cpp
Fix for right analog buttons state.
Fix for right analog buttons state.
@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Aug 8, 2016

Member
HAVE_ZIP := $(shell command -v zip 2> /dev/null)

all: $(TARGET).vpk

$(TARGET).vpk: $(TARGET).velf
        vita-make-fself $< release/eboot.bin
        vita-mksfoex -s TITLE_ID=$(APP_ID) "$(APP_TITLE)" release/sce_sys/param.sfo
ifdef HAVE_ZIP
        cd release; zip ../$(TARGET).vpk -r ./sce_sys ./eboot.bin
else
        7z a -tzip ./$(TARGET).vpk -r ./release/sce_sys/* ./release/eboot.bin
endif

Another solution that could make both happy (Replace space with tabs!). The 7z line is wrong, use your Windows one there with the ""

Member

Ghabry commented Aug 8, 2016

HAVE_ZIP := $(shell command -v zip 2> /dev/null)

all: $(TARGET).vpk

$(TARGET).vpk: $(TARGET).velf
        vita-make-fself $< release/eboot.bin
        vita-mksfoex -s TITLE_ID=$(APP_ID) "$(APP_TITLE)" release/sce_sys/param.sfo
ifdef HAVE_ZIP
        cd release; zip ../$(TARGET).vpk -r ./sce_sys ./eboot.bin
else
        7z a -tzip ./$(TARGET).vpk -r ./release/sce_sys/* ./release/eboot.bin
endif

Another solution that could make both happy (Replace space with tabs!). The 7z line is wrong, use your Windows one there with the ""

@Rinnegatamante

This comment has been minimized.

Show comment
Hide comment
@Rinnegatamante

Rinnegatamante Aug 8, 2016

Member

On my side it apparently works fine so i suppose it's ready for a push

Member

Rinnegatamante commented Aug 8, 2016

On my side it apparently works fine so i suppose it's ready for a push

Fixxed compilation under Linux.
Fixxed compilation under Linux.
@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Aug 8, 2016

Member

Jenkins: Test this please

Member

Ghabry commented Aug 8, 2016

Jenkins: Test this please

@Ghabry Ghabry merged commit 2aeb4bf into EasyRPG:master Aug 8, 2016

6 checks passed

Android (armeabi-v7a) Build finished.
Details
GNU/Linux Build finished.
Details
OSX Build finished.
Details
Windows (x64) Build finished.
Details
Windows (x86) Build finished.
Details
web Build finished.
Details

@carstene1ns carstene1ns added the PSVita label May 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment