CBPS Forums
Console Hacking => PS Vita => Topic started by: Graphene on May 15, 2020, 01:20:05 AM
-
libShellAudio
ShellAudio is PS Vita library that is a result of reverse engineering Sony's static library that is used in system applications and Music application to play audio files using SceShell resources.
https://github.com/GrapheneCt/libShellAudio (https://github.com/GrapheneCt/libShellAudio)
suprx module version: https://github.com/GrapheneCt/libShellAudio/releases (https://github.com/GrapheneCt/libShellAudio/releases)
Features:
1. Very easy to use.
2. Doesn't use any of the resources allocated to the application.
3. All decoding is performed on Codec Engine.
4. Supports EQ, different repeat modes, shuffle mode.
5. When in music mode, volume can be controlled with "Music" slider from quick menu.
Supported codecs:
1. MP3 (.mp3)
2. AAC (.m4a, .aac)
3. ATRAC9 (.at9)
4. WAV (.wav)
Examples of usage:
1. Application BGM (NOTE: in param.sfo, ATTRIBUTE flag ENABLE BGM PROXY must be set to 1)
shellAudioInitializeForBGM(0);
SceShellSvcAudioCustomOpt optParams;
sceClibMemset(&optParams, 0, 0x10);
optParams.flag = -1;
shellAudioSetAudioForBGM("pd0:data/systembgm/near.at9", &optParams);
shellAudioSetVolumeForBGM(0x4E20);
shellAudioSetParam2ForBGM(1);
shellAudioSendCommandForBGM(SCE_SHELLAUDIO_DEFAULT, 0);
2. Music player with jazz EQ:
shellAudioInitializeForMusicPlayer(0);
shellAudioSendCommandForMusicPlayer(SCE_SHELLAUDIO_STOP, 0);
shellAudioSetAudioForMusicPlayer("pd0:data/systembgm/near.at9", NULL);
shellAudioSendCommandForMusicPlayer(SCE_SHELLAUDIO_PLAY, 0);
shellAudioSetEQModeForMusicPlayer(SCE_SHELLAUDIO_EQ_JAZZ);
-
I'm having trouble with linking.
<artificial>:(.text+0x1c): undefined reference to `SceShellSvc_B31E7F1C'
I don't see the NID in DolceSDK db.yml nor is it imported in the library by NID. dots says that's the problem.
I'll ask cuevavirus to generate a stub for it.
Meanwhile, may I ask how you're using it without the NID so I can use it too?
-
Since this library uses currently undocumented SceShellSvc_B31E7F1C function, stub for it must be generated manually, for example with dolce_gen_libs.
-
Some things to note that Graphene told me while troubleshooting my project:
If used in an user plugin, init_type when using shellAudioInitializeForBGM should be 1 instead of 0.
Some things to note when using this on shell itself (title ID: main):
Audio related stuff are loaded late in shell's initialization so you have to use SceShellSvc_stub_weak when linking it.
For the same reason as above, the plugin should be threaded with a delay of 8 to 10 seconds at the thread start (when vsh bridge: shell ready is present in stdout, shell is completely loaded). see here: https://forum.devchroma.nl/index.php/topic,163.0.html
-
libShellAudio has been updated:
Changed:
shellAudioSetParam1ForBGM() -> shellAudioSetVolumeForBGM()
shellAudioGetSomethingForMusicPlayer1() -> shellAudioGetSqliteBufferForMusicPlayer()
shellAudioGetSomethingForMusicPlayer2() -> shellAudioGetMetadataForMusicPlayer()
shellAudioGetSomethingForMusicPlayer3() -> shellAudioGetPlaybackStatusForMusicPlayer()
Added:
shellAudioInitializeForShell()
shellAudioFinishForBGM()
shellAudioGetStatusForMusicPlayer()
shellAudioLockForMusicPlayer()
shellAudioSendSqliteBufferForMusicPlayer()
-
libShellAudio has been updated:
Added:
shellAudioFinishForMusicPlayer()
shellAudioAutoSeekForMusicPlayer()
shellAudioSetALCModeForMusicPlayer()
shellAudioSetVolumeForMusicPlayer()
-
suprx module version of the library is now available here: https://github.com/GrapheneCt/libShellAudio/releases (https://github.com/GrapheneCt/libShellAudio/releases)
-
Static version of libShelAudio has been updated to accomodate changes in DolceSDK.