System Extension (v0.5,cpu,elf loading,mp3,zip)

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

matriculated
Posts: 31
Joined: Sat Mar 04, 2006 1:35 am

Post by matriculated »

thanks buddy!
cools
Posts: 46
Joined: Sat Mar 04, 2006 12:57 pm

Post by cools »

I cant seem to get ogg to work. Can someone post an example if they got ogg working? Thanks!
Last edited by cools on Tue Sep 26, 2006 12:49 pm, edited 1 time in total.
razorrifh
Posts: 23
Joined: Sat Jun 04, 2005 2:15 am
Location: Penn State
Contact:

Post by razorrifh »

cools wrote:I cant seem ogg to work. Can someone post an example if they got ogg working? Thanks!
not sure if i'm just using it wrong or what, but i couldnt get this to work at all. i tried everything i could think of (i put the lrx file in about 5 locations, all at once, i messed around with the variables in the loadlib call, tried sysext.quit/System.quit() in about 10 different combinations...).

i have a feeling its something simple but it's bested me... for the night anyways :D

heres my test code:

Code: Select all

sysext = loadlib("sysext","init")
if sysext then sysext() end

System.usbDiskModeActivate()

green = Color.new(0, 255, 0)
yellow = Color.new(255, 255, 0)
cyan = Color.new(0, 255, 255)

oldpad = Controls.read()

System.quit()

while true do



        pad = Controls.read()


	if pad:start() and oldpad:start() ~= pad:start() then
 		break
	end


  	oldpad = pad

      	screen.waitVblankStart()
  	screen.flip()
end
Mesmer
Posts: 9
Joined: Sun Sep 24, 2006 6:42 pm

Post by Mesmer »

put the

System.quit()

after your while loop

I havn't have time to test this personally, but yeah.

it should be after.

