Omnimaga

Omnimaga => News => Topic started by: AngelFish on December 17, 2010, 12:36:40 am

Title: Casio fx-9860G video player
Post by: AngelFish on December 17, 2010, 12:36:40 am
It was recently announced by programmer Martin Poupe that Casio programming has taken a huge leap forward. It is now possible to play videos on the fx-9860G SD calculator. Martin has made an example video to demonstrate:



He is currently working to extend the videos to include audio and released that his audio player today. They can both be found on his website at http://martin.poupe.org/casio/ (http://martin.poupe.org/casio/)

One can only imagine the possibilities for the upcoming Prizm...
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on December 17, 2010, 12:39:48 am
Wow that guy is still around? O.O He's the one who managed to run assembly on a CFX, but it required modifying the hardware I think. His site was down for two years until now. He was mostly active in 2002-03 I think.

This is awesome. If only it also worked on non-SD cards, because SD card 9860Gs are really rare...

I wonder what the Prizm will be capable of. O.O

Title: Re: Casio fx-9860G video player
Post by: AngelFish on December 17, 2010, 12:41:24 am
DJ, I have examples of some animations for the Prizm if you want me to PM them to you.
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on December 17, 2010, 12:42:45 am
Are they openable with any program, though? I saw some somewhere before but they seemed to only show two frame or still images...

You should maybe e-mail instead.
Title: Re: Casio fx-9860G video player
Post by: AngelFish on December 17, 2010, 12:43:50 am
Casio used third party animations and I sourced them :P
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on December 17, 2010, 12:47:23 am
Oh I see, lol. :P
Title: Re: Casio fx-9860G video player
Post by: shmibs on December 17, 2010, 01:59:59 am
SD card capabilities would be the coolest for other models. imagine what we could do with 64 gigs of space :P

that is really super cool, though. especially his wife's paintings.
Title: Re: Casio fx-9860G video player
Post by: critor on December 17, 2010, 08:31:43 am
But I'm not even sure the Prizm is going to have a SD slot...
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on December 17, 2010, 09:44:26 am
I am not sure if it will. Fortunately the 16 MB storage space might help a bit, though, but I doubt very large videos could be possible.

That said, maybe people will do some sort of USB8x for the Prizm so that could do the job as well. In 2005 ticalc.org posted a video of USB8x in action where a part of The Matrix movie was played on a 84+
Title: Re: Casio fx-9860G video player
Post by: Juju on December 17, 2010, 03:32:33 pm
Wow that's awesome. Does the sound comes from the calculator as well?
Title: Re: Casio fx-9860G video player
Post by: AngelFish on December 17, 2010, 03:40:58 pm
The sound was edited in  :P

He has released an audio player for the calculator though.
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on December 17, 2010, 06:03:38 pm
Yeah I saw it on his site. It's really cool nonetheless.
Title: Re: Casio fx-9860G video player
Post by: Jonius7 on December 17, 2010, 09:54:24 pm
I guess the Prizm would have a sd slot in one of its variations on the models like there is a FX-9860 and a FX-9860 SD models respectively... But this is a great development for CAsio!
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on December 17, 2010, 10:29:26 pm
I checked Casio site and couldn't find anything regarding an SD slot, but I wonder if something like USB8x could be written for it...
Title: Re: Casio fx-9860G video player
Post by: Munchor on December 18, 2010, 10:00:59 am
That video is great. The sound is not from the calculator, right?
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on December 18, 2010, 05:53:34 pm
Nope it isn't. The guy made an audio player, from what I saw on his site, though.
Title: Re: Casio fx-9860G video player
Post by: TIfanx1999 on December 21, 2010, 06:03:28 pm
Cool stuff! ^^ It looks like it has a decent framerate too!
Title: Re: Casio fx-9860G video player
Post by: MPoupe on January 04, 2011, 11:50:09 am
Cool stuff! ^^ It looks like it has a decent framerate too!
It has 40 fps, but the full speed (of unoverclocked calculator) is around 100 fps.

