Which libraries does sceAudioSetFrequency need?
-
- Posts: 31
- Joined: Wed May 16, 2007 11:08 am
Which libraries does sceAudioSetFrequency need?
I´m trying to program using sceAudioSetFrequency, but the compiler always says:
main.c:(.text+0x21c0): undefined reference to `sceAudioSetFrequency'
collect2: ld returned 1 exit status
make: *** [Audio_Mechanica.elf] Error 1
I´m including <pspaudiolib.h>, <pspaudio.h> and <pspaudio_kernel.h>. I´ve been reading http://psp.jim.sh/pspsdk-doc/ : files -> file list -> pspaudio_kernel.h, and I thought these libraries would be enough :(
Thanks for the help ;)
main.c:(.text+0x21c0): undefined reference to `sceAudioSetFrequency'
collect2: ld returned 1 exit status
make: *** [Audio_Mechanica.elf] Error 1
I´m including <pspaudiolib.h>, <pspaudio.h> and <pspaudio_kernel.h>. I´ve been reading http://psp.jim.sh/pspsdk-doc/ : files -> file list -> pspaudio_kernel.h, and I thought these libraries would be enough :(
Thanks for the help ;)
You need to link pspaudio_driver
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
-
- Posts: 31
- Joined: Wed May 16, 2007 11:08 am
-
- Posts: 31
- Joined: Wed May 16, 2007 11:08 am
I´m working with 3.03 version... so, instead :
sceAudioSetFrequency(48000);
I should do something like:
sceKernelLoadExec(pathTo.PRX, NULL);
with the .prx compiled using cooleyes source code ?
Thanks ;)
Edit: I´ve tried loading .prx (that get compiling cooleyes´ code) with :
sceKernelLoadExec("./setfrequency/cooleyesAudio.prx", NULL);
and psp freezes when reach that line :(
I´ve never loaded any .prx so don´t know if doing the correct steps.
Any help, please?
sceAudioSetFrequency(48000);
I should do something like:
sceKernelLoadExec(pathTo.PRX, NULL);
with the .prx compiled using cooleyes source code ?
Thanks ;)
Edit: I´ve tried loading .prx (that get compiling cooleyes´ code) with :
sceKernelLoadExec("./setfrequency/cooleyesAudio.prx", NULL);
and psp freezes when reach that line :(
I´ve never loaded any .prx so don´t know if doing the correct steps.
Any help, please?
-
- Posts: 31
- Joined: Wed May 16, 2007 11:08 am
Ok, I´ve linked the pspaudio_driver. Now the program compiles ok, but when I start it using psplink get 0x80020001 error, and if put the eboot on psp´s "Game150" and launch, psp crashes and turn off. I´m using version 3.02 OE - B
The error is something about "kernel error", so maybe if dowgrade to 1.5 it´ll work fine. Don´t know. But, my question, isn´t psp suppose to run the program on kernel mode if I put it on "Game150" directory?
The error is something about "kernel error", so maybe if dowgrade to 1.5 it´ll work fine. Don´t know. But, my question, isn´t psp suppose to run the program on kernel mode if I put it on "Game150" directory?
Only if you've programmed it to be kernel mode app. If you write it to be a 3.xx user mode app, you need to put it in GAME3xx or GAME with the kernel mode set to 3xx in the recovery menu.PeterLeRoi wrote:Ok, I´ve linked the pspaudio_driver. Now the program compiles ok, but when I start it using psplink get 0x80020001 error, and if put the eboot on psp´s "Game150" and launch, psp crashes and turn off. I´m using version 3.02 OE - B
The error is something about "kernel error", so maybe if dowgrade to 1.5 it´ll work fine. Don´t know. But, my question, isn´t psp suppose to run the program on kernel mode if I put it on "Game150" directory?
You don't seem to get what I meant in my first reply. Read this thread entirely:
http://forums.ps2dev.org/viewtopic.php?t=9022
-
- Posts: 31
- Joined: Wed May 16, 2007 11:08 am
Thanks for your help J.F.
I´ve changed the attributes on PSP_MODULE_INFO, now I run the program on kernel mode.
The program compiles, but when I´m running it everything is fine until it reachs
sceAudioSetFrequency(48000);
at this line, psp freezes and turns off.
This is the error:
I thought: "Ok, I´ll read again the doc about this instruction". And my surprise, if look at "user audio library" on
http://www.geardome.com/pspsdk-doc/
it doesn´t appear, but if look on
http://psp.jim.sh/pspsdk-doc/
then the function appears.
Why? (the error or the appearing/dissapearing fuction)
Thanks again :)
I´ve changed the attributes on PSP_MODULE_INFO, now I run the program on kernel mode.
The program compiles, but when I´m running it everything is fine until it reachs
sceAudioSetFrequency(48000);
at this line, psp freezes and turns off.
This is the error:
Code: Select all
Opening connection to localhost port 10000
host0:/> ./Audio_Mechanica.elf
Load/Start host0:/Audio_Mechanica.elf UID: 0x044C3C65 Name: Virtual Tape Recorder
host0:/> Exception - Bus error (instr)
Thread ID - 0x0448ED71
Th Name - user_main
EPC - 0x080C2764
Cause - 0x10000018
BadVAddr - 0x08001080
Status - 0x20008613
zr:0x00000000 at:0x0008FF00 v0:0x00000000 v1:0x00000000
a0:0x0000BB80 a1:0x00000000 a2:0x88224898 a3:0x00000000
t0:0x00000000 t1:0x0000133F t2:0x20008600 t3:0x882FFA00
t4:0x09FFEDF8 t5:0x00000E00 t6:0x08902218 t7:0x00008600
s0:0x00070000 s1:0x08910000 s2:0x00000001 s3:0x00000100
s4:0x08910000 s5:0x08910000 s6:0x09F20000 s7:0x08910000
t8:0x00000000 t9:0x880BF5B0 k0:0x09FFEF00 k1:0x00000000
gp:0x0891A950 sp:0x09FFEDF8 fp:0x09FFEEA0 ra:0x08902220
http://www.geardome.com/pspsdk-doc/
it doesn´t appear, but if look on
http://psp.jim.sh/pspsdk-doc/
then the function appears.
Why? (the error or the appearing/dissapearing fuction)
Thanks again :)
Regarding the error, it's not clear from the error where the problem lies; build your code with debugging symbols and run psp-addr2line on the EPC to find out which instruction is actually failing.
Regarding the docs, psp.jim.sh is updated daily, and the geardome.com site is just an old mirror of that.
Regarding the docs, psp.jim.sh is updated daily, and the geardome.com site is just an old mirror of that.
-
- Posts: 31
- Joined: Wed May 16, 2007 11:08 am
Thanks for your help jimparis
About the error, I didn´t explain it before, the program works without this instruction, but I need to add it. So I wrote the program:
If press L trigger, then it´ll run sceAudioSetFrequency in order to change frequency to 48000.
If don´t press L trigger, program works fine, can record and play sounds at 44100 Hz. Everything´s correct. But when press L trigger psp freezes, I´m 100% sure it´s related to that function.
About the error, I didn´t explain it before, the program works without this instruction, but I need to add it. So I wrote the program:
If press L trigger, then it´ll run sceAudioSetFrequency in order to change frequency to 48000.
If don´t press L trigger, program works fine, can record and play sounds at 44100 Hz. Everything´s correct. But when press L trigger psp freezes, I´m 100% sure it´s related to that function.
-
- Posts: 31
- Joined: Wed May 16, 2007 11:08 am
Thanks for your help :)
I´ve started programming psp recently and don´t have much time, so don´t want my program works for any version specifically, if it works only on 1.5 it´ll be enough.
This afternoon I´ll downgrade to 1.5 and check if then the program can run.
Edit: tried on 1.5 and the same result :(
Maybe I´m forgetting something:
and Makefile:
Don´t know how to make Makefiles well, so I´m using Audio Mechanica´s Makefile with some changes :(
I´ve started programming psp recently and don´t have much time, so don´t want my program works for any version specifically, if it works only on 1.5 it´ll be enough.
This afternoon I´ll downgrade to 1.5 and check if then the program can run.
Edit: tried on 1.5 and the same result :(
Code: Select all
Opening connection to localhost port 10000
host0:/> ./Audio_Mechanica.elf
Load/Start host0:/Audio_Mechanica.elf UID: 0x0449F847 Name: Virtual Tape Recorde
r
host0:/> Exception - Bus error (instr)
Thread ID - 0x04490D53
Th Name - user_main
EPC - 0x080C2764
Cause - 0x00000018
BadVAddr - 0x80010050
Status - 0x20008613
zr:0x00000000 at:0x0008FF00 v0:0x00000000 v1:0x00000000
a0:0x0000BB80 a1:0x00000000 a2:0x88224998 a3:0x00000000
t0:0x00000000 t1:0x0001B9ED t2:0x20008600 t3:0x882FFA00
t4:0x09FFEDF8 t5:0x00000E00 t6:0x08902218 t7:0x00008600
s0:0x00070000 s1:0x08910000 s2:0x00000001 s3:0x00000100
s4:0x08910000 s5:0x08910000 s6:0x09F20000 s7:0x08910000
t8:0x00000000 t9:0x880107E0 k0:0x09FFEF00 k1:0x00000000
gp:0x0891A950 sp:0x09FFEDF8 fp:0x09FFEEA0 ra:0x08902220
reset
Resetting psplink
host0:/>
Code: Select all
#include "pspaudio_kernel.h"
...
PSP_MODULE_INFO("Virtual Tape Recorder", PSP_MODULE_KERNEL, 1, 1);
...
int main(int argc, char* argv[]){
...
sceCtrlReadBufferPositive(&pad, 1);
...
case DETECTA_L:
printf("\nChanging frec");
sceAudioSetFrequency(48000);
printf("\nFreq changed OK");
sceKernelDelayThread(500000);
break;
....
Code: Select all
TARGET = Audio_Mechanica
OBJS = logging.o psp_audio_ext.o file_browser.o main.o
INCDIR := ./include
CFLAGS = -O2 -G0 -Wall -g
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
LIBS = -lpspaudiolib -lpspaudio -lpspaudio_driver
EXTRA_TARGETS = EBOOT.PBP kxploit
PSP_EBOOT_TITLE = Audio Mechanica
EXTRA_CLEAN = clean_kxploit
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
copy:
cp -r __SCE__${TARGET} /media/psp/psp/GAME/
cp -r %__SCE__${TARGET} /media/psp/psp/GAME/
Last edited by PeterLeRoi on Fri Nov 16, 2007 2:11 am, edited 1 time in total.
-
- Posts: 31
- Joined: Wed May 16, 2007 11:08 am
-
- Posts: 31
- Joined: Wed May 16, 2007 11:08 am
Ok, as I can´t get sceAudioSetFrequency working on my program, I´ve taken a "hello world" (main.c and Makefile):
1. link pspaudio_driver, pspaudio and pspaudiolib
2. add -g to CFLAGS on makefile
3. add #include <pspaudio_kernel.h>, #include <pspaudio.h>, #include <pspaudiolib.h> to main.c
4. changed PSP_MODULE_INFO´s mode attribute to 0x1000
and 5. added just one instruction sceAudioSetFrequency(48000)
And the result:
and if try:
Don´t know more things to try :( The EPC is the same, it doesn´t matter if using Hello world or audio mechanica
Thanks for your infinite patience :D (and sorry for my bad English)
1. link pspaudio_driver, pspaudio and pspaudiolib
2. add -g to CFLAGS on makefile
3. add #include <pspaudio_kernel.h>, #include <pspaudio.h>, #include <pspaudiolib.h> to main.c
4. changed PSP_MODULE_INFO´s mode attribute to 0x1000
and 5. added just one instruction sceAudioSetFrequency(48000)
And the result:
Code: Select all
host0:/> ./hello.elf
Load/Start host0:/hello.elf UID: 0x044C5635 Name: Hello World
host0:/> Exception - Bus error (instr)
Thread ID - 0x04492C41
Th Name - user_main
EPC - 0x080C2764
Cause - 0x00000018
BadVAddr - 0xA0144848
Status - 0x20008613
zr:0x00000000 at:0x0008FF00 v0:0x0000000B v1:0x08910000
a0:0x0000BB80 a1:0x089103E7 a2:0xFFFFFFFF a3:0x44004118
t0:0x00000008 t1:0x00000001 t2:0x00000000 t3:0x44003918
t4:0x09FFEE20 t5:0x00000E00 t6:0x08900384 t7:0x00008600
s0:0x00000011 s1:0x09FFEE34 s2:0x00000001 s3:0x09FFEEE0
s4:0x00000011 s5:0x00000013 s6:0xDEADBEEF s7:0xDEADBEEF
t8:0x00000000 t9:0x88224888 k0:0x09FFEF00 k1:0x00000000
gp:0x08919370 sp:0x09FFEE28 fp:0x09FFEEA0 ra:0x089003C4
Code: Select all
Peter@pete /cygdrive/e/Uni/PSP/Hola mundo de pruerba
$ psp-addr2line.exe -fe hello.elf 0x080C2764
??
??:0
Thanks for your infinite patience :D (and sorry for my bad English)