Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jun 1998 11:14:04 +0100 (BST)
From:      Scott Mitchell <scott@dcs.qmw.ac.uk>
To:        Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc:        multimedia@FreeBSD.ORG
Subject:   Re: audio from atapi cd -- patches for 2.2.6
Message-ID:  <199806091014.LAA24933@hotpoint.dcs.qmw.ac.uk>
In-Reply-To: <199806080856.KAA15688@labinfo.iet.unipi.it>
References:  <199806081025.LAA14853@hotpoint.dcs.qmw.ac.uk> <199806080856.KAA15688@labinfo.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
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): <ST3660A>, 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): <CD420E/1.01>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone>, 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): <QUANTUM FIREBALL1080A>, 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<ready,opdone,check>
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<ready,opdone>, 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<ready,opdone,drq>, 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<ready,opdone,drq>, 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<ready,opdone,drq>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone,drq>, 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<ready,opdone>, error=0
atapi0.1: unknown phase
wcd0: i/o error, status=50<ready,opdone>, 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<ready,opdone,drq>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone,drq>, 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<ready,opdone,drq>, 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<ready,opdone,drq>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone>, 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<ready,opdone,drq>, 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<ready,opdone,drq>, 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<ready,opdone,drq>, 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<ready,opdone>, 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<ready,opdone,drq>, 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<ready,opdone,drq>, 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<ready,opdone,drq>, 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<ready,opdone>, 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 
<scott@dcs.qmw.ac.uk>   | 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806091014.LAA24933>