Second CPU for audio processing?

Super ST Project. Lets create a awesome new ST! Fix all the bugs and add more cool stuff!
User avatar
exxos
Site Admin
Site Admin
Posts: 7416
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Second CPU for audio processing?

Post by exxos » Mon Oct 01, 2018 8:12 pm

In relation of thinking about a new audio system and the fact we don't have any new software to play's like tracker tunes on a DSP etc.. We do actually have code that runs on the CPU tracker code already.. I think we can get 14Khz with the CPU maxed out ?

A second CPU doesn't have to run at 8MHz either, it can run at 50MHz for much faster processing speeds, aka higher sample playback quality.

The idea is, what if we actually have a second CPU with its own RAM could run tracker playback routine directly from its own RAM ?

This way pretty much any machine code could be run on the second CPU... It would likely need some patching in some respects I guess, but I am not a expert in how the tracker code works.. If it uses a MFP timer, we may need some hardware hackery to emulate this or something..

Second CPU could be used with pretty much any machine code.. I don't know how useful it would be for other things.. But I guess it could be used to do calculations or manipulate data etc ... But of course data would have to be copied back to main man for it to be used by the main processor..

I guess a example would be thing like a long division by the CPU. Values to work with can be loaded into the second RAM/CPU where it can crunch the numbers and flagged the main CPU when ready with the result where it can be copied back to main RAM.. I guess would be more like how a FPU would work on the bus.

In any case, if it would be possible to run a tracker playback routine on the second CPU with its own RAM, then tracker music can be played high quality with pretty much no main CPU overhead.. Then we are not limited to just wave/dac playback.

Food for thought I guess...
4MB STFM 1.44 FD- VELOCE+ 020 STE - 4MB STE 32MHz - STFM 16MHz - STM - MEGA ST - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - HxC - CosmosEx - Ultrasatan - various clutter

https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.

User avatar
sandord
Trusted Guru
Trusted Guru
Posts: 596
Joined: Mon Aug 13, 2018 10:08 pm
Location: The Netherlands
Contact:

Re: Second CPU for audio processing?

Post by sandord » Tue Oct 02, 2018 5:49 pm

68K seems like a sound choice for a co-processor. But why not make it full flavoured, with its own interrupts etc. so it could be used in a broader way like you've already proposed.

stephen_usher
Posts: 312
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: Second CPU for audio processing?

Post by stephen_usher » Tue Oct 02, 2018 6:47 pm

How much would a low-end ARM SoC package cost? Would it be easy to integrate? Use a Raspberry Pi Zero as the ZX Spectrum Next does?
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.

User avatar
rpineau
Site Admin
Site Admin
Posts: 483
Joined: Thu Aug 17, 2017 6:08 pm
Location: USA
Contact:

Re: Second CPU for audio processing?

Post by rpineau » Tue Oct 02, 2018 7:11 pm

$1 :
https://hackaday.com/2018/09/17/a-1-lin ... processor/

You can also find al lot of Cortex Mxx for less than $10 that run at 5V :
https://www.mouser.com/Semiconductors/E ... =Pricing|0
Working ones : MegaSTE (68020) / TT030 / Falcon with AB040 & Eclipse / 1040STF
Need testing : Falcon with CT2

User avatar
arf
Posts: 69
Joined: Sun Oct 29, 2017 9:30 am

Re: Second CPU for audio processing?

Post by arf » Tue Oct 02, 2018 8:53 pm

stephen_usher wrote:
Tue Oct 02, 2018 6:47 pm
How much would a low-end ARM SoC package cost? Would it be easy to integrate? Use a Raspberry Pi Zero as the ZX Spectrum Next does?
Vocore2: complete MIPS computer, 128 MB RAM, 580 MHz, USB, Ethernet, GPIO, under 10$: c. 2x2cm

It could be used for much more than just audio processing: (un)packing, TLS/SSL, image decompression
--
Against signature spam!

User avatar
rpineau
Site Admin
Site Admin
Posts: 483
Joined: Thu Aug 17, 2017 6:08 pm
Location: USA
Contact:

Re: Second CPU for audio processing?

Post by rpineau » Tue Oct 02, 2018 9:24 pm

Very nice piece of hardware indeed.
I think there are plenty of good devices out there to do this.. the hard part are :
1 - interfacing to the ST bus
2 - programming it from the ST to do what we need (audio, video, ....)

Who's going to do #2 ? Is there enough coder out there that are willing to learn a new system to do music with the ST ...
Working ones : MegaSTE (68020) / TT030 / Falcon with AB040 & Eclipse / 1040STF
Need testing : Falcon with CT2

