PDA

View Full Version : Ogg streaming--does it exist for the PSP already? (Or should I just make it exist?)



NineByNine
June 23rd, 2008, 16:40
Hey. I've been looking around for a homebrew app to play streaming ogg (as opposed to just from local files) on a PSP, and can't seem to find this. Got to thinking I should just see if I can make one happen (I've got the toolchain up and running, ogg libraries built, found some nice source already that wraps up the file-based code neatly), and have been building scratch apps and inspecting existing headers 'n stuff toward this), but thought I'd do the sanity check here, first: has anyone already done this, before I seriously get into it?

(Standard newbie apologies go here if this is in some damned FAQ I didn't find, but hand on whichever holy book you repect, I searched mightily, found nothin'... so please point it out if I missed.)

Oh... and yes, I know you can do this with transcoding apps on a PC proxying and passing it along in something the PSP already does... That's nice for home, but I want to do something that just takes the stream directly, turns it into audio on the PSP itself. Vastly more practical for travelling, which is my intent. So, the idea is: something like freeradio (which is awesome at what it does, but so far as I can see, doesn't do this)--so if you've got a wireless hub in range and a stream address, you get yer audio).

Thanks in advance, love the forum, etc.

yaustar
June 24th, 2008, 00:48
Ogg streaming--does it exist for the PSP already?
Good question, I can't remember any off the top of my head. Most use MP3 because of PSP hardware support and doesn't take a hit on the the CPU.

NineByNine
June 24th, 2008, 06:17
Thanks; appreciated.

I've gone ahead and started to stick some buffered http retrieval stuff into the existing (file-based) player examples I've got sitting around. Far as I can tell, it hasn't been done. I figure it's worth my giving it a bit of time. There's a few stations I want to listen to that webcast that way.

The Vorbis s/w decoder stuff works fine on my machine when reading from the filesystem--doesn't look like it stresses the processor much on its own. What's gonna happen when it's working on the http connection stuff at the same time, well, I guess we'll see.

NineByNine
June 26th, 2008, 16:05
So between bouts of doing the stuff I'm actually paid to do, I made a little more progress on this, last few days.

I wasted a bit of time--or it sure looks like it was a waste--trying to do the transport with the sceHttp* stuff for built-in http handling, and it looks like that's not gonna fly--seems the Icecast servers serving vorbis streams get peeved at the Connection: close header that layer insists on sending. I was able to get it to get rid of other extraneous stuff, but that one won't go away (if anyone knows if that layer can be talked out of it, this would be useful). So I've gone to doing it with raw sockets--which is looking more promising, generally.

Current best guess is this is very doable. Hopin' to have somethin' in another week or so, if work/family allow.

NineByNine
June 26th, 2008, 16:10
Actually, that reminds me:

Anyone know if there's a libcurl for PSP around somewhere? And where? I've seen forum posts alluding to its existing, but I can't seem to find it in subversion. Figure it'd save me some trouble--I know you can do this kind of transport with that lib on other platforms, anyway.

^^^^Never mind. I found a nice, portable very lightweight http lib designed for embedded use that I can get to do my bidding.

NineByNine
June 30th, 2008, 20:16
So I can emphatically confirm the hardware is up to this. Easily. Tho' I guess it shouldn't be huge surprise, for a machine that can do video like this can...

I got it working on my lunch today, and am currently listening to a 44.1 KHz stereo stream off of CBC Radio 2...It sounds positively lush through the PSP. I also tested it against an IceCast2 server install I'd set up for the purpose; all sounds good. Still got some work to do; the current version deals poorly with seeking to a new stream, and not at all with mono streams, but it should all be fixable. (And, of course, it's got no GUI of any kind, as yet.)

It was pretty much just the obvious thing: I'm using libTremor for the decode, wrote a simple threaded http client (wound up just doing the http wrapping stuff myself--was easier than messing with libraries) that just dumps into a circular buffer for the decoder thread (which is just triggered by the pspaudiolib callback).

Golem
July 2nd, 2008, 04:46
NineByNine,

My wife just bought a PSP specifically for Internet radio. She is a CBC radio 1 fanatic. I have tried to get the PSP to play CBC through the Shoutcast Internet radio tuner but can't find it, probably because it isn't available through Shoutcast. If my wife can't get CBC through the PSP, she will return the PSP to Future Shop. She doesn't want to do the CBC podcast thing. Would you please post how you got CBC Radio 2 streaming broadcast working on the PSP?