`Mesmer
razorrifh
Posts: 23
Joined: Sat Jun 04, 2005 2:15 am
Location: Penn State
Contact:

Post by razorrifh »

the error message is "Error: index.lua:12: attempt to call field 'quit' (a nil value)"

think this means that the function isnt found so its bein returned null/nil so it shouldnt matter where it is in the code.
cools
Posts: 46
Joined: Sat Mar 04, 2006 12:57 pm

Post by cools »

While i was messing around with it, it would run this code:

Code: Select all

sysext = loadlib("sysext","init")
if sysext then sysext() end
Ogg.init()
Ogg.load("test.ogg")
Ogg.play()
while true do
if Controls.read():start() then break end
screen:clear()
screen:print(0,0,"Ogg Test",Color.new(255,255,255))
screen.flip()
screen.waitVblankStart()
end
but it wouldnt playback the ogg file and eventually turned off the psp.

Also whenever i attempted to call Ogg.end() it would give me an error message...

The system functions work.
be2003
Posts: 144
Joined: Thu Apr 20, 2006 2:46 pm

long time...

Post by be2003 »

sorry i havent been on in a while, i had alot going on, but some people seem to want mp3, so i made an mp3player.lrx real quick and i need some people to test it out...

about the ogg... im about 100% sure that it is broken

and about the System.Quit(), it works... the "Q" in quit MUST be capitalized... lua is anal like that, you were putting System.quit()

all lrx files you want to use must be in the same directory as the EBOOT.PBP
so for me it is: "ms0:/PSP/GAME/LUAPLAYER/"

i will try and get ogg working if anyone still wants it since i just made an mp3 player... but seriously, i need feedback on the mp3 player

p.s. ignore the zip support, it was just a test and i completely sucked at it!

http://www.angelfire.com/blog/dev-be2003/mp3player.lrx
you may have to right click and "Save as" if right clicking doesnt work
- be2003
blog
razorrifh
Posts: 23
Joined: Sat Jun 04, 2005 2:15 am
Location: Penn State
Contact:

Re: long time...

Post by razorrifh »

thanks for that. i didnt even realize that the "Q" was capitalized on the readme. i need to learn how to read before i can rtfm i guess.
be2003 wrote:... but seriously, i need feedback on the mp3 player
i may not be the best person to test this out, because i'm having problems again... using this code:

Code: Select all

sysext = loadlib("mp3player","init")

if sysext then mp3player() end

Mp3.init()
Mp3.load("g.mp3")
Mp3.play()

while true do
  if Controls.read():start() then break end

  screen:clear()

  screen:print(0,0,"Mp3 Test",Color.new(255,255,255))

  screen.flip() 
  screen.waitVblankStart() 
end
it just freezes and i have to reboot the psp. i'm thinking i'm having a problem with the first two lines but ive tried a few different combinations (i cant find any documentation on the loadlib function from the lua player wiki or anywhere else for that matter):
sysext = loadlib("mp3player","init")
if sysext then mp3player() end
i changed the first "mp3player" to mp3player because i figure thats the lrx name. and i figured the second "mp3player" is the name of the function that needs to be called to initialize the lrx (like the main function in c programming). i also tried the second "mp3player" being called "sysext" cuz i figured you just renamed the file but didnt change the names when you compiled it. oh well. sorry i couldnt be more help. hope its not me just goofing it up again :D

edit: ps, my mp3 file is 6.37 MB (6,680,344 bytes), 04:15 mm:ss, 320 kbps, 44khz, 2 channel audio.
cools
Posts: 46
Joined: Sat Mar 04, 2006 12:57 pm

Post by cools »

I tried using this in a few different ways, none of them would work properly.

Also libmad has some restrictions, like filesize (I think it is supposed to be under 2mb), bitrate (below 128kbs i think), there might others. But if you used a custom libmad, then there wont be those limitations.

I tried files both within and not within the restrictions. It didnt work.
be2003
Posts: 144
Joined: Thu Apr 20, 2006 2:46 pm

Post by be2003 »

damn, it should have... idk
try this...

Code: Select all

mp3player = loadlib("mp3player","init")
if mp3player then mp3player() end

Mp3.play("test.mp3")

while true do
     if Controls.read():start() then
          Mp3.stop()
          break
     end
     screen:clear()
     screen.print(5,5,"MP3 PLAYIZZLE!",Color.new(255,255,255))
     screen.waitVblankStart()
     screen.flip()
end
i changed the mp3 a bit...
Mp3.play("filename") plays the filename... like "test.mp3"
Mp3.pause() pauses it
Mp3.resume() resumes it
Mp3.stop() stops and unloads it... call this before you exit, frees up memory and stops playing the music, etc...
Mp3.finished() returns 1 if it is done and 0 if it isnt :)

hope this works instead, sorry for not including the new instuctions
- be2003
blog
razorrifh
Posts: 23
Joined: Sat Jun 04, 2005 2:15 am
Location: Penn State
Contact:

Post by razorrifh »

be2003 wrote:hope this works instead, sorry for not including the new instuctions
i cant get this to run

Code: Select all

mp3player = loadlib("mp3player","init")
if mp3player then mp3player() end 

--Mp3.play("test.mp3")

while true do 
     if Controls.read():start() then 
          -- Mp3.stop() 
          break 
     end 
     screen:clear() 
     screen.print(5,5,"MP3 PLAYIZZLE!",Color.new(255,255,255)) 
     screen.waitVblankStart() 
     screen.flip() 
end
i tried a few different combinations such as loading it with lowser/without and removing the sysext.lrx module from the modules directory. doesnt seem to want to work. got any other ideas?
cools
Posts: 46
Joined: Sat Mar 04, 2006 12:57 pm

Post by cools »

It doesnt seem to like the Mp3 part... I also tried mp3, MP3, and mP3 but neither of them worked.
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

Strange answer. Try loadlib("mp3player.lrx","init")

or even it might be the path thats messed up. Check your paths.. first..
cools
Posts: 46
Joined: Sat Mar 04, 2006 12:57 pm

Post by cools »

If i just do the loadlib part by itself it works.

just

Code: Select all

mp3player = loadlib("mp3player","init")
if mp3player then mp3player() end
That works.

If I add in an Mp3.play("test.mp3") it returns the error:

attempt to index global `Mp3` (a nil value)
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

Sysext by be2003 for Luaplayer

-----------------------------------
version 0.6
-----------------------------------
MP3 ABOLISHED! lol, just switched to ogg, yup, i'm serious.

umm... here we go:

Added:

Ogg.init() initializes ogg player
Ogg.play() plays the loaded ogg
Ogg.pause() pauses loaded ogg
Ogg.stop() stops loaded ogg
Ogg.end() ends loaded ogg
Ogg.load(file) loads file as ogg (relative to current path)
Ogg.freeTune() removes loaded ogg from ram
Ogg.getTimeString() call like this 'oggtime = Ogg.getTimeString()' it returns time of ogg in HH:MM:SS form as a string or do:

screen.print(5,5,Ogg.getTimeString(),green) --sample

Ogg.endOfStream() return true if the ogg is over, false if it isnt
cools
Posts: 46
Joined: Sat Mar 04, 2006 12:57 pm

Re: long time...

Post by cools »

be2003 wrote:...
i will try and get ogg working if anyone still wants it since i just made an mp3 player... but seriously, i need feedback on the mp3 player
...
A More recent quote frim be2003 about mp3.
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

It crashes when I load the module.
be2003
Posts: 144
Joined: Thu Apr 20, 2006 2:46 pm

Post by be2003 »

damn its been a while since i have done this... i will check out the mp3 player's source and make sure the makefile and exports.exp are ok, but the code looks straight forward. if some more experienced devs want to look at the source just tell me. it is based on the source from psp mediacenter
- be2003
blog
Nems
Posts: 2
Joined: Wed Oct 04, 2006 4:40 am

Post by Nems »

What's up?
There is some news about this wonderfull idea ?
Nems
Posts: 2
Joined: Wed Oct 04, 2006 4:40 am

Post by Nems »

Hellooo ??
Be2003 are you here ?
Post Reply