forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

System Extension (v0.5,cpu,elf loading,mp3,zip)
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
matriculated



Joined: 04 Mar 2006
Posts: 31

PostPosted: Sun Sep 24, 2006 1:11 pm    Post subject: Reply with quote

thanks buddy!
Back to top
View user's profile Send private message
cools



Joined: 04 Mar 2006
Posts: 46

PostPosted: Mon Sep 25, 2006 8:32 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
razorrifh



Joined: 04 Jun 2005
Posts: 23
Location: Penn State

PostPosted: Mon Sep 25, 2006 5:53 pm    Post subject: Reply with quote

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:
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
Back to top
View user's profile Send private message Visit poster's website
Mesmer



Joined: 24 Sep 2006
Posts: 9

PostPosted: Tue Sep 26, 2006 9:25 am    Post subject: Reply with quote

put the

System.quit()

after your while loop

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

it should be after.

`Mesmer
Back to top
View user's profile Send private message
razorrifh



Joined: 04 Jun 2005
Posts: 23
Location: Penn State

PostPosted: Tue Sep 26, 2006 11:02 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
cools



Joined: 04 Mar 2006
Posts: 46

PostPosted: Tue Sep 26, 2006 12:51 pm    Post subject: Reply with quote

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

Code:

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.
Back to top
View user's profile Send private message
be2003



Joined: 20 Apr 2006
Posts: 144

PostPosted: Thu Sep 28, 2006 12:57 pm    Post subject: long time... Reply with quote

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
Back to top
View user's profile Send private message
razorrifh



Joined: 04 Jun 2005
Posts: 23
Location: Penn State

PostPosted: Thu Sep 28, 2006 1:49 pm    Post subject: Re: long time... Reply with quote

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:
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):
Quote:
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.
Back to top
View user's profile Send private message Visit poster's website
cools



Joined: 04 Mar 2006
Posts: 46

PostPosted: Fri Sep 29, 2006 6:13 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
be2003



Joined: 20 Apr 2006
Posts: 144

PostPosted: Fri Sep 29, 2006 12:52 pm    Post subject: Reply with quote

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

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
Back to top
View user's profile Send private message
razorrifh



Joined: 04 Jun 2005
Posts: 23
Location: Penn State

PostPosted: Fri Sep 29, 2006 11:06 pm    Post subject: Reply with quote

be2003 wrote:
hope this works instead, sorry for not including the new instuctions


i cant get this to run
Code:
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?
Back to top
View user's profile Send private message Visit poster's website
cools



Joined: 04 Mar 2006
Posts: 46

PostPosted: Sat Sep 30, 2006 5:30 am    Post subject: Reply with quote

It doesnt seem to like the Mp3 part... I also tried mp3, MP3, and mP3 but neither of them worked.
Back to top
View user's profile Send private message
romero126



Joined: 24 Dec 2005
Posts: 200

PostPosted: Sat Sep 30, 2006 5:35 am    Post subject: Reply with quote

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

or even it might be the path thats messed up. Check your paths.. first..
Back to top
View user's profile Send private message
cools



Joined: 04 Mar 2006
Posts: 46

PostPosted: Sat Sep 30, 2006 6:15 am    Post subject: Reply with quote

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

just
Code:
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)
Back to top
View user's profile Send private message
romero126



Joined: 24 Dec 2005
Posts: 200

PostPosted: Sat Sep 30, 2006 6:36 am    Post subject: Reply with quote

Quote:
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
Back to top
View user's profile Send private message
cools



Joined: 04 Mar 2006
Posts: 46

PostPosted: Sat Sep 30, 2006 6:48 am    Post subject: Re: long time... Reply with quote

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.
Back to top
View user's profile Send private message
romero126



Joined: 24 Dec 2005
Posts: 200

PostPosted: Sat Sep 30, 2006 6:57 am    Post subject: Reply with quote

It crashes when I load the module.
Back to top
View user's profile Send private message
be2003



Joined: 20 Apr 2006
Posts: 144

PostPosted: Mon Oct 02, 2006 1:44 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Nems



Joined: 04 Oct 2006
Posts: 2

PostPosted: Wed Oct 18, 2006 2:58 am    Post subject: Reply with quote

What's up?
There is some news about this wonderfull idea ?
Back to top
View user's profile Send private message
Nems



Joined: 04 Oct 2006
Posts: 2

PostPosted: Sat Oct 21, 2006 10:07 pm    Post subject: Reply with quote

Hellooo ??
Be2003 are you here ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group