VOGONS


First post, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie

"CD quality" PCM playback can be something of an expensive process with lesser 386/486 systems. This is especially true of multi-tasking environments, where, in addition to storage concerns, the associated CPU (PIO) and RAM (buffering) costs quickly relegate such playback to being a focused effort.

Consider then, a 386-class system @ 25MHz, with 9MB RAM, running Windows 95. A Sound Blaster 16 w/CSP has been installed to perform sound duties.

Playback of 16-bit stereo LPCM @ 44.1kHz has the following CPU impact on said system:

pcm.png

Ouch! In addition, ~705KB of memory is consumed for the 4-second default MCI buffer. Storage aside, we're looking at a resource cost of ~43% CPU, and ~12% RAM, making continuous playback while attempting to do nearly anything else somewhat impractical.

Curses! If only we could reduce the bitrate somehow, without incurring additional CPU cost or significantly degrading the audio!

Enter 4-bit, 4:1 ADPCM compression.

Windows 95 includes built-in ADPCM decompression in the form of Audio Compression Manager modules, and where IMA ADPCM is well-supported by modern conversion tools, surely the data reduction provided by Microsoft's 32-bit imaadp32.acm implementation might be the answer?

Microsoft IMA ADPCM CODEC
imaadp32_acm.png

Well, we've compounded the CPU cost, but hey, the (unrepresented) RAM usage is down to ~176KB. Fail.

Perhaps Creative's 16-bit WFM0011.ACV software CODEC, pulled from the Windows 3.1 SB16 install files, might help?

Creative Integrated Sound Architecture IMA ADPCM Audio CODEC
wfm0011_acv.png

Nope. There is slightly less compounded CPU cost, but it's still above that of straight LPCM playback. If only there were some means of offloading the decompression CPU cost!

Enter Creative's oft-derided Advanced Signal Processor (CSP).

Coupling WFM0011.ACV with the WFM0011A.CSP binary (also pulled from the Win3.1 SB16 install files), we arrive at the following:

Creative Integrated Sound Architecture IMA ADPCM Audio CODEC + CSP binary
wfm0011a_csp.png

Mission accomplished! Minimally-impacting, "CD quality" audio playback in Windows 95, through non-standard use of IMA ADPCM compression and Creative's Advanced Signal Processor. Whether you're converting/using sound schemes, or simply want to play a bunch of stored music in the background while performing other tasks, there's potential system-wide benefit to be had.

It's worth noting that both WFM0011.ACV and WFM0011A.CSP have to be present in order for the CSP to be utilized, with the former presumably doing some kind of hand-off to the CSP hardware.

In summary, and concerning the use of the CSP with my particular system:

summary1.png

Furthermore, and as a *usable* alternative to perceptual coding methods of comparable bitrates, consider the effect of downsampling:

summary2.png

Resource-wise, we're primarily getting additional storage savings here. That's ~8.68 and ~12.6 hours of audio per GB, respectively. Here is a recorded example of 32kHz playback, where the (non-presented) compressed WAV file is 15.4MB in size.

- Format: 4-bits per sample STEREO 32.000 kHz IMA ADPCM
Recorded CT-1770 w/CSP playback (FLAC)

Last edited by Cloudschatze on 2018-06-03, 05:05. Edited 1 time in total.

Reply 2 of 27, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie

It's indispensible in this particular build, for sure.

It's not necessarily a CSP-exclusive feature though. Several non-Creative cards/chipsets offer hardware IMA ADPCM (de)compression, but where Creative's solution seamlessly integrates with Windows' MMSYSTEM, the question is whether the alternatives operate similarly.

Reply 6 of 27, by badmojo

User metadata
Rank l33t
Rank
l33t
mrau wrote:

disk/office like - i dont know any particular names though..

🤣 good hustle

Great post Cloudschatze - I'll look at the CSP far more favourably going foward. It actually can do stuff!

Life? Don't talk to me about life.

Reply 8 of 27, by Scali

User metadata
Rank l33t
Rank
l33t
Cloudschatze wrote:

It's not necessarily a CSP-exclusive feature though. Several non-Creative cards/chipsets offer hardware IMA ADPCM (de)compression, but where Creative's solution seamlessly integrates with Windows' MMSYSTEM, the question is whether the alternatives operate similarly.

Earlier Sound Blasters also included real-time ADPCM decoding via the DSP (with DMA). So I wonder if this can work for all Sound Blasters under Windows. I know it works under DOS, Windows would just need the right drivers.
Edit: it appears there is no 'high speed' DMA mode for ADPCM, so you're stuck at 13 kHz at best with older SBs, if I read the manual correctly: https://pdos.csail.mit.edu/6.828/2008/reading … oundBlaster.pdf

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 9 of 27, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie
Scali wrote:

Earlier Sound Blasters also included real-time ADPCM decoding via the DSP (with DMA). So I wonder if this can work for all Sound Blasters under Windows. I know it works under DOS, Windows would just need the right drivers.

This is an intriguing idea, and could work reasonably well for a lot of 8-bit (mono) source material. Conversely, the conversion of 16-bit material down to the DSP-supported compression types can be pretty rough-sounding...
Sound Blaster 16 Audio Compression Comparison (DOS)

Reply 10 of 27, by Scali

User metadata
Rank l33t
Rank
l33t
Cloudschatze wrote:
Scali wrote:

