| View previous topic :: View next topic |
| Author |
Message |
G43L
Joined: 07 Nov 2009 Posts: 12
|
Posted: Wed Nov 18, 2009 4:41 pm Post subject: MP3 not playing with OSLib 2.10 |
|
|
Dear community,
I'm simply trying to play an MP3 with OSLib 2.10 but... it fails. Tags have been removed with the program 'Mp3 TAG Remover!' (I've verified with XMPlay before and after removal).
Note: I program in C++
| Code: |
PSP_MODULE_INFO("Screamwind", 0, 0, 2);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
PSP_HEAP_SIZE_MAX();
PSP_MAIN_THREAD_STACK_SIZE_KB(512);
|
In init routine:
| Code: |
...
oslInitAudio();
...
|
| Code: |
#include <oslib/oslib.h>
OSL_SOUND *pMusic;
void UpdateAudio()
{
oslAudioVSync();
}
void LoadMusic(string music)
{
pMusic = oslLoadSoundFile(music.c_str(), OSL_FMT_STREAM);
oslSetSoundLoop(pMusic, 1);
}
void PlayMusic()
{
oslPlaySound(pMusic, 0);
}
|
| Code: |
host0:/src/> ./screamwind.prx
Load/Start host0:/src/screamwind.prx UID: 0x04971F43 Name: "Screamwind"
host0:/src/> Exception - Bus error (data)
Thread ID - 0x0496974F
Th Name - user_main
Module ID - 0x04971F43
Mod Name - "Screamwind"
EPC - 0x08809904
Cause - 0x1000001C
BadVAddr - 0x24A206D0
Status - 0x60088613
zr:0x00000000 at:0xDEADBEEF v0:0x00000000 v1:0x0880F95C
a0:0x08860000 a1:0x00000400 a2:0x0883713E a3:0x0896A5E6
t0:0x0896A5E8 t1:0x00000003 t2:0x0883667C t3:0x0896A5BC
t4:0x00000002 t5:0x00000000 t6:0x08860000 t7:0xDEADBEEF
s0:0x09FBFE08 s1:0x09FBFE34 s2:0x00000001 s3:0x09FBFEE0
s4:0x0000001A s5:0x00000013 s6:0xDEADBEEF s7:0xDEADBEEF
t8:0xDEADBEEF t9:0xDEADBEEF k0:0x09FBFF00 k1:0x00000000
gp:0x08849110 sp:0x09FBFDE8 fp:0x09FBFEA0 ra:0x088096B0
0x08809904: 0xAC430068 'h.C.' - sw $v1, 104($v0)
host0:/src/> reset
Resetting psplink
host0:/src/>
|
Hope you might help,
G43L
Last edited by G43L on Wed Nov 18, 2009 4:48 pm; edited 2 times in total |
|
| Back to top |
|
 |
jojojoris
Joined: 30 Mar 2008 Posts: 261
|
Posted: Wed Nov 18, 2009 4:47 pm Post subject: |
|
|
try this:
change
PSP_HEAP_SIZE_MAX();
to
PSP_HEAP_SIZE_KB(-2048);
So you have space to load the codec prxes.
Have you initalised the audio system? _________________
| Code: | int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
} |
|
|
| Back to top |
|
 |
G43L
Joined: 07 Nov 2009 Posts: 12
|
Posted: Wed Nov 18, 2009 4:51 pm Post subject: |
|
|
| jojojoris wrote: | try this:
change
PSP_HEAP_SIZE_MAX();
to
PSP_HEAP_SIZE_KB(-2048);
So you have space to load the codec prxes.
Have you initalised the audio system? |
I've tried PSP_HEAP_SIZE_KB(-2048) without success.
Yes, I init the audio system with oslInitAudio().
Thanks for your help,
G43L |
|
| Back to top |
|
 |
G43L
Joined: 07 Nov 2009 Posts: 12
|
Posted: Wed Nov 18, 2009 7:37 pm Post subject: |
|
|
| Code: |
host0:/src/> ./screamwind.prx
Load/Start host0:/src/screamwind.prx UID: 0x04971F47 Name: "Screamwind"
host0:/src/> Exception - Bus error (data)
Thread ID - 0x04969753
Th Name - user_main
Module ID - 0x04971F47
Mod Name - "Screamwind"
EPC - 0x08809904
Cause - 0x1000001C
BadVAddr - 0x24A206D0
Status - 0x60088613
zr:0x00000000 at:0xDEADBEEF v0:0x00000000 v1:0x0880F95C
a0:0x08860000 a1:0x00000400 a2:0x0883713E a3:0x0896A5E6
t0:0x0896A5E8 t1:0x00000003 t2:0x0883667C t3:0x0896A5BC
t4:0x00000002 t5:0x00000000 t6:0x08860000 t7:0xDEADBEEF
s0:0x09FBFE08 s1:0x09FBFE34 s2:0x00000001 s3:0x09FBFEE0
s4:0x0000001A s5:0x00000013 s6:0xDEADBEEF s7:0xDEADBEEF
t8:0xDEADBEEF t9:0xDEADBEEF k0:0x09FBFF00 k1:0x00000000
gp:0x08849110 sp:0x09FBFDE8 fp:0x09FBFEA0 ra:0x088096B0
0x08809904: 0xAC430068 'h.C.' - sw $v1, 104($v0)
|
By the way, can someone tell me which information is important in the the listing above?
G43L |
|
| Back to top |
|
 |
a_noob
Joined: 17 Sep 2006 Posts: 97 Location: _start: jr 0xDEADBEEF
|
Posted: Thu Nov 19, 2009 1:01 am Post subject: |
|
|
The EPC
run this in psplink
calc $epc-$mod
psp-addr2line -e youapp.elf (addr from calc)
and it will tell you the line of code you need to look at.
The problem is a bad pointer.
you have v0 as null then you are trying to reference v0 + 104 which is an invalid memory address. _________________
| Code: | .øOº'ºOø.
'ºOo.oOº' |
|
|
| Back to top |
|
 |
jojojoris
Joined: 30 Mar 2008 Posts: 261
|
Posted: Thu Nov 19, 2009 3:24 am Post subject: |
|
|
| a_noob wrote: | The EPC
run this in psplink
calc $epc-$mod
psp-addr2line -e youapp.elf (addr from calc)
and it will tell you the line of code you need to look at.
The problem is a bad pointer.
you have v0 as null then you are trying to reference v0 + 104 which is an invalid memory address. |
NOTE:
add -g to your cflags so it will include debugger information in the prx/elf if you don't see any usefull information in psp-addr2line _________________
| Code: | int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
} |
|
|
| Back to top |
|
 |
G43L
Joined: 07 Nov 2009 Posts: 12
|
Posted: Thu Nov 19, 2009 5:24 pm Post subject: |
|
|
| jojojoris wrote: | | a_noob wrote: | The EPC
run this in psplink
calc $epc-$mod
psp-addr2line -e youapp.elf (addr from calc)
and it will tell you the line of code you need to look at.
The problem is a bad pointer.
you have v0 as null then you are trying to reference v0 + 104 which is an invalid memory address. |
NOTE:
add -g to your cflags so it will include debugger information in the prx/elf if you don't see any usefull information in psp-addr2line |
OK, thank you for the explanation and the how to. I'll remember that for later...
I've been advised on another forum to use oslLoadSoundFileMP3 instead
of oslLoadSoundFile. Also, I've read in the lib documentation that oslInitAudioME(OSL_FMT_MP3) must be called before using this function.
And now, it works :)
G43L |
|
| Back to top |
|
 |
|