From owner-freebsd-bugs Sat Jun 22 2: 0:25 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A877A37B411 for ; Sat, 22 Jun 2002 02:00:07 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5M907e91910; Sat, 22 Jun 2002 02:00:07 -0700 (PDT) (envelope-from gnats) Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117]) by hub.freebsd.org (Postfix) with ESMTP id 4B6DF37B400 for ; Sat, 22 Jun 2002 01:59:16 -0700 (PDT) Received: from www.freebsd.org (localhost [127.0.0.1]) by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g5M8xFhG021537 for ; Sat, 22 Jun 2002 01:59:15 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.2/8.12.2/Submit) id g5M8xFvS021536; Sat, 22 Jun 2002 01:59:15 -0700 (PDT) Message-Id: <200206220859.g5M8xFvS021536@www.freebsd.org> Date: Sat, 22 Jun 2002 01:59:15 -0700 (PDT) From: Dave Barker To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/39650: Digital audio extraction on an atapi CD does not use DMA even when atamode is DMA Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 39650 >Category: kern >Synopsis: Digital audio extraction on an atapi CD does not use DMA even when atamode is DMA >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jun 22 02:00:07 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Dave Barker >Release: 4.5 x86 >Organization: BAE SYSTEMS >Environment: FreeBSD deluge.my.domain 4.5-RELEASE FreeBSD 4.5-RELEASE #4: Fri Jun 21 10:18:06 CST 2002 toor@deluge.my.domain:/usr/src/sys/compile/DELUGE i386 >Description: Even with atapi CD DMA turned on and working, digital audio extraction (using dagrab) still uses PIO. Hence DAE is slow and consumes too much CPU time. "atapi-all.c" looks at the atapi command packet and only sets up a DMA transfer for normal reads and writes. >How-To-Repeat: Run dagrab to extract an audio track. Speeds will be low, and top will report little idle time and lots of interrupt time. Before patching, I could only achieve 12x DAE on my PlexWriter 16/10/40A (Athlon 1.3GHz system) at around 100% CPU usage. After patching, I get up to 33x (outer tracks) at around 5% CPU usage. >Fix: DMA to be used to for DAE, provided DMA is enabled for the drive, and a new sysctl tunable has not been set to force PIO transfers for DAE. Tested on several audio CDs and 2 CD readers on my Athlon system: atapci0: port 0xe000-0xe00f at device 17.1 on pci0 acd0: DVD-ROM at ata1-master using UDMA33 acd1: CD-RW at ata1-slave using UDMA33 New tunable: hw.ata.atapi_dae_without_dma: 0 Patch to /usr/src/sys/dev/ata/atapi-all.c: begin 644 atapi-all.c.diff M*BHJ("]U7,O9&5V+V%T M82]A=&%P:2UA;&PN8PE&65R(BD["B`@7-C=&P@+7<@:'2!D M969A=6QT+"!D:6=I=&%L(&%U9&EO(&5X=')A8W1I;VX@*$1!12D@=VEL;"!U M7-C=&P@:'Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message