NineByNine
July 2nd, 2008, 19:15
You've a few options, the way I understand it (and note that I'm no authority on this, generally, but I can probably point you in the right direction...)

1. If you've a PS3, you can use remote play. My understanding is the PS3 will pick up a WMA stream (which CBC sends in), and have it resend it to the PSP... This is the 'official' way. (Note: I don't do it the official way even though I have a PS3 because I want to be able to get the stream even when I'm nowhere near my PS3, like in a hotel somewhere on business).

2. If you've somewhere you can set up an icecast server or similar, you can do it that way: set up the icecast server to rebroadcast CBC as an MP3 stream, and then use a homebrew app like FreeRadio to read the stream from there. Note that since FreeRadio doesn't do WMA, and CBC doesn't broadcast directly in MP3, you again need that server in the middle. A bit of a pain, again, but doable. Note also, however, that you'd have to homewbrew your wife's PSP to do this... not sure how she'd feel about it, as it is a bit of a step. If you know noone with one already set up like that, you pretty much have to do the hardware mod--which I've done--it just involves sawing a pin off one IC in a battery--but it's not quite trivial. Google Pandora's battery for more. Note also that by this method, you happen to be able to get CBC Radio 3 (the sorta youth/alt version) directly in FreeRadio, as it broadcasts via MP3, tho' you have to hunt around a bit for the link... I can send it, if this is interesting... annoyingly, CBC Radio One and Two only do WMA and ogg, so you have to resend them...

3. If you're homebrewing anyway, and don't mind trying alpha code, I do now have this thing I've just built and which works fine for me: reads the CBC Radio One and Two streams (a Toronto station which supports Ogg/Vorbis) directly. Works fine for both, still a bit unstable, tho' once it's reading, it's reading--I've used it for hours at a time. I'm planning on releasing the code and binaries shortly, anyway, so I'm happy to have a tester, if you're going that route... (Standard legal disclaimers go here: alpha code, may not be fit, homebrewing has some modest hazards, yadda yadda).

NineByNine
July 2nd, 2008, 19:20
Oh.. .wait... I lie re remote play. It looks like you should be able to use it from anywhere, once it's set up. But again, I haven't done this, don't know that much about it. Went the homebrew route, myself. Again, might be an option if you've no PS3.

NineByNine
July 2nd, 2008, 19:29
Additional updates to this (as yet unseen) app, in case anyone's interested, done on and off over last few days:

1. Added support for 22050 Hz mono streams.

2. Added a simple stream list faciity--you define the stream URLs in a text file you stick in there with the binary, then it lets you pick from them at startup.

3. Switched to the actual floating point Ogg/Vorbis (as opposed to integer Tremor) libs, as I found Tremor went to pieces whenever it hit a new logical bitstream in the same broadcast. Ogg/Vorbis handles this seamlessly which is nice, which allows you to listen to the playlists that are sent this way (including the typical icecast streaming ogg setup you would probably have on a home server).

Open issue, if anyone knows the resolution: in the wireless hub selection dialogue, the thing intermittently freezes right after you select the connection profile. It's all good if it gets past the first half second. Anyone know what the hell that is? I use WPA and DHCP on my hub, if that tells you anything.

Thing still sounds lovely, as it is. And yes, the PSP seems more than up to doing this in floating point, even on 128 kbps stereo streams. I've tried it; there's nary a hiccup.

Golem
July 2nd, 2008, 19:51
You've a few options, the way I understand it (and note that I'm no authority on this, generally, but I can probably point you in the right direction...)

1. If you've a PS3, you can use remote play. My understanding is the PS3 will pick up a WMA stream (which CBC sends in), and have it resend it to the PSP... This is the 'official' way. (Note: I don't do it the official way even though I have a PS3 because I want to be able to get the stream even when I'm nowhere near my PS3, like in a hotel somewhere on business).


I don't own a PS3


2. If you've somewhere you can set up an icecast server or similar, you can do it that way: set up the icecast server to rebroadcast CBC as an MP3 stream, and then use a homebrew app like FreeRadio to read the stream from there. Note that since FreeRadio doesn't do WMA, and CBC doesn't broadcast directly in MP3, you again need that server in the middle. A bit of a pain, again, but doable. Note also, however, that you'd have to homewbrew your wife's PSP to do this... not sure how she'd feel about it, as it is a bit of a step. If you know noone with one already set up like that, you pretty much have to do the hardware mod--which I've done--it just involves sawing a pin off one IC in a battery--but it's not quite trivial. Google Pandora's battery for more. Note also that by this method, you happen to be able to get CBC Radio 3 (the sorta youth/alt version) directly in FreeRadio, as it broadcasts via MP3, tho' you have to hunt around a bit for the link... I can send it, if this is interesting... annoyingly, CBC Radio One and Two only do WMA and ogg, so you have to resend them...