I also tried the audio+video together, but the audio was almost unusable :-(
Title: Re: Casio fx-9860G video player
Post by: critor on January 04, 2011, 12:06:33 pm
Cool stuff! ^^ It looks like it has a decent framerate too!
It has 40 fps, but the full speed (of unoverclocked calculator) is around 100 fps.

I also tried the audio+video together, but the audio was almost unusable :-(


Not a problem if we have 2 calculators!
And with 3 calculators, we could also have stereo! :P
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 04, 2011, 04:26:09 pm
Hi MPoupe, nice to see you're still around the Casio community and doing some calculator stuff. I'm also happy you brought your website back online with the CFX hacking info :)
Title: Re: Casio fx-9860G video player
Post by: MPoupe on January 05, 2011, 04:30:06 am
Not a problem if we have 2 calculators!
And with 3 calculators, we could also have stereo! :P
The calculator has 2 serial ports... :-)
But only 1 has an external connector.
BTW: did somebody of you try the audio player ? What do you think about the sound quality ? I think it is terrible :-(
Title: Re: Casio fx-9860G video player
Post by: AngelFish on January 05, 2011, 04:31:26 am
If it's terrible, then we can always overclock the Prizm and try it again  ;D
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 05, 2011, 04:36:44 am
I haven't gotten the chance to try it yet because I lost my headphone adapter :(

As for sound quality, on the TI-84 Plus, music is generally in 8 bit 22 KHz format, if I remember. You hear the music quite nicely but there's some noise and one minute of music takes over 1 MB. I am curious how it sounds like with your player.

Music is generally not too practical on calculators because people need an adapter to fit headphones in the smaller port, but it's still cool to see it achieved. :D
Title: Re: Casio fx-9860G video player
Post by: JosJuice on January 05, 2011, 04:38:15 am
Music is generally not too practical on calculators because people need an adapter to fit headphones in the smaller port, but it's still cool to see it achieved. :D
For the, the main problem isn't the headphone adapter - it's the lack of storage space.
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 05, 2011, 04:46:23 am
For the,
Is a word missing here? ???

But yeah lack of storage space is an issue.

On the 83+ there was that Guitat Hero ASM clone once, but he had to use 1 bit music quality to keep the game small. The quality was terrible on some headphones. :(
Title: Re: Casio fx-9860G video player
Post by: JosJuice on January 05, 2011, 04:47:57 am
I meant to type "for me". I have no idea why I wrote the instead...
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 05, 2011, 04:50:34 am
Ah ok thanks for clarifying. :P

Now I hope I can find my adapter tomorrow, else The Source by Circuit City sells them for $20 instead of $5 at Radio-Shack (which got replaced by The Source 5 years ago). X.x
Title: Re: Casio fx-9860G video player
Post by: TIfanx1999 on January 05, 2011, 06:50:20 am
@MPoupe: Welcome here! I don't actually own any Casio calculators, but i find it a cool development nonetheless. =) I am interested in the Prizm though. I'm just waiting for it to be open to C and ASM development.
Title: Re: Casio fx-9860G video player
Post by: MPoupe on January 06, 2011, 07:16:01 am
@Qwerty.55: The sound quality was not affected by CPU speed (it sounded ~ the same for CPU speeds 2x and 4x). There is probably some non-linearity in the serial port.
@DJ Omnimaga: The TI84 plus has serial port, or 2 bit parallel port (as the TI-92 has?). How is the sound created? My player uses serial port as 1 bit D/A converter.
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 07, 2011, 12:41:08 am
The 84+ has a serial port and an mini-USB port, actually. I don't know about sound concepts but bits are sent via the link port I think and it plays sound. However, the port is 2.5 mm, while headphones requires a 3.5mm one, so you need an adapter or old Xbox headphones.

Volume is extremly low, though.
Title: Re: Casio fx-9860G video player
Post by: z80man on January 07, 2011, 01:18:34 am
With 16 bit color the Prizm will need a lot more memory than it already has. Perhaps Casio might even add more memory in later models of the Prizm just as TI did with the 83 line.  (Yeah 50th post   ;D ;D ;D)
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 07, 2011, 02:32:20 am
I'm fairly certain there's something besides the 61 KB of user RAM that is used for the screen. I wouldn't be surprised if the calc actually had 256 or 512 KB of RAM or something. For sound, on the 83+ it's ran from flash. Not sure about the 9860G.
Title: Re: Casio fx-9860G video player
Post by: MPoupe on January 07, 2011, 06:01:37 am
I hope it will have more. The fx 9860G has 256KB RAM and the fx 9860G SD has 512KB.
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 07, 2011, 06:51:30 pm
Nice. One big worry I have with the Prizm for BASIC programmers is how large are picture files, if it still supports them at all. It will suck if a pic has to be stored in RAM to be used and if it took the entire user RAM. On the 83+, a 96x64 monochrome picture file is 779 KB large and a 96x63 one 767 (12 bytes per row of pixel plus the name)

That said, maybe if people manage to crack the Prizm, they'll write an ASM utility that adds a BASIC command that allows BASIC programs to move files from RAM to storage memory or vice-versa, to allow BASIC programmers to work with larger files easier.
Title: Re: Casio fx-9860G video player
Post by: AngelFish on January 07, 2011, 07:04:10 pm
Well, Casio does have support for pictures in BASIC, so we can only hope. It'll probably come up while I wikify Casio-BASIC.
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 07, 2011, 07:06:02 pm
It does on the Prizm too?

I know it did on older calcs, but I am concerned about the size of the files on the Prizm due to the resolution and having 8 colors O.O

Also, on older calcs, I remember pictures were like 2 or 4 KB large. It seemed less compressed than TI pics.
Title: Re: Casio fx-9860G video player
Post by: AngelFish on January 07, 2011, 07:14:00 pm
Yep:

Quote
StoPict <area of picture>..............area: 1 to 20 
SotPict "folder name\file name"
RclPict <area of picture>...............area: 1 to 20
RclPict "folder name\file name"
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 07, 2011, 07:51:32 pm
Good to hear. I wonder if FinaleTI or z80man could check how large they are, although I don't think this the thread for that, lol :P
Title: Re: Casio fx-9860G video player
Post by: MPoupe on January 20, 2011, 04:45:19 am
Hello,
I created new version of the multimedia player. It supports old formats (of my older players) and also video with audio (movies).
I improved the audio part, it has much cleaner sound and intrusion is away.
Download it at http://martin.poupe.org/casio/, sample video with audio attached.

Martin
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 20, 2011, 09:08:32 pm
great! Audio+video together? :O

I wonder if with some modifications for the screen code it could run on the Casio Prizm too?
Title: Re: Casio fx-9860G video player
Post by: MPoupe on January 21, 2011, 11:57:09 am
I wonder if with some modifications for the screen code it could run on the Casio Prizm too?
Audio part definitely, the video part may be problem, because each frame has much more data. Profiling would be needed.
But now I am at the Step 0 "obtain the CASIO Prizm cg20". :-(
Title: Re: Casio fx-9860G video player
Post by: critor on January 21, 2011, 01:28:49 pm
Me too... :-(
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 23, 2011, 02:32:53 am
I wonder if with some modifications for the screen code it could run on the Casio Prizm too?
Audio part definitely, the video part may be problem, because each frame has much more data. Profiling would be needed.
But now I am at the Step 0 "obtain the CASIO Prizm cg20". :-(
One thing I thought would be to use scaled up low resolution. For example, on the TI-Nspire, in TI-84 Plus emulation mode, the 96x64 resolution is scaled up by 3 times I think to fill most of the screen. In such scaled up resolution you need to fill more pixels on the screen, but there's much less data storage needed.
Title: Re: Casio fx-9860G video player
Post by: MPoupe on January 24, 2011, 05:21:08 am
One thing I thought would be to use scaled up low resolution.
Yes, and palette would save another 50% - 75% data storage.
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 24, 2011, 07:40:18 pm
Yep. Personally I don't think on such small screen it would be a big problem. I can barely see one pixel because they're so small. Here are some compression examples. I don't know if they would be possible/easy to implement, though. I do not know the Prizm pixel storage format.
Title: Re: Casio fx-9860G video player
Post by: AngelFish on January 24, 2011, 07:51:21 pm
Any of those would be pretty acceptable considering that we're talking about a calculator here. However, as soon as we can figure out what kind of buffer size we have to deal with (SafeRAM?) and where the heck the screen itself is, then we can start to work on video.

I'm currently on Step 2, the "Freeze your calculator and figure out how to get it unfrozen part."
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 24, 2011, 08:57:05 pm
X.x, yeah I hope we can figure out soon. X.x It can be hard at first when the entire calc is undocumented. I hope the Ndless of the Prizm won't happen only 3 years later X.x.
Title: Re: Casio fx-9860G video player
Post by: AngelFish on January 24, 2011, 09:31:24 pm
Well, one of the main problems is the virtual memory, which pretty effectively blocks us from knowing much about the Prizm itself.

But, we're way ahead of where the Nspire was for the first year only a week or so after the calc came out, because we have the ability to run arbitrary machine code. It's mostly a matter of eliminating the checksums for convenience (probably with a shell) and getting a good assembler working.
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 24, 2011, 09:58:42 pm
Virtual memory? ???

And I see. I remember the overclock code. I hope you can find a solution about the checksums. Didn't you just replace the add-in code without touching the checksum, while making sure the file remains the same size, though?
Title: Re: Casio fx-9860G video player
Post by: AngelFish on January 24, 2011, 10:04:33 pm
Virtual memory is kind of odd, but it basically works like this:

In reality, for many systems, the usable RAM areas are scattered far apart and a program constantly has to switch between them to use them. With virtual memory, every program(except for the OS) is presented with a continuous piece of empty memory that is free to use and may even be larger than the total RAM available. The processor keeps track of all of the complicated paging and the program has an easier to use memory space. The problem is that what we want is the physical memory. The virtual memory shields the physical memory and there's no easy way to get around it, at least without modifying the OS.
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 26, 2011, 01:45:52 am
Hmm I see. That sucks. X.x
Title: Re: Casio fx-9860G video player
Post by: AngelFish on January 26, 2011, 02:04:22 am
That's wrong  :P

You can disable the virtual memory by writing to the MMUCR register.
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on January 26, 2011, 02:06:22 am
Yeah but your previous post seemed like it made it look like it caused more troubles for us to figure out how the Prizm RAM works...
Title: Re: Casio fx-9860G video player
Post by: Horrowind on February 05, 2011, 03:54:55 pm
After some experiments i wrote a short bash script for converting an avi file to a cuv file (for the video player). It doesn't have audio support and the used dither is not the best one can think of. It uses ffmpeg, image-magick and bc.

In my tests (in the SDK) the audio (played from the original video) gets asynchron, so the framerate is probably wrong

* converts Wall-E for viewing it in his Math lessons... :)

Code: [Select]
#!/bin/sh
[ -z ${1} ] && echo "Usage: $(basename $0) <filename>" && exit||filename=${1}
duration="$(ffmpeg -i $filename 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,// | cat)";
seconds="$(echo $duration | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }' | sed 's/[,]/./')";
framerate=40;
framesd="$(echo "$framerate*$seconds" | bc)";
frames=${framesd%.*}
for i in $(seq 0 $frames);
do time="$(echo "
scale = 3;
result = $i/$framerate;
if (0 < result && result < 1) {
print "0"
}
print result;
" | bc)";
echo $time;
ffmpeg -vframes 1 -ss $time -i $filename -f image2 pipe: | convert - -resize 128x64\! -ordered-dither o3x3  pbm:- | sed '1,3d' | cat >> demo.cuv;
done;
Title: Re: Casio fx-9860G video player
Post by: AngelFish on February 05, 2011, 04:02:36 pm
Yeah but your previous post seemed like it made it look like it caused more troubles for us to figure out how the Prizm RAM works...

It did, simply because it prevents easy RAM dumps. Now that we have the OS, it shouldn't be as much of a problem.
Title: Re: Casio fx-9860G video player
Post by: DJ Omnimaga on February 06, 2011, 01:02:40 am
After some experiments i wrote a short bash script for converting an avi file to a cuv file (for the video player). It doesn't have audio support and the used dither is not the best one can think of. It uses ffmpeg, image-magick and bc.

In my tests (in the SDK) the audio (played from the original video) gets asynchron, so the framerate is probably wrong

* converts Wall-E for viewing it in his Math lessons... :)

Code: [Select]
#!/bin/sh
[ -z ${1} ] && echo "Usage: $(basename $0) <filename>" && exit||filename=${1}
duration="$(ffmpeg -i $filename 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,// | cat)";
seconds="$(echo $duration | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }' | sed 's/[,]/./')";
framerate=40;
framesd="$(echo "$framerate*$seconds" | bc)";
frames=${framesd%.*}
for i in $(seq 0 $frames);
do time="$(echo "
scale = 3;
result = $i/$framerate;
if (0 < result && result < 1) {
print "0"
}
print result;
" | bc)";
echo $time;
ffmpeg -vframes 1 -ss $time -i $filename -f image2 pipe: | convert - -resize 128x64\! -ordered-dither o3x3  pbm:- | sed '1,3d' | cat >> demo.cuv;
done;
Hmm nice. Unfortunately I do not know much about bash scripts, how do I run them? Do they require Linux?

On a side note, welcome on the forums. :)

Yeah but your previous post seemed like it made it look like it caused more troubles for us to figure out how the Prizm RAM works...

It did, simply because it prevents easy RAM dumps. Now that we have the OS, it shouldn't be as much of a problem.
Ok, thanks for clarifying. I'm so not tech-savy about that stuff. X.x