In 1979 I was debugging some Z80 assembler by putting a radio next to the processsor and picking up the RF noise. I could tell by the quality of the sound which loop it was in, and trace the execution as it happened. This was on a device that only had a serial line as its interface, and the problem was in the processing of the data, so it would occasionally just hang, making "standard" debugging impossible.<p>Later (1980) when I wrote a BASIC to Z80 compiler I used the same technique to profile the code and achieved a 5x speed-up by knowing which loops ran slowly.
Several years ago I was stuck in a data centre over night upgrading our systems with other team members who were working remotely. I was desperately tired and done my part, but had to wait around to monitor things while the rest finished up. Instead of staring at the screen, trying in vain to keep my eyes open, I put /dev/audio to good use by writing a simple script to wake me when tcpdump picked up the traffic I was looking for. I was able to lay my head down, guilt free, and steal 20 or 30 minutes of precious sleep between testing sessions.
>a good place to start, would be yes > /dev/audio, which outputs a high whining as the value 'y' is sent as audio over and over.<p>The key point of this combination is that yes outputs "y\ny\ny\n...". If you just send one character over and over you don't hear anything - I think the difference between adjacent character values determines the frequency of the output.<p>>Plus if there are any sound files on your drive saved in a lossless format they just play at random and then disappear back into the soup.<p>They need to be uncompressed (ie. contain raw audio data), not just lossless.
One of the better stories I've read was the guy who piped the output of ping to his speakers, turned the volume up, and went around the office wiggling the token ring cable listening out for the place with the unreliable connection.
<p><pre><code> cat /dev/urandom > /dev/audio
</code></pre>
I use it as a white noise generator, to cover ambient noise at night. Anyone know how to make a low pass filter (to make pink/red/brown noise)? I tried repeating the random source, to increase the wavelength, but it gets little R2D2 chirps and clicks in it (because of the step-like waveform):<p><pre><code> cat /dev/urandom | sed 's/./&&&&&&/g' > /dev/audio</code></pre>
Many years ago this facet of Linux was the thing that really made me realize just how astonishingly wonderful the central idea of UNIX (everything is a file) really is. It also puts in stark contrast those systems that haven't grokked this beautifully simple idea.
It sounded like a dial up modem when I did this:<p><pre><code> cat /dev/mem > /dev/audio
</code></pre>
Also, for some reason, this command makes it "beep" on every eleventh character you type. Probably something to do with buffers.<p><pre><code> cat /dev/input/by-path/platform-i8042-serio-0-event-kbd > /dev/audio</code></pre>
even more fun<p><pre><code> wget http://www.wikipedia.com --output-document=- > /dev/audio
</code></pre>
Download a webpage, output to soundcard. Works pretty well, I need to find a bigger page to work with though.
Find all the .wav files and play them:
find . -name '*.wav' -exec cat {} > /dev/audio \;<p>I guess I don't have any at the right frequency, though :(
From the original document:<p>> In order for noise to happen there must be at least some variation.<p>It's pretty neat. The data pretty much represents the position of the speaker.<p>Audio stuff is pretty fascinating; I read a great book on explaining DSPs for audio processing. I'll have to dig it out of my closet.
Reminds me old days I tried to listen to the linux kernel :D. A small typo I did filled up the terminal with lots of garbage. Later I learned I can rcover such a situation with..<p>$reset