• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

SuperSocket for RealBasic

superpete

Well-known member
Hi All

I've created a small YouTube proxy which uses either QuickTime or FFMPEG to transcode videos to 68k friendly QuickTime videos. I've also created a quick UI in RealBasic which allows for searching and streaming the transcoded video.

It mostly works, but the built-in Socket in RealBasic 2.x is fairly slow. I found out that Essence Software once made a plugin called SuperSocketLite and SuperSocketPro. I haven't been able to find the demo version to try, so if anyone has an old copy lying around I wouldn't mind a look. Further, if anyone knows if the original developer is still around I'd be interested in purchasing a copy (assuming the demo works!).

 

olePigeon

Well-known member
I've Lycosed the web to no avail.  Looks like the company has gone under, unfortunately.  Their domain is even about to expire.

 

techknight

Well-known member
Chances are you will have to write your own socket code in C and compile it and use it as a library. 

Dont get me wrong, I like realbasic for the Mac which is what makes programming possible for me, but its just slow overall because it requires a runtime to operate. And the runtime requires CFM68K which means only 68020+

 
Last edited by a moderator:

superpete

Well-known member
Thanks all for the replies. I really should have gone C from the beginning but RealBasic made bringing something up nice and quick.

I think I have the plugin SDK so will see if I can put something together quickly.

I didn't realise the dependency on CFM either!

 

techknight

Well-known member
I did. I cant code anything other than BASIC, I tried C back when I was in school and it just didnt stick well with this crazy ass syntax, and all modern languages seem to be based off that "structure" Drives me nuts! The placement on where you put certain characters and not white spaces can change the entire function of that 1 line of code. BASIC never was like that. So that makes C hard to understand for me. The asterisk character being the most complicated one. Where it is changes the entire function. 

Then of course there was the % (percent) operator substitution (or $a, $b, $c) in strings and printf, and other stuff which seemed to be overly complicated and unnecessary in my opinion. Its almost as if the language was designed by an alien. But I digress... 

