NetBSD Problem Report #44677

From www@NetBSD.org  Fri Mar  4 08:11:49 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id C6C0263B904
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  4 Mar 2011 08:11:49 +0000 (UTC)
Message-Id: <20110304081148.E304D63B84D@www.NetBSD.org>
Date: Fri,  4 Mar 2011 08:11:48 +0000 (UTC)
From: mm_lists@pulsar-zone.net
Reply-To: mm_lists@pulsar-zone.net
To: gnats-bugs@NetBSD.org
Subject: NetBSD-5 pad(4) output always 2-channel
X-Send-Pr-Version: www-1.0

>Number:         44677
>Category:       kern
>Synopsis:       NetBSD-5 pad(4) output always 2-channel
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 04 08:15:00 +0000 2011
>Last-Modified:  Fri Mar 04 12:17:12 +0000 2011
>Originator:     Matthew Mondor
>Release:        NetBSD-5
>Organization:
>Environment:
NetBSD behemoth.xisop 5.1_STABLE NetBSD 5.1_STABLE (GENERIC_MM) #0: Thu Dec 30 08:12:30 EST 2010  root@behemoth.xisop:/usr/obj/sys/arch/i386/compile/GENERIC_MM i386

>Description:
Lately I wrote a software synthesizer.  I then had the idea to try
pad(4) for the first time to record the results to file.

The pad(4) device won't accept audio(4)-style ioctl(2)s to set such
configuration options, and thus can only be used via read-only
commands like dd(1) and cat(1) rather than audiorecord(1).
I understand that if those ioctl(2)s worked, non-identical pad(4)
and corresponding audio(4) configuration would be problematic.

When opening /dev/audio1 then setting it for 16-bit s-linear 44100
1-channel, the /dev/pad0 reader appears to still receive 2-channel
input.  If that is the expected behaviour, then it probably should
be documented.

In the case of my software synth, of course I could simply also
write the 1-channel output to a file directly instead.

The following is a sample recorded directly by the synthesizer:
http://ftp.pulsar-zone.net/pad/sample-real
$ audioplay -f -c1 -e slinear_le -P 16 -s 44100 ./sample-real

Followed by the pad(4) recorded result:
http://ftp.pulsar-zone.net/pad/sample-pad
$ audioplay -f -c2 -e slinear_le -P 16 -s 44100 /tmp/sample-pad

Note that the extra bytes (sample-pad is slightly larger than twice
the size of sample-real) are due to real-time software lag of the
unoptimized prototype implementation.

>How-To-Repeat:
Open /dev/audio1 and send 1-channel data to it, while recording from
/dev/pad0 using dd(1).  Notice that the results are 2-channel.

>Fix:
Perhaps make pad(4) output 1-channel data when the corresponding
audio(4) device is also configured for 1-channel.  Or document that
pad(4) creates two channels in all cases, mirroring a single channel
to the second one.

>Release-Note:

>Audit-Trail:
From: Matthew Mondor <mm_lists@pulsar-zone.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/44677: NetBSD-5 pad(4) output always 2-channel
Date: Fri, 4 Mar 2011 03:22:44 -0500

 On Fri,  4 Mar 2011 08:15:01 +0000 (UTC)
 mm_lists@pulsar-zone.net wrote:

 My email address is mm_lists@pulsar-zone.net, not mm_lists@netbsd.org.
 Sorry for the inconvenience.
 -- 
 Matt

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.