From owner-freebsd-multimedia Tue Jun 9 05:24:18 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA01404 for freebsd-multimedia-outgoing; Tue, 9 Jun 1998 05:24:18 -0700 (PDT) (envelope-from owner-freebsd-multimedia@FreeBSD.ORG) Received: from hotpoint.dcs.qmw.ac.uk (hotpoint.dcs.qmw.ac.uk [138.37.88.162]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA04967 for ; Tue, 9 Jun 1998 03:14:08 -0700 (PDT) (envelope-from scott@dcs.qmw.ac.uk) Received: from brunos-sun.dcs.qmw.ac.uk [138.37.88.185]; by hotpoint.dcs.qmw.ac.uk (8.8.7/8.8.5/S-4.0) with SMTP; id LAA24933; Tue, 9 Jun 1998 11:14:04 +0100 (BST) Date: Tue, 9 Jun 1998 11:14:04 +0100 (BST) Message-Id: <199806091014.LAA24933@hotpoint.dcs.qmw.ac.uk> Received: locally by brunos-sun (SMI-8.6/QMW-client-3.2b); poster "scott"; id LAA17033; Tue, 9 Jun 1998 11:08:59 +0100 From: Scott Mitchell To: Luigi Rizzo Cc: multimedia@FreeBSD.ORG Subject: Re: audio from atapi cd -- patches for 2.2.6 In-Reply-To: <199806080856.KAA15688@labinfo.iet.unipi.it> References: <199806081025.LAA14853@hotpoint.dcs.qmw.ac.uk> <199806080856.KAA15688@labinfo.iet.unipi.it> X-Mailer: VM 6.31 under 20.2 XEmacs Lucid Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Luigi Rizzo said: >ok. if you can play with the changes in wcd.c near the probe routine >(where it calls atapi_request_immediate() to do an ATAPI_MODE_SENSE) >could you see if you manage to make things work again ? Maybe some >additioanl printf on the result from the above call, or some additional >test to decide when to exit the loop, might help to understand what is >going on. I had a play around to see if I could figure anything out -- but as I know basically nothing about how ATAPI works I don't know how much I achieved :) Anyway, with DEBUG turned on in atapi.c (plus a few extra printfs) I get the following from dmesg for my two IDE controllers: [...] wdc0 at 0x1f0-0x1f7 irq 14 flags 0x80ff80ff on isa wdc0: unit 0 (wd0): , multi-block-16 wd0: 520MB (1065456 sectors), 1057 cyls, 16 heads, 63 S/T, 512 B/S atapi0.1 at 0x1f0: attach called wdc0: unit 1 (atapi): , removable, cmd12, slow, iordy atapi0.1 at 0x1f0: calling wcdattach wcd0: info 80-85-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-3-0-0-2-0-0-31-2e-30-31-0-0-0-0-43-44-34-32-30-45-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-a-0-0-0-2-0-5-80-0-1-1f-0-0-0-43-52-45-41-54-49-56-45-43-44-34-32-30-45-20-20-20-20-20-20-20-20-20-20-31-2e-30-31-0-0-0-0-70-0-0 atapi0.1: req im 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 len=28 atapi0.1: start atapi0.1: send cmd MODE_SENSE 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x1, len=28, status=50, error=0 atapi0.1: unknown phase atapi0.1: req im 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 len=28 atapi0.1: start atapi0.1: send cmd MODE_SENSE 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x1, len=28, status=50, error=0 atapi0.1: unknown phase atapi0.1: req im 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 len=28 atapi0.1: start atapi0.1: send cmd MODE_SENSE 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x1, len=28, status=50, error=0 atapi0.1: unknown phase atapi0.1: req im 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 len=28 atapi0.1: start atapi0.1: send cmd MODE_SENSE 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x1, len=28, status=50, error=0 atapi0.1: unknown phase atapi0.1: req im 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 len=28 atapi0.1: start atapi0.1: send cmd MODE_SENSE 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x1, len=28, status=50, error=0 atapi0.1: unknown phase atapi0.1: req im 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 len=28 atapi0.1: start atapi0.1: send cmd MODE_SENSE 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x1, len=28, status=50, error=0 atapi0.1: unknown phase atapi0.1: req im 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 len=28 atapi0.1: start atapi0.1: send cmd MODE_SENSE 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x1, len=28, status=50, error=0 atapi0.1: unknown phase atapi0.1: req im 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 len=28 atapi0.1: start atapi0.1: send cmd MODE_SENSE 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x1, len=28, status=50, error=0 atapi0.1: unknown phase atapi0.1: req im 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 len=28 atapi0.1: start atapi0.1: send cmd MODE_SENSE 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x1, len=28, status=50, error=0 atapi0.1: unknown phase atapi0.1: req im 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 len=28 atapi0.1: start atapi0.1: send cmd MODE_SENSE 5a-0-2a-0-0-0-0-0-1c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x1, len=28, status=50, error=0 atapi0.1: unknown phase atapi0.1 at 0x1f0: attached! wdc1 at 0x170-0x177 irq 15 flags 0x80ff80ff on isa wdc1: unit 0 (wd2): , multi-block-8 wd2: 1039MB (2128896 sectors), 2112 cyls, 16 heads, 63 S/T, 512 B/S atapi1.0 at 0x170: attach called atapiX.0 at 0x170: identify not ready, status=51 atapi1.1 at 0x170: attach called atapiX.1 at 0x170: identify not ready, status=0 [...] After that, two attempts to mount a regular CD-ROM produced the following on the console (the mount succeeded on the second attempt): [...] atapi0.1: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0 atapi0.1: start atapi0.1: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x3, len=0, status=50, error=0 atapi0.1: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12 atapi0.1: start atapi0.1: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=12, status=58, error=0 atapi0.1: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12 atapi0.1: start atapi0.1: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=12, status=58, error=0 atapi0.1: req w 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0 len=8 atapi0.1: start atapi0.1: send cmd READ_CAPACITY 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=8, status=58, error=0 atapi0.1: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0 atapi0.1: start atapi0.1: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x3, len=0, status=50, error=0 atapi0.1: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0 atapi0.1: start atapi0.1: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x3, len=0, status=50, error=0 atapi0.1: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0 atapi0.1: start atapi0.1: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x3, len=0, status=50, error=0 atapi0.1: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12 atapi0.1: start atapi0.1: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=12, status=58, error=0 atapi0.1: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12 atapi0.1: start atapi0.1: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x1, len=12, status=50, error=0 atapi0.1: unknown phase wcd0: i/o error, status=50, error=0 atapi0.1: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0 atapi0.1: start atapi0.1: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=0, status=58, error=0 atapi0.1: req cb 28-0-0-0-0-10-0-0-1-0-0-0-0-0-0-0 len=2048 atapi0.1: start atapi0.1: send cmd READ_BIG 28-0-0-0-0-10-0-0-1-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x3, len=0, status=50, error=0 atapi0.1: recv data underrun, 2048 bytes left atapi0.1: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0 atapi0.1: start atapi0.1: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x3, len=0, status=50, error=0 atapi0.1: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0 atapi0.1: start atapi0.1: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x3, len=0, status=50, error=0 atapi0.1: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12 atapi0.1: start atapi0.1: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=12, status=58, error=0 atapi0.1: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12 atapi0.1: start atapi0.1: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=12, status=58, error=0 atapi0.1: req w 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0 len=8 atapi0.1: start atapi0.1: send cmd READ_CAPACITY 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=8, status=58, error=0 atapi0.1: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0 atapi0.1: start atapi0.1: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x3, len=0, status=50, error=0 atapi0.1: req w 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0 atapi0.1: start atapi0.1: send cmd PREVENT_ALLOW 1e-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x3, len=0, status=50, error=0 atapi0.1: req w 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 len=0 atapi0.1: start atapi0.1: send cmd TEST_UNIT_READY 0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x3, len=0, status=50, error=0 atapi0.1: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12 atapi0.1: start atapi0.1: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=12, status=58, error=0 atapi0.1: req w 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 len=12 atapi0.1: start atapi0.1: send cmd READ_TOC 43-0-0-0-0-0-0-0-c-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=12, status=58, error=0 atapi0.1: req w 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0 len=8 atapi0.1: start atapi0.1: send cmd READ_CAPACITY 25-0-0-0-0-0-0-0-8-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=8, status=58, error=0 atapi0.1: req w 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 len=0 atapi0.1: start atapi0.1: send cmd PREVENT_ALLOW 1e-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x3, len=0, status=50, error=0 atapi0.1: req cb 28-0-0-0-0-10-0-0-1-0-0-0-0-0-0-0 len=2048 atapi0.1: start atapi0.1: send cmd READ_BIG 28-0-0-0-0-10-0-0-1-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=2048, status=58, error=0 atapi0.1: req cb 28-0-0-0-0-18-0-0-1-0-0-0-0-0-0-0 len=2048 atapi0.1: start atapi0.1: send cmd READ_BIG 28-0-0-0-0-18-0-0-1-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=2048, status=58, error=0 atapi0.1: req cb 28-0-0-0-1-b1-0-0-1-0-0-0-0-0-0-0 len=2048 atapi0.1: start atapi0.1: send cmd READ_BIG 28-0-0-0-1-b1-0-0-1-0-0-0-0-0-0-0 atapi0.1: intr ireason=0x2, len=2048, status=58, error=0 [...] Reading the CD-ROM appeared to mostly work, although I did manage to lock up the bus by copying a large file from the CD to /dev/null. Cdd could read the TOC of an audio disc and *seemed* to be copying a track correctly, but hung up right at the end of the track. The file produced was about 58K, a little short for a three minute song. *Without* DEBUG turned on, the CD drive (and sometimes the whole bus) locks up no matter what I try, sometimes generating atapi0.1: invalid command phase, ireason=0x3, status=50, error=0 on the console. Note that I set the timeout in the call to tsleep() in atapi.c back to zero, as I wasn't sure exactly what value of HZ it was expecting. The output from ps indicates that it's waiting on 'atareq', so I guess it is stuck forever in the tsleep(). My off-the-cuff diagnosis: The drive is crap, and I should just replace it :) It looks to me like something is off with the timing, since it almost works when all the debug output is there to slow everything down (it gets logged to a drive on the same controller). If you think it's fixable I'm happy to mess around with the code some more, otherwise I'll toss the stupid thing out and buy one that works. Serves me right for buying evil hardware. Apologies for the length of this post. Cheers, Scott -- =========================================================================== Scott Mitchell | PGP Key ID |"If I can't have my coffee, I'm just | 0x54B171B9 | like a dried up piece of roast goat" QMW College, London, UK | 0xAA775B8B | -- J. S. Bach. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message