Hacking the PSP is an interesting option. I have done lots of hardware mods and hacking. The battery mod, does that turn a regular battery into a Pandora? I read that only the first generation PSP slim/2000 can be cracked with Pandora because the two subsequent motherboards have disabled the battery crack hack. I am new to the PSP, I've used it with Skype too which has the potential to save lots of money, especially when on long-distance bills while on a trip.


3. If you're homebrewing anyway, and don't mind trying alpha code, I do now have this thing I've just built and which works fine for me: reads the CBC Radio One and Two streams (a Toronto station which supports Ogg/Vorbis) directly. Works fine for both, still a bit unstable, tho' once it's reading, it's reading--I've used it for hours at a time. I'm planning on releasing the code and binaries shortly, anyway, so I'm happy to have a tester, if you're going that route... (Standard legal disclaimers go here: alpha code, may not be fit, homebrewing has some modest hazards, yadda yadda).

I would be pleased to test your alpha code. Your code is constantly being changed as you improve it so alpha 1 could become alpha 1.1 then 1.2, etc. virtually as soon as I get it loaded. Is your alpha version at a point where it is almost ready for beta? I am in Toronto. How would I get your software?

NineByNine
July 2nd, 2008, 20:28
I used the hardware hack on my PSP2000; it worked fine. I'm pretty new at this, but I believe it's the software hack that's now a non-option, since the new boards won't write to the eeprom. But the hardware hack's still the same--saw off the post, and the eeprom just reports all 1s, and it works. I can report success on mine: I bought a new battery, sawed off the eeprom post on the old one (just used a utility knife), stuck it in, and the thing booted to maintenance and loaded the custom firmware install stuff...

Again, I just did it the once, so no expert, but there's stuff all over the web on this. I actually found some youtube videos that show the hardware mod, which is nice--you can make sure you've got the right post. There's a few different videos using different batteries, but if you know your way around boards and ICs, you can handle this: just make sure the chip is oriented right, and you know you've got the right pin. You can also try to desolder it for later resoldering if you actually want to save the battery (you can't use a Pandora's for general use), but of course, this is pretty fine work; I didn't try to mess with it. Then you also need a magic memory stick--which you can pack together with a handful of packages... You put this in with the Pandora's battery, the thing boots, installs the custom firmware, and you're good to run homebrew on it. I've also got FreeRadio on mine, which is nice--tho' it doesn't do Ogg streams, it does MP3, and you're not locked into Shoutcast the way you are on the Sony apps.

Re my code: I gotta find some hosting for the project anyway... which should happen today or tomorrow--so you can just download it from there. I'll update here when I do. I was thinking of just opening something up at sourceforge... Do absolutely let me know if/when you're set up to do homebrew and do want to test it.

NineByNine
July 2nd, 2008, 20:38
Actually... mods... anyone? Is there anywhere here I can host an EBOOT.PBP and the example URL file? Compressed tarball with 'em both is just 184Kb.

Hell, Golem, for that matter, it's small enough I guess I can just email it to you, if you're interested. PM me an address; should keep it away from the spammers.

NineByNine
July 2nd, 2008, 20:49
Oh and re alpha/beta, I'm not honestly sure. Issue right now is occasionally it freezes, especially at network setup, which is a bit of a pain. I'm asking around about why that might be, and I figure I should probably also clean up some stuff at shutdown, allow you to shut off one stream and bring up another (without just exiting the program, which is what you have to do now). Thing is, the latter I can fix myself, the former, I have to hope someone out there knows... so it could be days, or it could be... well... more. Apologies I can't be more definite.

NoQuarter
July 2nd, 2008, 21:35
I'm interested too,let me know.
I'll be checking this thread for updates on your progress from know on.I wish more apps used ogg as oppossed to proprietary formats.

NineByNine
July 2nd, 2008, 23:31
Thanks, good to hear. And I've excellent news: the network hang issue is fixed already. Someone at psp-programming (thanks, Insert Witty Name Here/Insomniac) were able to point me to updated code for initing the net; and that bug is squashed.

And that was the hard one. Hell, at this rate, I can probably put a binary on the net sometime tonight, now.

Golem
July 3rd, 2008, 02:32
Congratulations!

