Shop OBEX P1 Docs P2 Docs Learn Events
Retro Plasma Demo — Parallax Forums

Retro Plasma Demo

Here's something I wrote while messing with @rogloh 's video driver. It displays a classic plasma effect and is an example of of using scanline rendering. Or I guess an anti-example, accounting for the different video modes needs way too much code for my taste.

I have included pieces of code for interlaced and progressive TV, as well as 640x480 and 1024x768 VGA, but you should be able to setup whatever you want.

«1

Comments

  • Ahle2Ahle2 Posts: 1,178
    edited 2021-02-19 15:44

    Niiiiice.... the old plasma effect. Makes me remember all that time spent on watching demos on the Amiga and C64. :smiley:

    Add a scroller and this module...
    https://www.stef.be/bassoontracker/?file=https://www.stef.be/bassoontracker/api/modules.pl/598
    and you have done the first official Propeller 2 Intro/Demo. :wink:

    (Please don't listen to the module in the BassonTracker app, it sounds like an interpolated mess... nothing like it should)

  • pik33pik33 Posts: 2,347
    edited 2021-02-19 18:21

    This is Enigma.mod. Attached. The demoscene is still alive:) maybe a wild demo using P2? We can write a demo but to win the wild compo, maybe Linus Akesson is needed (he wrote "Turbulence" P1 demo... :)

    https://2021.revision-party.net/competitions/other-competitions

  • Wuerfel_21Wuerfel_21 Posts: 4,369
    edited 2021-02-19 23:26

    @Ahle2 said:
    Niiiiice.... the old plasma effect. Makes me remember all that time spent on watching demos on the Amiga and C64. :smiley:

    Add a scroller and this module...
    https://www.stef.be/bassoontracker/?file=https://www.stef.be/bassoontracker/api/modules.pl/598
    and you have done the first official Propeller 2 Intro/Demo. :wink:

    ahhhhh why did you say that now I had to actually do it.

    Will have to record video later(tm).

    The 704x480i mode is kindof crash prone. I had to overclock it very high to get it to fit with reSound. I think tweaking the PLL settings might help a bit. Also had to change the VGA mode from 1024x768 to 800x600 to increase the clock enough, but that seems stable.

    I also wrote an obnoxiously long scroll text. Can you read all of it without dying of boredom? No cheating!

    (Also, is it just me or is the audio circuit on the AV board kinda bad? Like, i'm getting very little bass, I think the coupling capacitors are too small)

  • ColeyColey Posts: 1,108

    Very nice and also a top tune!

  • roglohrogloh Posts: 5,122
    edited 2021-02-20 00:58

    Very cool, takes me right back to those late 80s/early 90s. Nice synthesized music. Great stuff Wuerfel and Ahle2! Excellent to see both graphics and sound co-existing together on the P2 now.

    By the way this P2 graphics driver should even be possible to use with just two real scanlines per region, for demos/apps that can generate single scan lines in real time, such as sprite drivers, and that saves lots of HUB RAM. By using this type of feature (as you did), any region can display all sorts of things now, maybe sprites created from other render COGs, or text (in-built or external), or bitmap graphics in any colour mode from HUB or even external HyperRAM, with a mouse cursor too. If I can free another cycle I should be able to add optional COGATN notification per hsync scanline to assist that, or just for some extra cool dynamic effects when specific scan lines are hit. That is something I've been hoping to put in...

    Wuerfel_21 I understand your concern about how much code to set up the different display outputs (you needed multiple init calls for example). For single region graphics screens I should be able to make another wrapper like I did for text that should simplify setup a bit. We have the underlying universal video driver now that is pretty powerful and highly versatile, we just need nice easy front ends to simplify setup and help remove any complexity where possible. It should happen in time as it evolves. I still want to add parallel RGB output too, which is another useful output type for LCDs and external higher resolution encoders like LVDS or TMDS transmitters.

  • The problem is less (but still) the setup and more that the line counter isn't counting logical lines.
    IMO the scanline renderer shouldn't have to know the difference between, say, 480i, 480p or 960p with DOUBLE_HIGH.

    I'm also thinking about making a drag-n-drop ready format where the user's desired video mode / pins / etc is auto-patched into the program

    Yes parallel RGB seems useful. I think one can have both analog out and parallel at the same time, that'd be awesome for capturing screen videos of something that'd usually only be on an LCD.

  • @Wuerfel_21 said:

    (Also, is it just me or is the audio circuit on the AV board kinda bad? Like, i'm getting very little bass, I think the coupling capacitors are too small)

    The stereo headphone amplifier has an input impedance of 15kOhm (typ), thus the 1uF dc-blocking input capacitors (C405, C406) would be good for a -3DB cutoff, way down to 10Hz. The amplifier curves are traced between 20 and 20,000 Hz, so definitelly the problem is not there.

    As for the other three 1uF capacitors, present at amplifier's circuit (C407, C409 and C410), Texas Instruments recommends (and Maxim also accepts) their values to be 2.2 uF, provided they are real low ESR type ones, in order to not impair too much the amplifier's output power, so an upgrade at their values could be attempted, as an improvement.

    Also ensure your headphones do have an impedance between 16 Ohm (better output power, but worse harmonic distortion) and 32 Ohm, but these are common values for those parts.

    Hope it helps

    Henrique

  • cgraceycgracey Posts: 14,133

    I have some nice headphones that have 34-ohm impedance. The bass sounds awesome. Maybe 8-ohm headphones wouldn't work that well.

  • YanomaniYanomani Posts: 1,524
    edited 2021-02-20 04:46

    As you can see, TI's plot starts from 10 Ohm, and top power is achieved between 20-26 Ohm, so 8 Ohm seems a bit low for the load resistance. Note: VDD = 4.5V at TI's plot, and THD is 10%

    Maxim's curves are ploted at VDD = 3V, both at 1% and 10% THD.

  • roglohrogloh Posts: 5,122
    edited 2021-02-20 04:49

    Yeah I have quiet bass with some cheap PC multimedia speakers. Maybe the song itself doesn't use a heap of low end bass. When I plugged my higher end Sony headphones there was more bass but it it sounded a bit loud/overdriven and just slightly distorted. Pity there is no vol control trim on the A/V board, I guess software needs to set that up.

    Multimeter measured 28 ohms resistance for the headphones on each channel and 15k for the amplified speakers.

    I've noticed when headphones or speakers get plugged into or out of the A/V board it typically locks up the P2 which is annoying.

    Not that I'm an audiophile but I think 10% distortion would be noticeable if it is maxing out the amp which is what I'm likely hearing.

  • YanomaniYanomani Posts: 1,524
    edited 2021-02-20 04:57

    Did you tryed changing the pin group to what the A/V board is connected to?

    Besides changing at the three 2.2 uF caps (C407, C409 and C410), I swear I was just about to suggest that an independent 3.3 V voltage regulator would be a nice improvement to have at the A/V board, exactly in order to spare whichever LDOs are connected to P2 VIOs.

  • cgraceycgracey Posts: 14,133

    If the headphone amp is the weak link, try using the RCA jacks on pins +0 and +1 as the line-outs to your multimedia speakers. That may work a lot better.

  • roglohrogloh Posts: 5,122
    edited 2021-02-20 05:30

    Yes good idea, though the VGA output won't work then. I guess people can try audio + S-video instead, out of those 4 RCAs given the right port numbers, or try the HDMI/DVI board for video, or other pin group if they have multiple A/V boards. Be wary if you've asked for SVIDEO_CVBS in the video driver, then it will generate both types and consume 3 IO ports and this could interfere with audio in that case. You need to ask for either CVBS or SVIDEO output only to just use the single or IO pin pair respectively.

    Would the P2's IO output be strong enough to get good audio signal directly into 28 ohm headphones? I'm going to try that. Maybe 2V 75ohm DACs is the way to go, and it can source ~0.75Vpp into the 28 ohms?

  • YanomaniYanomani Posts: 1,524
    edited 2021-02-20 05:34

    I'm sure you don't wanna do that (connecting the speakers directly, without some special precautions/protection circuits), because, if they could present any reasonable inductance, there are fair good chances for a sudden voltage spike, way over 6.6 volts, thus P2 pins could certainly be damaged. Watch out! :smile:
    Addendum: and even DC blocking capacitors (sollely) would be no relief for that kind of spike...

  • Ahle2Ahle2 Posts: 1,178

    In my experience with the A/V board the head phone out colors the sound way too much for my taste. It adds distortion, noise and makes frequency response unlinear. That is by just using my ears, I havn't measured anything. Nothing new under the sun though, I have never heard any good sounding audio comming out of such an IC. The same was true for the P1 demo board. Use the RCA outputs with a good amplifier!!!

  • I have just tried and the levels are now far more satisfying on the headphones directly attached to the P2 pins on the RCA (via the 22uF coupling caps) and there is less distortion. Bass sounds good. This is still 8 bit audio remember.

  • roglohrogloh Posts: 5,122
    edited 2021-02-20 05:45

    @Yanomani said:
    I'm sure you don't wanna do that (connecting the speakers directly, without some special precautions/protection circuits), because, if they could present any reasonable inductance, there are fair good chances for a sudden voltage spike, way over 6.6 volts, thus P2 pins could certainly be damaged. Watch out! :smile:
    Addendum: and even DC blocking capacitors (sollely) would be no relief for that kind of spike...

    Yeah I didn't directly attach speakers to P2 pins, it was the amplified speakers input cable (line input levels 15k ohm). I did attach the headphones though. The direct in sounds so much better! That A/V board's amp is not good with either amplified speakers or my headphones.

  • @rogloh said:
    Yeah I didn't directly attach speakers to P2 pins...

    Phew! :smiley:

  • cgraceycgracey Posts: 14,133
    edited 2021-02-20 06:54

    75-ohm DAC pins can be ganged together to lower the impedance, you know.

    Perhaps we could get rid of that headphone amp chip.

  • Wuerfel_21Wuerfel_21 Posts: 4,369
    edited 2021-02-20 09:00

    Wow this sure went off topic real quick. @VonSzarvas gonna get split that split tool goin'.

    Do you people actually plug headphones directly into dev boards? I always connect things like that to the line-in on my PC. I can set it to mix it into the PC's output in hardware with no apparent latency or loss of quality. And of course it also allows me to record.
    I'd also be worried about janking the entire thing onto the floor if it was directly wired to my head (the speaker volume controller thing where I actually plug my headphones in has been ripped off the table countless times)
    Will have to try what that sounds like though. (EDIT: AAAAA TOOO LOUD)

  • Great demo @Wuerfel_21 :D

    Nice display driver too @rogloh

  • pik33pik33 Posts: 2,347

    Do you people actually plug headphones directly into dev boards?

    Yes I did, 3 different types, via a headphone jack. I also tried outputting audio to the amplifier via RCA sockets, but I rather use them as ADC input ( still trying to do noise "free" audio ADC ) I didn't have any quality issues with the audio output from a P2 board.

  • YanomaniYanomani Posts: 1,524
    edited 2021-02-20 14:22

    Sorry by insisting in a some way off-topic route, but...

    @rogloh said:
    I have just tried and the levels are now far more satisfying on the headphones directly attached to the P2 pins on the RCA (via the 22uF coupling caps) and there is less distortion. Bass sounds good. This is still 8 bit audio remember.

    @cgracey said:
    75-ohm DAC pins can be ganged together to lower the impedance, you know.

    Perhaps we could get rid of that headphone amp chip.

    For two paralleled-DAC outputs, ~37.5 Ohm drive, 22 uF is only ~5% of the required capacitance.

    Simple calculations shows ~420 uF minimum, for a -3DB cutoff rolloff at 10 Hz, so as not to "strangle" too much the bass response.

    https://v-cap.com/coupling-capacitor-calculator.php

  • Wuerfel_21Wuerfel_21 Posts: 4,369
    edited 2021-02-20 14:30

    @pik33 said:

    Do you people actually plug headphones directly into dev boards?

    Yes I did, 3 different types, via a headphone jack. I also tried outputting audio to the amplifier via RCA sockets, but I rather use them as ADC input ( still trying to do noise "free" audio ADC ) I didn't have any quality issues with the audio output from a P2 board.

    I mean for actual usage. Of course you'd plug some headphones in to try, but I'd imagine that most people would either connect a dev board to some sort of line input (powered speakers, PCs, mixers, etc) when actually using it to develop something.

    Relatedly: The AV board schematic doesn't say what the amp is, but it seems to be a Maxim MAX4411e. Maxim's page on it doesn't advertise anything about its quality, which yeah I guess means that it's not supposed to be good. Has anyone, like, reviewed a bunch of these? I see some that are similarly priced that claim to be "Hi-Fi", but IDK if that actually means they're any good (In particular, the first one I found that seems like it'd work the same (single-rail supply and all) is the TI TPA152 )

  • Wuerfel_21Wuerfel_21 Posts: 4,369
    edited 2021-02-20 16:52

    Here's a video for all you lazy bums and non-P2-owners:

    Annoyingly I figured out how to fix the flagging after recording this....

    The audio is through the RCA jacks, but in DC mode because dum dum.

  • Nice, one of my fav demo routines... One thing that sets this apart from plasmas I've seen in PC demos is it's soooo nice and fluid... :star:

  • pik33pik33 Posts: 2,347
    edited 2021-02-21 07:02

    Do you have an account there: http://www.pouet.net/ ? If yes... post it :) Let the scene knows there is a new platform to write demos on.

    What did you use to record the video from the P2?

  • Ahle2Ahle2 Posts: 1,178
    edited 2021-02-21 11:02

    @pik33

    Yes, the demo scene is very much alive... I just saw this Amiga OCS (A1000, A500) demo that was spread on floppy disks throughout the world(in 2020/2021!? :lol:)...

    Mind is blown considering this runs on the first Amiga chipset from 1985, not ECS or AGA. 7.14 MHz and some custom chips designed by Jay Miner and his collegues.

  • pik33pik33 Posts: 2,347

    on floppy disks

    I have several FDDs which I want to revive using a P1 as a FDC


    Jay Miner was a genius. This is an example what can be done with his older (1979) stuff and 1.77 MHz 8bit CPU:

  • evanhevanh Posts: 15,126

    I wonder how my collection of old floppies is holding up. They haven't been touched in 25 years. The cartons have been stored in a number of places. Probably gone mouldy. I should be able to dig up an Amiga floppy drive. Presumably a PC's high density FDD can be used too, for reading data at least. Same 80 tracks.

Sign In or Register to comment.