User avatar
exxos
Site Admin
Site Admin
Posts: 7416
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Second CPU for audio processing?

Post by exxos » Tue Oct 02, 2018 10:04 pm

For sure linux stuff can do a lot, like cosmosex. but I was really looking for something more simple with a "framework". But of course this isn't something I could put together, I'm not a fan of frameworks, and I know almost nothing about linux, I don't really have interest to learn all that stuff either. For sure if someone wants to develop such a addon who has time to develop linux interfaces etc, like cosmo for the future expansion bus.....

My thoughts are we cant have audio like tracker playing because CPU is to slow.. on falcon DSP can play tracker, but as talked about before, would need whole new ST code doing and I don't see anyone taking the time to code for it. I don't think much coding is even done for falcon DSP.. so thinking its not a good option now.

But in terms of 68000, any asm code can run on a second CPU.. bulk of code is already done, would probably need some mods, but should be easy work for software guys to do.

We can program the second CPU RAM from the main CPU via a register, so "loading" of second RAM should be really quick on 50MHz speeds... Plus second CPU RAM is 100% available to CPU. So if we only had 14KHz playback on a 8MHz main CPU, then without video and DMA access involved on the second CPU, we have 50% more speed already. So possible jump to 28Khz easily. This is at 8MHz speeds.. we will have 50MHz power.. so second CPU can do a lot and asm code is basically already done for just about everything.

But I don't know what tracker code needs to run outside of 68000 itself... I don't even know how 4 channels even get to the audio output... it tracker code can output to a DAC instead, then as mentioned already, we can have 4x 8bit playback via DAC....
4MB STFM 1.44 FD- VELOCE+ 020 STE - 4MB STE 32MHz - STFM 16MHz - STM - MEGA ST - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - HxC - CosmosEx - Ultrasatan - various clutter

https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.

User avatar
sandord
Trusted Guru
Trusted Guru
Posts: 596
Joined: Mon Aug 13, 2018 10:08 pm
Location: The Netherlands
Contact:

Re: Second CPU for audio processing?

Post by sandord » Tue Oct 02, 2018 10:14 pm

exxos wrote:
Tue Oct 02, 2018 10:04 pm
I don't even know how 4 channels even get to the audio output...
A lot of time goes into mixing samples together at the correct frequencies (different for each channel). The result of that goes into the 'DAC', which is the PSG channels using a LUT.

User avatar
exxos
Site Admin
Site Admin
Posts: 7416
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Second CPU for audio processing?

Post by exxos » Tue Oct 02, 2018 10:29 pm

sandord wrote:
Tue Oct 02, 2018 10:14 pm
A lot of time goes into mixing samples together at the correct frequencies (different for each channel). The result of that goes into the 'DAC', which is the PSG channels using a LUT.
ah, well likely a lot of code wouldn't be needed then. If tracker just output data direct to DAC then wold save some stuff.. though as we are limited to 16bit data, probably have to alternate dac circuits, like 16bit for first 2 channels, then next 16bit for next 2 dac channels.. audio amp will mix all 4 dacs.. so should make the code quicker as a lot less overhead... it can almost just output the samples direct...
4MB STFM 1.44 FD- VELOCE+ 020 STE - 4MB STE 32MHz - STFM 16MHz - STM - MEGA ST - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - HxC - CosmosEx - Ultrasatan - various clutter

https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.

User avatar
sandord
Trusted Guru
Trusted Guru
Posts: 596
Joined: Mon Aug 13, 2018 10:08 pm
Location: The Netherlands
Contact:

Re: Second CPU for audio processing?

Post by sandord » Tue Oct 02, 2018 10:34 pm

exxos wrote:
Tue Oct 02, 2018 10:29 pm
ah, well likely a lot of code wouldn't be needed then. If tracker just output data direct to DAC then wold save some stuff.. though as we are limited to 16bit data, probably have to alternate dac circuits, like 16bit for first 2 channels, then next 16bit for next 2 dac channels.. audio amp will mix all 4 dacs.. so should make the code quicker as a lot less overhead... it can almost just output the samples direct...
It would be great if the second CPU would do mixing as well, only then the primary CPU will have nearly nothing to do. Sort of DMA-functionality where the second CPU plays 4 (or more) separate channels from memory at arbitrary frequencies (the frequency defines the note the specific note is played at). This would work better than the STE DMA, which only supports a handful of frequencies.

Post Reply