NineByNine
July 3rd, 2008, 19:16
Additional fixes, as of yestereve:

-- Added 48000 Hz stereo support
-- Made config (stream list) prettier/easier to edit/setup
-- Did menu driven system for picking stations; comes back to menu after last one stopped (there are still some issues with recv thread shutdown, tho)
-- Added recv buffer status display
-- Added a few more sample streams to the default config

TODO before I'd call it beta:

Clean up error handling in the decoder thread; it can still freeze on some errors.
Clean up thread shutdown/restart around stopping/starting new stations.

NineByNine
July 3rd, 2008, 20:10
... oh, and I also proposed a project at SourceForge. Should have word shortly, and, with any luck, hosting for source and binaries.

NineByNine
July 4th, 2008, 08:39
Threading stuff much more stable; still got some increasingly rare deadlocks occuring...

It's actually stable enough now if anyone wants to try it... stuck a package up at this spot (http://accidentalweblog.org/excerpts/vorbo_20080704.tgz). Might, once in a while, freeze during initial load only. But even that's pretty rare now.

NineByNine
July 4th, 2008, 17:02
More stable still... archives below:

Gzipped tarball (tar.gz) (http://accidentalweblog.org/excerpts/vorbo_2008070402.tar.gz)

Zipfile (.zip) (http://accidentalweblog.org/excerpts/vorbo_2008070402.zip)

Golem
July 4th, 2008, 19:04
Hi NineByNine,

I haven't, yet, hacked my wife's PSP battery into a Pandora in order to install custom firmware (4.01 will be the version). I have read that installing custom firmware on a PSP Slim may not require a Pandora battery: http://forums.afterdawn.com/thread_view.cfm/552549 Do you know if that or another method works? My alternative is to meet up with someone who will soft convert the battery for me, some people are advertising they will do it for $10, or buy an already converted or "commercial" Pandora battery or, as a last resort, do the hardware hack myself.
It would also be useful to know which motherboard is in my wife's newly bought PSP slim without taking it apart. After I get your reply, I will decide what I will do.

NineByNine
July 4th, 2008, 19:48
Geez, Golem, like I said, I'm really probably not the guy for this. But I can tell you that in the method they're describing in that link you provided, it sure sounds like the app that flashes the battery's eeprom has to run from a PSP, and thus, from an unlocked PSP (yours won't run it until it's been unlocked... and possibly not even then, depending on your machine's board--key in the trunk thing). The magic memory stick you can write through the USB port from a Windows machine to any PSP, sure, once you've put the app on the machine, but you still need the unlocked PSP to get the battery that way to make the console boot from the stick.. I'm pretty sure once you've got the battery, either done with the software hack (flashing the eeprom with the PSP app) or with the hardware hack (lifting the pin), it'll work on any PSP, though. My understanding is: the only thing they were able to do to the new boards is stop them from writing the eeprom in the first place, so you can't actually make a Pandora's battery with the new boards... you can still use one, however it was made.

But again, caveat emptor. My experience is I've just done it the one time: did the hardware hack, made the memory stick through (I used a Windows laptop of mine) a USB connection to the (still unlocked) PSP holding the stick, and it all went great... But I'm really not a hardcore PSP hacker, just a guy who can write software if you give me a decent compiler and assembler, which the PSP toolchain now happens to be.

NineByNine
July 4th, 2008, 19:50
Oh... and re the custom firmware: Hey! 4.01 is out! Thanks; I had no idea (I've been running on 3.90...)

Golem
July 4th, 2008, 20:07
Thanks for your reply. I'm going to look into this a bit further before I commit to a particular method of doing the Pandora thing. If I try the soft hack, if it doesn't work, then I would do the hardware hack because I would probably have bricked the PSP.

I used to write code too, machine code, assembler, higher level and scripted languages. I learned programming with binary through flipping switches for setting the address, data, etc., then punch cards, then assembler, then ... I have been "out of the loop" for quite a few years. I did try to learn Object Oriented C or C++ but, when I tried, it was a new concept and there wasn't much to help in learning it that the paradigm shift in how it works was too much for my brain to wrap itself around. The PSP is tempting me to get back into coding but I have much less time left to live than I have lived to spend time focused on a screen writing and debugging code.

NineByNine
July 4th, 2008, 20:53
I knew an old-guard programmer-type who was awfully good with C++ who always said you can just think of C++ objects in terms of structs and function pointers, and tho' it's sorta *not* the way pure OO type folk encourage you to think of things, it's a good way to work out in your head what's really going on for procedural types who grok those things better... Because, after all, that's all the classes really are: structs with function pointers, and a few language features that make using them a bit cleaner than it would be if you tried the same thing in plain C... Which is fair enough, but I've got no intuitive sense of how much that help that is, as I kinda came at it backwards: I was proficient at OO approaches before I was particularly competent to work *without* them... had really only done a bitta BASIC, C, assembler, and Pascal before being thrown in the deep end with C++ and Java... Only really got half-decent at doing things in bread and butter C later... and, oddly enough, my C code at least still tends to be a bit heavy with... you guessed it... structs and function pointers...Though I think my assembler mostly looks like everyone else's.

And you can just think of templates as really smart macros, which is, actually, all they are, after all. This is the 'make this a linked-list macro', and geez, it's scary what you can do with them, and how fast... Exceptions... I have no nice parallel for exceptions. They're sorta like setjmp... and goto... but not.

Anyway, oddly enough, this Vorbis thing is all C. Lot of the code I had lying around that looked like it would get me part way happened to be C, anyway, and I found when I tried to use a bit of STL to make the URL list stuff easier, it worked fine, got the job done in almost no code, but the binary got sorta large, and I thought, aw, hell, I've still got the skills to do a classic linked list myself, why not? It may be a freakin' dual MIPS supercomputer, but it fits in your pocket... it almost seems wrong to use all this template medicine on it. So I did it the old way, and hey, it all works. If it ain't broke, y'know.

Golem
July 4th, 2008, 23:40
OO to many C programmers means Oh Oh! My C programming skills worked well with Perl, also not OO. OO is the way to go - Objective C, C++, Python, Java. I first tried learning OO with Smalltalk-80, I used to have the Smalltalk language manuals which taught the language and showed how to build a GUI with Smalltalk. I met Adele Goldberg, one of the authors, in Toronto when I was in graduate school at the UofT. She's also the person who showed Steve Jobs the GUI, etc., when he visited Xerox Parc.


Keep up your optimization skills, programmers have become extremely wasteful of resources, leaving abandoned chunks of code instead of cleaning up after themselves. There were some amazingly powerful programs written which ran on very slow processors and extremely limited memory.

The PSP is an amazing device for $169.99, I wonder how Sony makes any money from it. I wish Sony would stop trying to lock everyone out of it and, instead, encourage people like you to develop apps which would run without hacking the "official" firmware. I don't know if you're in Canada but, if that new proposed Copyright Act gets passed into law it will make criminals out of us for breaking into their firmware and bypassing their DRM. If anyone gets caught with a Pandora hacked battery, it's off to jail.

NineByNine
July 5th, 2008, 04:26
Heh. You *can* actually do OO Perl... I've done a lot of very OO stuff with it. The syntax isn't quite so obviously built for it as is C++/Java/Smalltalk, but it's still a nice way to do a lot of stuff, wrapping it up on modules which also act as classes... The stuff I'm gonna tap to do the scrolling in the list for the stations in this widget started out as a Perl module I did to handle record lists in a DB app--and even used inheritance--I'd subclass it to add specific commands to the list types, pass in objects that know how to write themselves on the line, it inherits the default 'up' 'down' stuff from the parents, so on... Not gonna use all that in the Vorbis app, mind you, just some of the display logic...

Re Sony, yeah, it's a bit crazy, the whole thing. I'm actually--sorta--sympathetic to their plight--only insofar as I guess this so isn't the world they thought they'd signed up for. And I've huge respect for the people who can make a device like the PSP--pretty little thing with all that power, and hell, it's pretty much a masterpiece of industrial design in its own little way, too. You have to be impressed... And I think it's the sum of their very attitude that makes that happen: make it seamless, make it perfect, make it clean, deliver this wonderful shrink-wrapped, consumer-friendly little jewel of technology... Make it elegant, and make it beautiful...

And then when a buncha anarchic nutters with their own wild ideas with what they'd like to do with the hardware come along, it's like... wait... this is *our* box, who are *you*? And it's got to be pretty hard for them to believe anything good is ever going to come of that... I mean, who knows who's gonna be writing this stuff, if they're any good, if they give a rat's ass about making things work right. Can't be easy for an organization with those traditions to look at open-source development and not shudder... Hell, I feel that sometimes, looking at the whole movement, find myself thinking to myself: and a roomful of monkeys pounding on their keys and then typing 'make' is gonna get us good apps how, again, exactly?

And yet it does, weirdly enough. Go fig. Apps and libs and tools might start out a bit shaky, sure, but if people are using them, and the code's available to them, they get better. Not all of them, sure, but it's a pretty vicious process, actually: what no one cares about and no one uses decays (and there's a lot of that). Stuff that gets used gets polished...

But Sony, that's not their world. They want to make things that work the right way from the beginning, and though it's an admirable attitude, it's just not all there is, anymore. I figure they're like a lot of people and a lot of organizations sitting there thinking: okay, where do we fit into this, now? How do we work with this? *Do* we even still fit?

I actually think they really do. There's always a place for an organization that makes beautiful little jewels of technology partly just because they like to. Or I'd sure like to hope there is, anyway. But I also think they are going to have to get this: the very networked nature of the world now means communities of formidable talent and curiosity can form around any technology in nothing flat, share information, and rapidly and drastically change that technology's potential. And trying to hold that kind of natural human curiosity and inventiveness back with legislation because this means some of the ways you used to do things break down badly in that kind of environment isn't going to make for a liveable world for anyone... I mean, hell, I don't want to rip off their games (and, for the record, I never have, and have no plans to, and they've done pretty well by me on the disks I've bought now, I think). I just want to be able to write the ware my way, have it do things my way, have it tune my stations without having to wait another year for the next firmware.

Dunno. Wish I could say something comforting to them. I hope 'it really is a beautiful little box, and it's a pleasure to develop for' counts for something.

NineByNine
July 5th, 2008, 07:32
Well... I *was* gonna take a night off... but then I thought I should make sure this thing is okay with 4.01 (it is), got into messing with it... Current drop is here (http://accidentalweblog.org/excerpts/vorbo_20080705.tar.gz) (tar.gz) and here (http://accidentalweblog.org/excerpts/vorbo_20080705.zip)(zipfile)

Additions: added mono 44.1 support (needed for Radio Canada 1), made station list scrollable, added some stations to the sample config. Current list of stations known to work with this thing include:

CBC Radio One
http://vorbis.nm.cbc.ca:80/cbcr1-toronto.ogg

CBC Radio Two
http://vorbis.nm.cbc.ca:80/cbcr2-toronto.ogg

Radio Canada: la Premiere Chaine
http://ms2.radio-canada.ca:80/PremiereChaine.ogg

Radio Canada: Espace musique
http://ms2.radio-canada.ca:80/EspaceMusique.ogg

Adagio 128K
http://ic.adagio.fm:80/afm128k.ogg

FullVibes Underground Radio 128K
http://radio.full-vibes.com:8000/FullVibes128.ogg

SoundPortal Netradio (48000 Hz)
http://www.soundportal.at:8000/new.ogg

Radio Akropolis Alternative
http://www.radioakropolis.cz:8000/alternative128.ogg

We aRe oNe
http://oggvorbis.tb-stream.net:80/technobase.ogg

Entranced
http://ic.entranced.fm:80/efm128k.ogg

Xylem Baux
http://xylem.aegean.gr:8000/stream.ogg

Virgin Radio Xtreme
http://ogg2.smgradio.com:80/vx160.ogg

Radio Six International, Glasgow
http://212.72.165.20:9020/radiosix.ogg

CJSW Calgary
http://64.141.103.165:80/cjsw.ogg

M945
http://stream.m945.mwn.de:31337/m945-mq.ogg

1980s.FM
http://ic.1980s.fm:80/80s128k.ogg

Golem
July 5th, 2008, 18:36
Procedural habits inhibit learning new methods ( OO joke!). I do know about OO Perl but I have been away from programming for so long (10years) that getting back in would be like almost starting all over. Maybe that's a good thing because the procedural paradigm memory cells may have died so I can start fresh without that handicap interfering with learning OO.

Open-source is an example of Darwinism/Darwinianism - the most useful softwares survive (I hope yours does too). Apple and Sony are a lot alike, both design and manufacture beautiful, innovative, and useful products but Sony doesn't have Steve Jobs promoting its stuff. Also, Sony has had a few technology faux pas recently (Blue-Ray, exploding batteries). To improve its chance of survival (Sony lost a few $Billion in its last fiscal year), it should embrace open-source.

NineByNine
July 5th, 2008, 20:44
It's true there's probably something there for them. If they do it right.

Anyway: I believe I can call this a beta: still a bit icky if the WAP connection actually goes away, but otherwise, setup/teardown is pretty durn solid, if I do say so myself:

(tar.gz here (http://accidentalweblog.org/excerpts/vorbo-20080705-02.tar.gz), zip here (http://accidentalweblog.org/excerpts/vorbo-20080705-02.zip).)

NineByNine
July 6th, 2008, 19:22
Minor updates/cleanups to stream display stuff largeish list of streams from xiph.org added (131 streams in sample config file, now) to make setup a bit easier. Drop is: tar.gz, (http://accidentalweblog.org/excerpts/vorbo-20080706-01.tar.gz) zip (http://accidentalweblog.org/excerpts/vorbo-20080706-01.zip)

NineByNine
July 7th, 2008, 05:59
The ever-helpful Insert Witty Name Here/Insomnia at PSP-Programming pointed out a nice patch from one crazyc for pspaudiolib that lets you set the sample rate for the lib, and I've incorporated it; result is cleaner 48K output and simpler, prettier, faster code. The current binary drop with this change and a few other modest improvements is here (http://accidentalweblog.org/excerpts/vorbo-20080707-02.tar.gz) (tgz) and here (http://accidentalweblog.org/excerpts/vorbo-20080707-02.zip) (zip).

NineByNine
July 8th, 2008, 02:53
Additional fix this eve: previous version wasn't doing the h/w sample rate setting right; works now. Gives coverage for a pretty huge rate of sample rates, but there is the odd one it doesn't do. Looks like the rates supported should be 8000, 12000, 16000, 24000, 32000, 48000, 11025, 22050, and 44100, all both in mono and stereo. Fix is just uploaded over the last.

NineByNine
July 9th, 2008, 15:30
Sourceforge came through with hosting: project directory is here (http://sourceforge.net/projects/pspvorbo/). There's one download already defined, for anyone who wants source or binaries.

I also was able to fix the issue with the crash on network timeouts/when the wireless switch got killed; it still messes up the fetch thread, but at least you can terminate the thing gracefully, now. No more crashes.

NineByNine
July 9th, 2008, 15:31
Oh... full disclosure for anyone looking for it: in the course of setting up at Sourceforge, I noticed another project called PSPRadio which looks *very* full-featured, and which appears from user notes to support vorbis streams, too. It's probably a better option; not sure; haven't had time to try it; but if I'd seen it prior to all this, I might not have bothered... It is definitely on the list to try, anyway.

Golem
July 10th, 2008, 15:32
Isn't PSPRadio only for PSP1000/PHAT models?

NineByNine
July 10th, 2008, 16:00
It works for me on the PSP2000... but there are two catches:

1. Periodic freezes after network connection. No big deal, but it actually looks like my stuff is a little more stable there, now, on current systems, for now (pumps fist in victory)...

2. Doesn't play 22050 mono streams--which means no CBC Radio One. Suspect the sample rate isn't supported--as you can hear it, but it's insanely chirpy (sounds like it's playing about 2x speed, frequent dropouts, probably because the audio's running ahead of the server's expectations, and the network stuff keeps going into starvation). So for now, looks like it's my code for that or nothin'...

... but I *am* looking at contributing to PSPRadio to support this, seein' as it's way ahead of me in just about every other way by the look of it (nice feature: looks like they do the ogg decode in a much more sensible thread than I do, which means streams that dump in lots of decode holes during frequent comment updates--and there are a few of those out there--don't stutter during playback), and doing my own thing probably isn't too sensible, here... and after what I've been through with my stuff, I can probably come up with a patch reasonably quickly.

In any case, if your wife is still jonesing for CBC One, specifically, with any dispatch, my current code is more than solid enough for that, for now. I'm hopin' to get a patched PSPRadio that'll do it in reasonable time, but I've now got some code to read...

NineByNine
July 10th, 2008, 16:45
There's a new release of mine, anyway, over at Sourceforge (http://sourceforge.net/project/showfiles.php?group_id=233104)--see release 002. I just hardened the control latching strategy (previously, heavy-fingered types might find themselves canceling the stream they'd just launched, or relaunching the one they'd just canceled), also eases list scrolling (hold button works), reduces the stutter on OV_HOLD conditions (but doesn't eliminate it... for that, I'd have to move the decode out of the audio callback, methinks), allows you to reconnect to a WAP without quitting (use triangle from the stream list).

(...heads reluctantly back to his real work...)

NineByNine
July 14th, 2008, 06:40
Well, in for a penny... PSPRadio looks like it's been kinda quiet a while, and I wasn't really sure where to begin... so I reworked mine anyway to address the dropout issue. Did a pretty heavy overhaul of the fetch/decode stuff, put the Vorbis decode in its own thread, gave it its own circular buffer too, to cover the issue with stuttering commercial stations (it's a few of those that keep updating the comments every 30 or 60 seconds, was causing a nasty stutter in the audio thread due to heavyish decode demands). Notion was by separating decode off, the audio thread could keep screaming ahead this way while the decode thread played catch up to get 'round the hole... Also had to move a lot of code to C++ (allows nice abstraction of a threaded circular buffer, which is then specialized both for the http fetch layer and the decode layer...)

And it worked beautifully. The thing now floats over those stuttering stations like its riding on a cloud. Release 003 is up at Sourceforge. Binary's a little bigger, but not unreasonably huge--just 521K now.

Cloudhunter
July 14th, 2008, 10:40
This seems good. I'm looking forward to any advancements to PSP-Radio - it could do with some decent Slim support :)

Cloudy

NineByNine
July 15th, 2008, 16:29
Thanks; hope to get to that in a bit.

Meanwhile: I made connect and host name resolution cancellable/non-blocking; this (and streams that aren't really there) was the principal cause of the fetch thread getting hung up before; should make things a lot friendlier.

New release/code up. Release 004 at sourceforge (http://sourceforge.net/project/showfiles.php?group_id=233104).

NineByNine
July 17th, 2008, 15:36
Finalizing a few more refinements to mine: recv nonblocking, fix to multi-frequency audio lib so it deletes closed threads properly, minor control fixes. App now passes stress test of 85 streams in a row opened/closed without restart. Code up, but no release; will release once send is nonblocking.

NineByNine
July 18th, 2008, 06:03
Made send non-blocking, fixed some error/stream shutdown handling logic in severe network starvation conditions. It now passes a stress test of 100 streams opened/closed... I have yet to see a crash with the current code, even with intermittent network conditions, bad streams, etc.

So it looks good to go. I'm calling this good enough to release, officially bumping the project status to beta. See Release 005 at SourceForge (http://sourceforge.net/project/showfiles.php?group_id=233104).

NineByNine
July 23rd, 2008, 06:31
Added support for 44000 Hz, 33075 Hz streams (wrote s/w upsamplers to 44100; there's no h/w support on the PSP for these--they're rare rates, but they do occur here and there). Also added support for streams in which the sample rate changes mid-stream/between logical streams (also a rare config, but also happens). Release 006 gathers all of this; it's up at SourceForge.

This set of features supports all known/live streams currently listed at Xiph/otherwise known to the project.

GizmoTheGreen
June 22nd, 2009, 17:30
any source for this baby?

i need to figure out the ogg streaming for an app im making

NineByNine
June 23rd, 2009, 04:15
Yep. See http://sourceforge.net/projects/pspvorbo/ ... source browser at http://pspvorbo.cvs.sourceforge.net/pspvorbo/ , most of the critical Ogg/Vorbis decode stuff is in the decode_cb.cpp file, at http://pspvorbo.cvs.sourceforge.net/viewvc/pspvorbo/vt/decode_cb.cpp?revision=1.5&view=markup ... see the calls to ov_open_callbacks and ov_read ; these are your critical calls into the lib; first opens the stream, second you call repeatedly to turn the Vorbis stream into simple PCM samples you can then just hand to the PSP's audio stuff.

... note also there are two libs generally buildable for the PSP that provide Ogg/Vorbis decode: libVorbis, and another one called libTremor which does it all in integers, and presumably is a bit more efficient/faster on limited/embedded devices. I used Vorbis because I couldn't convince Tremor to work with me in some odd streams in which sampling rate changed, and the PSP is more than up to using it if that's all you happen to be doing at the time. Tremor worked fine apart from this (minor) glitch, too, when I tried it.

I used ov_open_callbacks in order to provide custom read/seek/open/close callbacks linked directly to the PSP's i/o, but given that the stdlib stuff does wrap i/o as well and make it look pretty standard, if you're just doing file i/o, you might also find just calling plain ole' ov_open may also work; not sure; didn't try.

There's also sample code somewhere for doing this on the PSP with Tremor. Will look around, see if I can find where that came from. Been a while since I looked at it.

Oh, hey... just recalled: Revorb (subproject I did) has a slightly simpler/more obvious decode implementation, since there's less buffering/threading (it's just doing file i/o; other one does network) ... see http://pspvorbo.cvs.sourceforge.net/viewvc/pspvorbo/revorb/oggplayer.cpp?revision=1.2&view=markup .