hubertf's NetBSD Blog
Send interesting links to hubert at feyrer dot de!
[20071113] pad(4) - pseudo audio device driver
Jared McNeill has committed his pseudo audio device driver, pad(4): ``With this pseudo-device, audio played back via the standard audio interfaces is redirected back to userland as raw PCM data on /dev/padN.

One example usage is to stream audio to an AirTunes compatible device using rtunes (, ie:

$ rtunes - < /dev/pad0
$ mpg123 -a /dev/sound1 blah.mp3 
Another option is to capture audio output from eg. Real Player, by simply instructing Real Player to output to /dev/sound1, and running:
$ cat /dev/pad0 > blah.pcm''

To find out what /dev/sound* device to use, use dmesg(8) output - Jared tells me that ``/dev/soundN and /dev/audioN are the same device; the only difference is behaviour on open -- /dev/audioN emulates traditional Sun audio behaviour and resets the device to a known configuration, whereas /dev/soundN uses the previous device state.

There is nothing yet to discover the attachment apart from dmesg:

$ dmesg | grep pad0
pad0: Pseudo Audio Device
pad0: outputs: 44100Hz, 16-bit, stereo
audio1 at pad0: half duplex''

[Tags: , ]

Disclaimer: All opinion expressed here is purely my own. No responsibility is taken for anything.

Access count: 29209743
Copyright (c) Hubert Feyrer