Anyways. I learned about the CFM dependency, when I was trying to code up an MP3 player that depended on an external decoder IC, so I can use my Mac Portable to play my MP3 collection, but that failed because of CFM68K :(

Theres also futurebasic which is much much more low level, and compiles natively but I couldnt use it because you cant "design" or layout the GUI, gotta use a bunch of low level toolbox calls which I dont know any of. Same thing with MPW or any other native IDE. 

 
Last edited by a moderator:

superpete

Well-known member
I'm mostly a C# developer at work, but it's much closer to Java than C. I do a bit of micro-controller coding on the side, so have to do C for that.

Some other interesting BASIC variants I'm on the lookout for are VIP Basic and Oracle Power Objects.

VIP basic is rather interesting in that it converts your BASIC code into C Code for CodeWarrior. With it you almost have the best of both worlds; quick prototyping in BASIC and the performance and flexibility of C.

Oracle Power Objects from what I can gather was a rather polished BASIC IDE which was very similar to Visual Basic.

 

IPalindromeI

Well-known member
"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."

-- Edsger W. Dijkstra

 

techknight

Well-known member
This would be true except, I took Visual C++ before I took VB 5.0. C++ didnt stick very well. VB was awesome as it just "clicked". At the time. Then I took PHP and that stuck really well. Go figure... But then after school, I never used it again so I completely forgot everything about it. And the fact that it has since changed its syntax from procedural to object oriented and it might as well be foreign to me. 

These days, I use Basic4Android, and Basic4IOS to compile mobile apps. B4A translates the basic code directly to Java before compiling. iOS converts to Obj-C before compiling. and it uses xcode to do the compile. 

The one thing I liked about B4A is hot debugging and hot code swapping, no need to recompile when changing a line to perform a slightly different function. it hotswaps the code. 

And actually the more I learn about B4A and use it, the more I realize its only the loops and statements that are BASIC like. everything else such as objects, definitions of objects, etc are basically Java. Its expressed in an english like statement, but when you look at the java code its almost the same, just a couple things re-arranged.  

the only downfall to B4A is the fact that standard android libraries do NOT work with it natively. you have to write wrappers which is something I never grasped. Of course if you dont write wrappers then you have to call everything as Java in your main activity or service, and it wouldnt be BASIC anymore. 

 
Last edited by a moderator:

just.in.time

Well-known member
Okay, spent some time Googling the interwebs, and found a few references to SuperSocket in regards to Realbasic.

On this page, post 4/5 by Christian makes reference to someone reloading the plugin to their download page:

http://computer-programming-forum.com/14-realbasic/0e6325a2e9c8d7db.htm

This download page post takes us to the website where SuperSocket is mentioned in the copyright notices section.  This is in regards to a package that contains over 130 realbasic plugins.

https://www.monkeybreadsoftware.de/xojo/about.shtml

Main Page: https://www.monkeybreadsoftware.de/xojo/plugins.shtml

Downloads:

Version 16.3 that is referenced on the above two pages can be found here:

http://www.macsw.de/plugin/MBS-RB-Plugins163.dmg

... with a mirror here (in case anyone comes here years later looking for this software):

http://www.mbsdownload.com/plugin/MBS-RB-Plugins163.dmg

I downloaded it and couldn't locate the plugin in its raw "supersocket" form.  Maybe it has been rolled into one of their plugins?  At any rate, Christian from monkeybread software had version 2.2 of the supersprocket plugin 11 years ago.

If you can't find the download in the monkeybread software, you can try emailing Christian (the guy that posted that he had version 2.2).  I believe he has his email address listed in the "Contact Us" section of the website.

Good luck on developing your software!

 

bdurbrow

Well-known member
Hmm... sounds like you had a less than stellar teacher. While I do not claim to be a great instructor, I will attempt to elucidate the * operator a little bit:
 
First, a word about pointers:
 
A pointer is the memory address of something. So, suppose that we are keeping track of how many cups of hot chocolate you have had:
 
int myCupsDrunk;
 
Well, that has got to go in RAM somewhere, right? (I am ignoring register variables here for simplicity)
 
So, being somewhere in RAM, it's got to have an address in RAM - lets say it winds up at 12000. So, every time you tell the processor to go fetch the contents of location 12000, it will get the number of cups you have drunk; and vice-versa for storing something in 12000.
 
Well, what if we have a variable that stores, not cups drunk, but addresses? That variable is what we call a pointer: because it points to something else, but isn't the thing itself.
 
So, in C, how do we make a pointer variable? By prepending the * operator on it, when we are declaring it:
 
int *somebodysCups;
 
So, now if you set somebodysCups to 12000, and tell the processor to go fetch what's stored at whatever is in somebodysCups, you will end up with how many cups you drank.
 
So, how do I do that? Well, with the * operator again:
 
int someCups;
 
someCups = *somebodysCups;
 
That means, take somebodysCups, go to the address that it says and fetch the result (the * operator in action here), and store the result of all that in someCups (the = operator in action).
 
OK, so how do you set the value of a pointer variable - in other words, where did myCupsDrunk end up in RAM?
 
C provides the & operator for that: it takes the variable, and returns it's address. So, we can say:
 
somebodysCups = &myCupsDrunk;
 
and somebodysCups will now point to myCupsDrunk.
 
OK, so what use is it?
 
Well, what if we have more than one person that we are keeping track of, and want to change who's chocolate consumption we are concerned with at the moment...
 
int yourCupsDrunk;
 
somebodysCups = &yourCupsDrunk;
 
So, now I can update the number of cups drunk, without having to know exactly who's cups I'm being concerned with:
 
*somebodysCups = *somebodysCups + 1;
 
See what I did there with the * operator? Note that it works on both sides of the = operator. So, what that says is take whatever is at somebodysCups, go to __that__ address, add one to it, and store it back in whatever is at the address in somebodysCups.
 
So, if somebodysCups points to myCupsDrunk, then myCupsDrunk will get incremented. But, if it points to yourCupsDrunk, then yourCupsDrunk will get incremented, and not myCupsDrunk. Handy, eh?
 
And on that foundation, all of computer science is built: without pointers, data structures would be more-or-less impossible, algorithms would be reduced to minimal capability, and the whole thing would be no more powerfull than just a really fast adding machine.
 
So, clear as mud?
 
:)
 
Last edited by a moderator:

superpete

Well-known member
Okay, spent some time Googling the interwebs, and found a few references to SuperSocket in regards to Realbasic.

On this page, post 4/5 by Christian makes reference to someone reloading the plugin to their download page:

http://computer-programming-forum.com/14-realbasic/0e6325a2e9c8d7db.htm

I downloaded it and couldn't locate the plugin in its raw "supersocket" form.  Maybe it has been rolled into one of their plugins?  At any rate, Christian from monkeybread software had version 2.2 of the supersprocket plugin 11 years ago.

If you can't find the download in the monkeybread software, you can try emailing Christian (the guy that posted that he had version 2.2).  I believe he has his email address listed in the "Contact Us" section of the website.

Good luck on developing your software!
Thanks for that! I've sent an email to MonkeyBrain to see if they've still got a copy. Fingers crossed!

 

superpete

Well-known member
Ahh ha! Found a copy of the 2.04 demo! http://web.archive.org/web/20011027093749/http://www.essencesw.com/files/supersocket204demo.bin

I've mirrored it at https://drive.google.com/drive/folders/0B7Z23kbbiG5JZ1dJZDMxTmxXM1E?usp=sharing.

