From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id 468E42F36E for ; Fri, 5 Jan 2001 19:35:22 -0500 (EST) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f060ZMN17530 for axp-list@listman.redhat.com; Fri, 5 Jan 2001 19:35:22 -0500 Received: from GTEDHCP-136.inetarena.com (GTEDHCP-136.inetarena.com [206.129.92.136]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f060ZKD17521 for ; Fri, 5 Jan 2001 19:35:20 -0500 Received: (from rob@localhost) by GTEDHCP-136.inetarena.com (8.9.3/8.9.3) id QAA06307 for axp-list@redhat.com; Fri, 5 Jan 2001 16:35:18 -0800 Date: Fri, 5 Jan 2001 16:35:18 -0800 From: "Robert M. Riches Jr." Message-Id: <200101060035.QAA06307@GTEDHCP-136.inetarena.com> To: axp-list@redhat.com Subject: soundcard input clipping X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0beta4 Precedence: bulk Reply-To: axp-list@redhat.com List-Id: Linux and Red Hat on Alpha processors My sound card digitizer is clipping the input at values it should be able to handle. I'm looking for suggestions/solutions. Hardware: UP2000, one processor (667MHz, EV67) Ensoniq AudioPCI ES1371 soundcard Software: Redhat 6.1, kernel 2.2.13 ALSA drivers, driver 0.5.8a rec, ElectricEars, and homebuilt recorder apps Format: signed 16-bit little endian, 44100 sps, stereo (AFMT_S16_LE from soundcard.h) All recorder applications have the same behavior. If I capture a level above about 0.76 of full-scale, the waveform clips. (A triangle wave generator was used for this measurement.) I don't believe the clipping is in the front-end analog portion of the sound card, because reducing the ALSA-mixer input gain makes the clipping entirely go away. The clipping looks the same when viewed with ElecticEars (sound editor) and with an oscilloscope hung on the line output of the sound card. Shouldn't a sound card be able to digitize to the full range of signed 16-bit integers without clipping? Is this a known problem with the Ensoniq card or the ALSA drivers? The workaround is to limit the input gain such that the digitized values stay below about 0.70 of full-scale, which only loses about 3dB of S/N ratio. Is there a better solution? (I couldn't believe how easy it was to write a capture program, using soundcard.h and audiofile.h. The hardest part of the program was generating the ASCII-art bar-graph level meters, current time display, etc.) Another quirk I observed with my homebuild capture program is the sound card or driver seems to buffer the data in chunks of about 65KB. I read chunks of 4KB at a time from /dev/dsp, and I get output in bursts of about 65KB at a time. Thanks. Robert Riches richesr1@inetarena.com