Module Name:    src
Committed By:   martin
Date:           Tue Mar  2 15:57:06 UTC 2021

Modified Files:
        src/share/man/man4 [netbsd-9]: pad.4

Log Message:
Pull up following revision(s) (requested by nia in ticket #1220):

        share/man/man4/pad.4: revision 1.7
        share/man/man4/pad.4: revision 1.8
        share/man/man4/pad.4: revision 1.9
        share/man/man4/pad.4: revision 1.10

Use /dev/audioX rather than /dev/soundX in examples.

Avoids accidentally running into confusing behavior.
Add another example of recording the output of an application.

Explain something that confused me.

Slightly adjust wording.

It does seem to work with multiple applications concurrently writing to
the device in a quick test I did.

Explain the format of the raw PCM data users can read from a pad(4).

Since it's headerless this is important so the data can be interpreted
properly. Also, ordinary audio ioctls cannot be used on a pad and the
format can't be changed, so applications that attempt to automatically
determine the format of a device like audiorecord don't work.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.8.1 src/share/man/man4/pad.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/pad.4
diff -u src/share/man/man4/pad.4:1.6 src/share/man/man4/pad.4:1.6.8.1
--- src/share/man/man4/pad.4:1.6	Mon Jul  3 21:30:58 2017
+++ src/share/man/man4/pad.4	Tue Mar  2 15:57:06 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: pad.4,v 1.6 2017/07/03 21:30:58 wiz Exp $
+.\" $NetBSD: pad.4,v 1.6.8.1 2021/03/02 15:57:06 martin Exp $
 .\"
 .\" Copyright (c) 2007 Jared D. McNeill <jmcne...@invisible.ca>
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 11, 2007
+.Dd February 6, 2021
 .Dt PAD 4
 .Os
 .Sh NAME
@@ -36,19 +36,27 @@
 .Sh DESCRIPTION
 .Nm
 is a pseudo-device driver which provides support for feeding back PCM data
-from a consumer of the
+from consumers of an
 .Xr audio 4
-API to userland.
+device to userland.
+.Pp
+The raw PCM data readable from
+.Pa /dev/padN
+is encoded in stereo little-endian 16-bit linear PCM at 44100 Hz.
 .Sh FILES
 The
 .Nm
 pseudo-device driver receives data from
-.Pa /dev/soundN
+.Pa /dev/audioN
 and feeds the raw PCM output to
 .Pa /dev/padN .
+.Pa /dev/audioN
+is created once
+.Pa /dev/padN
+is opened.
 .Bl -item
 .It
-.Pa /dev/soundN
+.Pa /dev/audioN
 .It
 .Pa /dev/padN
 .El
@@ -56,7 +64,13 @@ and feeds the raw PCM output to
 The following example streams an MP3 to an Apple AirTunes compatible device:
 .Bd -literal -offset indent
 $ rtunes - < /dev/pad0 &
-$ mpg123 -a /dev/sound1 mozart.mp3
+$ mpg123 -a /dev/audio1 mozart.mp3
+.Ed
+.Pp
+Record the output of an application (in this case, audioplay):
+.Bd -literal -offset indent
+$ ffmpeg -f s16le -ar 44100 -ac 2 -i /dev/pad0 output.wav
+$ audioplay -d /dev/audio1 input.wav
 .Ed
 .Sh SEE ALSO
 .Xr audio 4

Reply via email to