Play audio from a serial port!!!
Play audio from a serial port!!!
That's some top flight bodgery - I love it. I will have
to try setting that up for myself. 100 bonus points for
a tenuous Look Mum No Computer connection, as well.
I wonder what the low pass works out as? Surely if the
start bit is 0 and the stop bit is 1 you're going to
end up with a constant 11.5kHz whine?
Heha, look at me worrying about audio quality... this
thing's going to sound like balls and that's completely OK.
The low pass filter would probably be filtering out the start bit if it is the only 0 bit? A single bit at 115.2 kbps would be filtered out at 57.6 kHz (it's a pulse lasting 8.68 microseconds, that would be half the cycle), I think - though I really don't have much knowledge of analog electronics.
I'm actually surprised to have not seen this kind of trick in use before. Seems like it could have fit in during the 80s when any (cheap) audio more than a beep was highly desirable.
That's a good question. I suppose the instantaneous
pulse would be 57.6 kHz but an alternative way to look
at it would be as a 11.5 kHz signal with a really wonky
9:1 duty cycle... I further suppose since it's a
"square" wave the instantaneous frequency could be
considered to be infinity (obviously not really).
There were a good number of consumer and homebrew
projects for doing this with the parallel port. In
theory a nice clean 8 bit output, I made one with my
school friend back in the day and it sounded *awful*. I
suspect our quality control was not good enough as
other people reported good results.
Oh for the days when you could just walk into Maplin
and buy qty. 1 components... In fact we just turned up
with a list of "0.1uF electrolytic" etc and handed it
to the poor guy behind the counter to rummage through
the catalogue and find the 20 or so part codes we
needed for us and then fetch them from the back!
I'm actually surprised to have not seen this kind of trick in use before. Seems like it could have fit in during the 80s when any (cheap) audio more than a beep was highly desirable.
I'm actually surprised to have not seen this kind of trick in use
The bit I forgot, is that these tend to be fairly CPU heavy, and you have to be able to hit the Parallel/Serial port pretty fast. Making it difficult for the systems of the age to do anything else save drive these sound devices.
In the early 90s, I saw a sound driver for Windows 3.1
that used the PC speaker, so that WAV audio files & such
could be enabled that way. Although it worked, and was
kinda cool for what it was, it slowed down the PC
significantly while playing audio that way. I imagine
it was a similar issue.
I'm going to put together a cheeky YouTube video showing all of this but I need to source some different audio, as I think that LMNC track is available to buy and I don't have permission to use it...
Re: Play audio from a serial port
Finally got the YouTube video up - if anyone's interested it is here:
https://youtu.be/Q9vlxCXxzrg
Bob - wonderful video! Great presentation and excellent demonstration of what's coming out of the serial port and how it sounds. Super well done.
The audio quality is shockingly good! I know I would have been overjoyed to have audio of this quality before I got a Soundblaster in the 90s.
I have a USB parallel port kicking around somewhere, maybe I'll try one of those oldskool parallel to audio adaptors now that I actually have some veroboard to mount it on... then I just need to find some software that supports it. I can see how this is going to go...
Bob - wonderful video! Great presentation and excellent demonstration of what's coming out of the serial port and how it sounds. Super well done.
Thanks for the kind words. As usual I wasn't really
happy with it by the time I started cutting the clips
together but I couldn't quite bring myself to re-film
any of it :) I'm sure it will improve with practice.
Yeah, tell me about it. I remember those Windows 3.1 PC
speaker sound drivers that would basically halt the PC
until sound stopped playing, I'm not sure it even
sounded as good as the serial port thing.
It's kind of ironic that I suffered for so long without a sound card
yet now good sound is available everywhere I'm back,
voluntarily, messing around with scratchy low-fi :)
I have a USB parallel port kicking around somewhere,
maybe I'll try one of those oldskool parallel to audio
adaptors now that I actually have some veroboard to
mount it on... then I just need to find some software
that supports it. I can see how this is going to go...
I think USB parallel ports will probably have timing problems for audio DAC output. The USB interface requires packetization that breaks fine grained timing, the USB parallel ports I've tried have only been usable on a printer. (I'd be happy to hear I'm wrong about this, though!)
I don't know about anything modern, but there's the old ModPlay I think it was 1.12 for DOS. It'll have both the resistor ladder and the DAC versions. There were a few games that tried using it too, but I don't remember what now.
https://esoom.com/mark/dev/modplay.html
I used the modplay schematic and mounted it straight onto an Apple II bus.. worked just like a SAM speech card.
I think USB parallel ports will probably have timing problems for audio
Aww, boo. All may not be lost, though - I know this will probably come as
I used the modplay schematic and mounted it straight onto an Apple II bus..worked just like a SAM speech card.
That's some solid confidence in your soldering skills :)
Aww, boo. All may not be lost, though - I know this
will probably come as a shock but I *may* have a couple
of devices here with real parallel ports that I could
also play with.
Thanks for pointing that out - it means instead of
starting out on the USB port, potentially getting
nowehere then giving up, I can begin on a "real" port
then have fun seeing what a mess switching to USB makes of it.
I wonder if I can get my Acorn to drive it? Blow up
another line driver in that poor thing...
He found that by the time he was trying to use 486's with a DOS shell
and Win95 none of the timings would match anything that was previously expected. Windows was burying the physical interface behind some layer of obfuscation.
I have a Covox Speech Thing clone but I haven't really used it (just hoarding) maybe I should try it on the Pocket386. I don't remember for sure which clone I got but maybe this one:
https://www.serdashop.com/CVX4
That looks pretty cool. I guessed they would have gone
with a DAC chip rather than just a resistor ladder like
I'm going to try... but I don't see one? Possibly
that's why they brag about their "0.1% High Precision
Resistors" :)
20 Euros is a bit outside my budget... hehahaha
Time to get DOS running on the craptop, I guess. I only
just got a working BSD on there!
I think a big part of the concept of these parallel port sound interfaces like Covox (or the similar Disney Sound Source) was that they were SO CHEAP to make because they didn't even need an IC.
Yes, the link you sent had a video from (I think) 8 bit
guy showing the Covox clone alongside Disney Sound
Source - I had forgotten all about that thing! My
friend had one and I remember it was better than what I
had (nothing) but it barely worked with any software.
Then again, I seem to remember my first SoundBlaster
clone was about GBP20 so there is that... Orchid Sound
Producer, possibly? Got to love the naming of off-brand
stuff.
I was going to say I think I remember parallel adaptors
with a DAC for the Amiga (not that I had one), but I
that's probably all in my head because the Amiga had
that capability on-board anyway so why make an external
one? Probably I'm just getting confused with the
multitude of parallel ADC units for the Amiga used for
sampling.
The link Spec posted has ASCII art diagrams* for
putting together your own parallel adaptor with a DAC
chip (a couple of different DACs, actually) -
funtionally the same but probably better quality. I
imagine someone must have cranked out a manufactured
version of that at some point.
* Said ASCII art was in a file with a .DOC extension -
I was suddenly reminded that .DOC used to mean plain
text before Word hijacked it. It's funny that I'm still
finding things like that which give a sudden,
unexpected burst of nostalgia.
The link Spec posted has ASCII art diagrams* for putting together your own parallel adaptor with a DAC chip (a couple of different DACs, actually) - funtionally the same but probably better quality. I imagine someone must have cranked out a manufactured version of that at some point.
I have a sneaking suspicion and I haven't checked, that Wolf3d might have supported Parallel DAC. I also think there was a pretty small window where they became useful. Where there was enough spare horsepower too drive it while still doing something "useful" and before SB
clones arrived in force. I
seem to remember having a resistor ladder version for a bit... and the DAC version I stuck in the Apple II. Would've been late 386 DX40 era I guess.
Wolf3D did indeed support Disney Sound Source. It looks like there's a driver to allow a Covox Speech Thing to work with Wolf3D also (though it's not supported by Wolf3D otherwise).
Interestingly, despite the fact that the Disney Sound Source is similar to the Covox Speech Thing, Wolfenstein 3D only works with the Disney Sound Source - it does not work with the Covox Speech Thing, Voice Master, or Sound Master.
So that explains why Wolfenstein won't work with a DSS - it can't detect nor enable the DSS.
1. It only switches on when the software tells it to (there's no physical switch)
2. It can ONLY do 7 kHz
3. It doesn't need such extreme timing as a classic Covox, as it has its own 16-sample FIFO buffer.
So that explains why Wolfenstein won't work with a
DSS - it can't detect nor
enable the DSS.
Some really mixed messages here... might require a bit
of experimentation :)
Of course, I don't have a Disney Sound Source, but I'm
in that dangerous "how hard can it be?" mindset - if
the protocol is documented somewhere then it would
probably be possible to implement it using crap out of
my cupboard - which is my favourite kind of
implementation.
1. It only switches on when the software tells it to
(there's no physical switch)
I wonder if it handshakes back for detection?
Probably... which would make life harder.
2. It can ONLY do 7 kHz
Probably a win for my purposes :)
3. It doesn't need such extreme timing as a classic
Covox, as it has its own
16-sample FIFO buffer.
16 samples? As in 2ms? I suppose in true Disney Sound
Source style, "barely anything" is better than
"absolutely nothing"! Will have a mooch around and see
if there's an off the shelf FIFO to fit that bill.
Hmm. My interest is piqued but I really want to finish writing my Acorn terminal emulator before I move onto something else.
At our age, how much is there to hear above 7 kHz anyway? :D
Hmm. My interest is piqued but I really want to finish writing my Acorn terminal emulator before I move onto something else.
I support your choice of priorities! Terminal emulator sounds like an important project and deserves attention too.
The A3020 looks like a nice machine, what kind of speed do you expect your terminal emulator to be able to operate at? 115.2k seems doable? I am assuming this is serial port based, or are you writing a network client?
At our age, how much is there to hear above 7 kHz anyway? :D
Heha, well, ironically... despite it now being hard to
follow conversations in loud rooms I can still hear
those damned mosquito speakers they put in shopping
centres to stop teens loitering really clearly. But
then, when we went in for the ultrasound for my son 18
years ago I could hear that really clearly - including
the pitch changes when they adjusted the depth setting.
The little foetus went kind of nuts as well, must be
genetic :)
I support your choice of priorities! Terminal emulator sounds like an important project and deserves attention too.
Out of interest I tried just adding the serial handler
without assembler-ising the code and optimising it. It
needs the optimisations :) Or I need to find BBSes that
don't send more than one line of text at a time as it
can't keep up at volume and just hits the wall. I will
probably add a FIFO / circle buffer to soak up bursts
as some of the routines are just... slow.
Oh, this is serial. It didn't have a network card when
I rescued it from a skip 20 years ago and I've tried to
keep it original (other than the essential CF card to
IDE adaptor).
In theory its serial port can do 19200bps
but I believe it's not assured to be stable at that
rate so 9600 is the recommended maximum. Once I get all
the BASIC out of this it should cope at 9600.
FWIW I absolutely love the A3020, and I never even
experienced one back in the day so this is objective
love rather than nostalgic love :)
Wolf3D did indeed support Disney Sound Source. It looks like there's a driver to allow a Covox Speech Thing to work with Wolf3D also (though it's not supported by Wolf3D otherwise).
So that explains why Wolfenstein won't work with a DSS - it can't detect nor enable the DSS.
I'm speaking out of ignorance here and haven't done any research but I suspect detection will be based on one or more bits being latched (or reset?) when writing to the parallel port - it shouldn't be TOO complicated, I expect (simple is cheap), though it does add one more layer to the onion this project is becoming. ;)
For a short time some DOS titles had "Generic Parallel Port" or something similar, thats what I was thinking Wolf3d had... mebbe is was an early Doom with one of the Launchers... memory fails me now.
Ohhhh if its running interpreted BASIC I completely understand the serial speed problems. Based on the serial port speeds I assume there's no UART buffer - sounds like a good test of your optimization abilities!
If you're thinking about showing it off in videos, I'll be watching. :)
Ponder a lot of parallel ports were not bi-directional. Meaning you'd have to use a control line for detection, not a data line, and or the detection is only transient. Mind you I don't know if there were any port requirements for DSS or Covox.
Ohhhh if its running interpreted BASIC I completely understand theserial
speed problems. Based on the serial port speeds I assume there's no
There is some kind of buffer but I guess it's in system RAM rather than in the controller itself. For sure you need to go assembler to reliably drain it out before it fills :)
Re: Play audio from a serial port
Finally got the YouTube video up - if anyone's interested it is here:
https://youtu.be/Q9vlxCXxzrg
Bob - wonderful video! Great presentation and excellent demonstration of what's coming out of the serial port and how it sounds. Super well done.
Your observation about single keypresses with a low number of '0' bits being filtered out is interesting too - as you said, it makes sense when you think about it - such a clear demonstration can be really
enlightening to see in action.
Thank you for sharing your video, it's a great watch and you do a great job of showing us the technical details.
The audio quality is shockingly good! I know I would have been
overjoyed to have audio of this quality before I got a Soundblaster in
the 90s.
Sysop: | altere |
---|---|
Location: | Houston, TX |
Users: | 66 |
Nodes: | 4 (0 / 4) |
Uptime: | 09:46:22 |
Calls: | 728 |
Calls today: | 1 |
Files: | 7,666 |
Messages: | 295,332 |