Earlier Sound Blasters also included real-time ADPCM decoding via the DSP (with DMA). So I wonder if this can work for all Sound Blasters under Windows. I know it works under DOS, Windows would just need the right drivers.

This is an intriguing idea, and could work reasonably well for a lot of 8-bit (mono) source material. Conversely, the conversion of 16-bit material down to the DSP-supported compression types can be pretty rough-sounding...
Sound Blaster 16 Audio Compression Comparison (DOS)

Yes, I suppose it may not even be very relevant... if you want stereo on early SB's, the SB Pro is the only choice, and it can only do 22 kHz 8-bit stereo. Not quite 'hifi', but acceptable.
And 22 kHz 8-bit is already a 4:1 'compression' from 16-bit 44 kHz. So effectively the CPU, IO and buffer requirements would be the same.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 11 of 27, by SirNickity

User metadata
Rank Oldbie
Rank
Oldbie

What's the music from? I like it.

Can't say I would pick a 386 as a media player, but that is some impressive offloading there. I used to have a couple ADPCM tracks copied from friends' CDs back in my 486DX2/66 days, just to reduce disk cost. That compression algorithm sounded "different" for sure, but not altogether bad.

Reply 12 of 27, by GL1zdA

User metadata
Rank Oldbie
Rank
Oldbie

Looking through some notes of mine, I have found the description of the other *.CSP files:

wfm0001a.csp  QSound decoder
wfm0006a.csp A-law codec
wfm0007a.csp u-law codec
wfm0011a.csp IMA ADPCM codec (distorted output for IMA test files)
wfm0200a.csp Creative ADPCM codec (sounds like Intel/DVI IMA ADPCM compatible)
wfm0201a.csp Text2Speech decoder
wfm0202a.csp Fast Speech 8 codec
wfm0203a.csp Fast Speech 10 codec

(source: cspctl manual, like this one from Ubuntu: http://manpages.ubuntu.com/manpages/eoan/man1/cspctl.1.html)

At least for the wfm020?a.csp files you find matching ACM filters wfm020?.acv in the Windows 95 setup files. I assume you can extract matching *.acv files for the other like you did for wfm0011a.acv.

getquake.gif | InfoWorld/PC Magazine Indices

Reply 13 of 27, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie
GL1zdA wrote on 2020-03-23, 13:19:

I assume you can extract matching *.acv files for the other like you did for wfm0011a.acv.

Correct, yes.

For what it's worth, I've completely switched to CTADPCM usage, as that format is supported by the DOS-based CODEC modules, while IMA ADPCM is not. I'd initially preferred the IMA format for its ubiquity and ease of conversion, but later discovered that the CTADP32.ACM module mostly negates that advantage, and likewise allows for the creation/conversion (and playback) of CTADPCM files on even 64-bit Windows 10 systems. The resulting files, most of which represent complete album conversions, then get copied-to and played on my lesser (286/386/486) systems.

Reply 15 of 27, by Gahhhrrrlic

User metadata
Rank Member
Rank
Member

You know what would be really cool is if you could use the ASP to play MP3s (converted to compressed ADPCM) in DOS the way CUBIC plays MP3s in DOS using the FPU. I tried to do the latter but it didn't work for reasons I can't figure out... maybe the version was the wrong one or something. Really need a video to show how these things can be achieved. Also would be really cool to pit the FPU vs the ASP to see which one of them is more powerful for music playback on an underpowered system. Over the years I've heard many people say that MP3 on 386 was impossible but I never really believed it. I think these hardware solutions have more secrets to offer.

https://hubpages.com/technology/How-to-Maximi … -Retro-Computer

Reply 16 of 27, by GL1zdA

User metadata
Rank Oldbie
Rank
Oldbie

Given MP3 decompression works quite a bit different from the decoders we have .csp files for, I'm not sure the ASP/CSP would even be able to handle the MP3 decompression algorithm. I still haven't found any information of what the ASP/CSP actually is. MP3 decompression requires bitwise operations (Huffman decoding) and floating point operations (IDCT) and the available ASP/CSP decoders use mostly fixed-point operations, so it's possible that ASP/CSP won't help here.

getquake.gif | InfoWorld/PC Magazine Indices

Reply 17 of 27, by Gahhhrrrlic

User metadata
Rank Member
Rank
Member

Oh I wasn't suggesting using that chip for MP3s. I was merely commenting that when it comes to running compressed audio on an old 386, you have the option of decompressing ADPCM via the ASP OR decoding MP3s via the FPU. Either solution would be impressive on a 33MHz machine. I get the impression however that of the 2 options, the MP3 route would offer higher quality music, so the FPU must be more powerful as a hardware accelerator than the ASP?

https://hubpages.com/technology/How-to-Maximi … -Retro-Computer

Reply 19 of 27, by Gahhhrrrlic

User metadata
Rank Member
Rank
Member

I assumed as much. But it looks like it's not as high quality either. So the real question is, can you play an ADPCM file without lag, using the ASP, that has the same audio fidelity as the MP3 counterpart? Or put another way, which method gets you better music on inadequate hardware: Playing MP3s with an FPU or playing ADPCM with the ASP?

Side note: Just yesterday I saw a russian video where the guy played MP3s on a 386-DX40 in pure software. CPU only. I don't know how he did it, perhaps because I don't speak russian, but it was really cool.

https://hubpages.com/technology/How-to-Maximi … -Retro-Computer