PDA

View Full Version : streaming audio in xmb


fuzzzzy
06-02-2007, 10:20 PM
Ive tried a few things now, but i simply want to try and a play a test mp3 in the xmb. When I try it keeps on freezing. Here is my code:


#include <pspkernel.h>
#include <pspaudio.h>
#include <pspaudiolib.h>
#include <psppower.h>

#include "mp3player.h"

PSP_MODULE_INFO("voice", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(0);

PSP_HEAP_SIZE_KB(1000);

int main_thread(SceSize args, void *argp) {

sceKernelDelayThread(30000000);

scePowerSetClockFrequency(333, 333, 166);
//pspAudioInit();


MP3_Init(1);
MP3_Load("ms0:/test.mp3");

MP3_Play();
while(MP3_EndOfStream() !=1) {}
MP3_Stop();

MP3_FreeTune();

sceKernelSleepThread();

return 0;

}


int module_start(SceSize args, void *argp) {

int thid;

/* Create a high priority thread */
thid = sceKernelCreateThread("voice", main_thread, 0x18, 0x1000, 0, NULL);//8, 64*1024, PSP_THREAD_ATTR_USER, NULL);
if(thid >= 0) sceKernelStartThread(thid, args, argp);

return 0;
}



And the makefile:



TARGET = voice
OBJS = mp3player.o main.o
BUILD_PRX = 1

INCDIR =
LIBDIR =
LIBS = -lmad -lpspaudiolib -lpspaudio -lpsppower
LDFLAGS =
CFLAGS = -Os -G0 -Wall -g
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

PSPSDK = $(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build_prx.mak

exports:
psp-build-exports -s exports.exp



Thnx in advance :) :) :) :) :) :) :) :) :) :)

SpectroPlasm
06-12-2007, 07:06 AM
um wouldn't it be just easier to tweak the already included mp3 player of the PSP to allow streaming?, i mean a lot of stuff has already been done for it including ingame mp3 audio.


#include <pspkernel.h>
#include <pspaudio.h>
#include <pspaudiolib.h>
#include <psppower.h>

#include "mp3player.h"

PSP_MODULE_INFO("voice", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(0);

PSP_HEAP_SIZE_KB(1000); <-------change this value to 1024 to avoid overhead

int main_thread(SceSize args, void *argp) {

sceKernelDelayThread(30000000);

scePowerSetClockFrequency(333, 333, 166); <---- you should start out with nominal frequencies in order to avoid pitch problems try the original 266 266 133 values
//pspAudioInit();


MP3_Init(1);
MP3_Load("ms0:/test.mp3"); try loading a >1024mb file to see how it handles it, then move on to higher size files, this is important because RAM is precious and once it's out you'll end up with problems or lock ups

MP3_Play();
while(MP3_EndOfStream() !=1) {}
MP3_Stop();

MP3_FreeTune();

sceKernelSleepThread();

return 0;

}


int module_start(SceSize args, void *argp) {

int thid;

/* Create a high priority thread */
thid = sceKernelCreateThread("voice", main_thread, 0x18, 0x1000, 0, NULL);//8, 64*1024, PSP_THREAD_ATTR_USER, NULL);
if(thid >= 0) sceKernelStartThread(thid, args, argp);

return 0;
}


hope those little bits help ya out, anyhow someon will be around to help out more on this matter.

Jeroenskypsp
07-08-2007, 06:44 PM
Just use a RSS2.0 feed for streaming images+audio from computer -> PSP and download video from computer -> PSP.

Works the fastest if computer & PSP are on the same wlan (802.11b bandwith), but it also works by the internet, so that you can enjoy the media on your computer at home, and with your PSP (or other device) anywhere on the world, with a internet connectoin(WiFi B cloud).

Here the specs to make your own PSP compatible rss2.0feed.xml file (http://www.playstation.com/manual/psp/rss/en/spec.html).
Advice: copy the "Sample rss document" to the texteditor, and change the text to your data storage place/ that's shared by the http-server software (http://httpd.apache.org/download.cgi).(on wlan or on wan/www(remember to forward http-server port 80)).
Also make a index.html with a link to the rss2.0feed.xml file that you edited and saved with your texteditor.(vim or notepad). Remember to use the same main title in the html and xml file.

My sigs shows that it works.(you may copy/download the media page html/xml/m3u for edit purposes, to start your own feed, but remove/edit my url's/domains in the html/xml/m3u files before you start hosting, afcourse with a easy texteditor, remember to save the correct extension and use PSP compatible files in the RSS items !)

Here a example of how a rss2.0 feed with mp3 items looks on a PSP:
http://www.oreillynet.com/users/files/88289/SonyPSPMusicFeed.JPG
And here the official PSP RSS (http://manuals.playstation.net/document/en/psp/current/network/rss/index.html) help.
Now i'll continue my hangover...

Jeroenskypsp
02-20-2009, 08:27 PM
Just a rss feed update don't use the & in a feed, otherwise it can't be added by the PSP , with any firmware.

Ok here a link about howto create your own RSS2.0 PSP feed (http://community.eu.playstation.com/playstationeu/board/message?board.id=bANZ_PSP_general&thread.id=738). (us site (http://boardsus.playstation.com/playstation/board/message?board.id=pspmedia&view=by_date_ascending&message.id=313956#M313956))

i know a bit late, but i discovered the RSS "&" bug just a week ago. And now we got a nice link to some typework i did on original PSP site.
it's easy to create your own PSP compatible RSS2.0 feed, worldwide accessable.