If anyone has the full version let me know! It looks like it and the source was made freely available back in 2002, but of course it's lost to time http://www.monkeybreadsoftware.eu/listarchive-realbasic-nug/2002-10-22-22.shtml

The only other one I'm looking for before is BasicHTTP (basichttp.sit) from Bainsware. Haven't given up yet (however IA's bot was blocked so no finding it through that).

 
Last edited by a moderator:

just.in.time

Well-known member
Very nice!  Is there a central place that can be loaded to, similar to the mac garden, but for realbasic plugins?

It will be interesting to see if Christian/MonkeyBrain still has 2.2 after all these years.

At any rate, hopefully that helps along your project.  Please update or post somewhere when it is done.  I'd be interested in trying it out.

 

superpete

Well-known member
Not that I'm aware of, but that'd be a great idea, not limited to RB either. I've noticed a lot of the old resources, tools and documentation for classic MacOS development have slowly started to evaporate. It'd be nice try and capture/recover a lot of that in once place (and encourage mirrors...). Entire development IDEs from smaller companies (ie not CodeWarrior/MPW/Symantec) which were quite successful just don't exist anywhere except archived MacWorld reviews. In the PC world it would be as if the Watcom tools all vanished without a trace!

Christian did get back to me, he's travelling right now but will try and take a look when he returns.

As fas as my project goes, I haven't tried integrating super-sockets yet - optimisation comes later :) .

Last night I added encoding profiles to the webservice and integrated QuickTime for encoding which brings Video 1 and Cinepak. Interestingly, FFMPEGs now has a Cinepak encoder which produces beautiful video - but at about 2FPS so no good for this project.

You can specify which profile you'd like to use. I'm still fidling to optimise on encode time and filesize, but the Supported formats so far are:

  • Video 1 - 320x200 15fps
  • Cinepak - 320x200 15fps
  • Sorenson 1 (SVQ1) - 320x200 15fps
  • H263 - 320x200 15fps
  • MPEG1 - still untested - fast PPC
  • MPEG4 - will require fast G3/G4 PPC
  • Raw - Original YouTube h264/aac file - G5 PPC
With the exception of MPEG1 and 4, all are encoded with ADPCM mono @ 22khz. I'll assess other options, but I'm limited to what FFMPEG/QT support. The best format so far has been H263 - it can be played on 68K macs (though I haven't yet tried it on real-hardware yet), but encodes at about 25x the playback rate.

Client-side requires QT 4 at this point as it supports opening via URL. If I can sort out the SuperSockets the file can be downloaded to your disk first then opened in earlier versions of QuickTime. The performance of this currently with the built-in sockets is way less than optimal.

Will release it all on Github once ready for some testing. You'll either be able to run your own "server" (just a .NET exe) and I'm hoping to host something for at least a little while.

Future plans may include:

  • playlist support
  • audio only AIFF streaming
  • sign-in support. This will be external, the Mac will give you a code and a URL - you go to the URL on a modern SSL speaking device, enter the code, authorise the app and you'll have access to your favourites and playlists
 
Last edited by a moderator:

techknight

Well-known member
I wonder if you could use the DSPs to do the transcoding and rendering on some macs which have a DSP card? 

Anyways, I remember playing pretty decent quicktime video on the Quadra back in the day, but for the hell of me I cant remember what it was, or the file format. I wanted to think it was MPEG. 

Also I know the TIME magazine stuff that shipped with early macs had video on them that played decently but I think the framerate was a bit low. 

 
Last edited by a moderator:

superpete

Well-known member
Transcoding is almost certainly out of the question. After all, if they could decode a h264 stream in real-time there'd be no need to reencode to another format. Best I think you could do with the DSP Macs is offload some codec operations from the CPU. A QuickTime codec could do it, but I'm not aware of any that were accelerated by the DSPs.

I had a go on real hardware last night and hit a snag. In SheepShaver I can open QuickTime movies over HTTP without issue, but whatever I have on real hardware doesn't seem to like to.

SheepShaver: QuickTime Player can open movie by URL without issue. If I do it via a browser, it does an instant start and progressively downloads and plays.

PowerMac 7300: QuickTime Player almost freezes when opening by URL and doesn't play. Opening in a browser shows a broken QuickTime logo and the browser doing a file download instead.

Only thing I can think it might be is SheepShaver is on 8.6 and the real hardware is on 8.0. I'll upgrade it to 8.6 tonight and see what happens.

 
Last edited by a moderator:

techknight

Well-known member
If your not transcoding, then I dont understand here what your trying to accomplish? 

a modern/helper machine would have to transcode the unplayable on vintage macs video into something more vintage friendly on the fly for any of this to work properly IMHO. a BBB would be a good candidate for that possibly. 

 
Last edited by a moderator:
Top