[sci.electronics] Audio from a VGA card

rackland@csis.dit.csiro.au (Ross Ackland) (11/13/90)

The other day, an idea struck me from the twilight zone. It seemed stupid
at first but the more I thought about it the more it seemed feasible.

The video DAC's on a VGA card (IBM-PC) are good for quite a few MHz, 
so would it be possible to generate audio from them in the form of music 
or speech?

I guess a low pass filter would help. You would cut one or two lines going 
to the monitor and stick them into an amplifier. Hey, the video signal should 
be well above the audio range, what about video and audio at the same time 
(that would be impressive!).

Or, we could even modulate the audio (using the palette registers) and build
an AM  transmitter!!!! What happens to the signal during vertical and 
horizontal retrace? I don't know enough about programming VGA's at the 
register level (I wish I did).

I'm beginining to get out of control on this one and my days of undergraduate
Elec Eng and signal theory are long gone.

Don't flame me for this, if its beyond the ridiculous then let me die a 
natural death, if you think its feasible then lets hear your ideas...

Ross Ackland

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Internet : rackland@csis.dit.csiro.au
 Voice    : +61-6-2750911
 Fax      : +61-6-2571052                            
 Physical : CSIRO Division of Information Technology,
           GPO Box 664, Canberra ACT 2601
           AUSTRALIA
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

rackland@csis.dit.csiro.au (Ross Ackland) (11/15/90)

Had an interesting reply to my original suggestion of generating audio 
using the video DAC's on a VGA card. Here it is in a slightly edited
form:


>Your idea is not bad at all.  I thought of doing the same thing with one of
>HP's hi-res video cards awhile back.  The biggest problem to overcome is the
>horizontal and vertical blanking intervals.  You will have to program the
>VGA timing registers so as to generate NO interval at all, lest you get
>a bad 60 Hz buzz and such.  I'm not sure if it can be done, but its worth a
>try.  Also, you should capacitively couple the signal into your amp.  Use about
>1000uf cap, positive side connected to VGA.  I recommend testing on a cheap
>amp before you try your home stereo.  Finally, be sure to DISCONNECT or
>TURN OFF your monitor when you enable the program.  You can very easily
>damage many monitors with out-of-spec timing.  You can try a sine wave at
>first to test it out.  The VGA dot clock is about 25 MHz (I think), so
>each pixel represents a 40 ns sample of sound.  You will need to use mode 0x13
>(320x200x256) to get 8 bits per pixel/sample.     Unfortunately, in this mode,
>scan lines are doubled and pixel rates are halved.  This results in only
>80ns * 320 *200 = 2.5 milliseconds of sound in one frame.  Thus, not only
>will you signals have to be periodic on a scan-line basis, but also on a
>frame basis (the ends of scan lines must approach each other in value, as
>well as the top and bottom of the frame).  
>
>Due to the limited amount of sound per per frame, and the
>inability to update the frame in 2.5 ms, I scrapped the effort and never
>built anything.
>
>Also note that VGA RAMDACS only give you 6 bits per gun, which is
>really a shame. 
>
>Finally, it is worthy of note that the original MacIntosh used
>a similar scheme to get sound and floppy motor drive signals.
>However, they only used one word of data per scanline (at the 
>end of each line) and gated that word to the sound DACs instead
>of the video DACs at the right moment.  Because the video ram 
>memory fetch still ran even during the blanking intervals, these
>did not affect the sound quality at all.  They still had the
>requirement that the last scanline sound data approach the
>first scanline sound data in value if you expect to avoid
>pops in the sound due to discontinuties.  Of course these pops
>would occur at a 60 Hz rate, and thus your filter might help
>with those too.
>
>Jim Christy
>HP Labs
>jchristy@hplren2.hpl.hp.com