Subject: Toshiba CD-ROM fails to play audio under post-1.5 -current
To: None <current-users@netbsd.org>
From: Rafal Boni <rafal@mediaone.net>
List: current-users
Date: 12/14/2001 22:58:52
Folks:
	My CD-reader in my main development box has somehow taken a dis-
	like to the commands NetBSD sends it when I ask the OS to play CDs
	in that drive.  This used to work at some point in the past (though
	I don't recall well enough to correlate that with a -current date).

	The setup is roughly this: a Adaptec 2940U2W card, with a ZIP drive,
	the Toshiba CD-reader (connected to the sound card) and a Plextor
	CD-R/RW.  The Plextor play audio fine, but it's not connected to
	the sound card 8-)

	Attached is a log of a kernel compiled with SCSIDEBUG (it was done a
	while ago, but the code hasn't changed to make it work yet 8-), while
	I tried to use `cdplay'.  I've annotated it to note where I tried to
	use the CD-ROM (which failed) and where I tried it on the CD-R/RW
	where it worked OK.

Thanks for any clues,
--rafal

NetBSD 1.5X (CYCLOPS.SCSIDEBUG) #0: Tue Aug 21 07:44:10 EDT 2001
    rafal@cyclops:/extra/src-current/sys/arch/i386/compile/CYCLOPS.SCSIDEBUG
cpu0: Intel Pentium III (Coppermine) (686-class), 701.62 MHz
cpu0: I-cache 16 KB 32b/line 4-way, D-cache 16 KB 32b/line 2-way
cpu0: L2 cache 256 KB 32b/line 8-way
cpu0: features 383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features 383fbff<PGE,MCA,CMOV,FGPAT,PSE36,MMX,FXSR,SSE>
total memory = 255 MB
avail memory = 233 MB
[...]
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82443BX Host Bridge/Controller (rev. 0x03)
ppb0 at pci0 dev 1 function 0: Intel 82443BX AGP Interface (rev. 0x03)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga0 at pci1 dev 0 function 0: ATI Technologies Rage 128 GL AGP 2x (rev. 0x00)
[...]
pcib0: Intel 82371AB PCI-to-ISA Bridge (PIIX4) (rev. 0x02)
pciide0 at pci0 dev 7 function 1: Intel 82371AB IDE controller (PIIX4) (rev. 0x01)
pciide0: bus-master DMA support present
pciide0: primary channel wired to compatibility mode
wd0 at pciide0 channel 0 drive 0: <QUANTUM FIREBALLP LM30>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 28629 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 58633344 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66)
pciide0: primary channel interrupting at irq 14
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)
pciide0: secondary channel wired to compatibility mode
pciide0: disabling secondary channel (no drives)
[...]
ahc0 at pci0 dev 17 function 0
ahc0: interrupting at irq 10
ahc0: aic7890/91 Wide Channel A, SCSI Id=7, 16/255 SCBs
scsibus0 at ahc0: 16 targets, 8 luns per target
[...]
scsibus0: waiting 2 seconds for devices to settle...
scsipi_inqmatch: 15/0/1 <IOMEGA, ZIP 100, >
scsipi_inqmatch: 19/0/1 <IOMEGA, ZIP 100, J.03>
scsipi_inqmatch: 2/0/1 <, , >
sd0 at scsibus0 target 3 lun 0: <IOMEGA, ZIP 100, J.03> SCSI2 0/direct removable
sd0(ahc0:0:3:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x2 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 17 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x3a 0x0 0x0 0x0 0x0 0x0 0xff 0xfe 0x1 0x0 0x0 0x0 0x0 
sd0: drive offline
sd0: async, 8-bit transfers
sd0(ahc0:0:3:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x2 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 17 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x3a 0x0 0x0 0x0 0x0 0x0 0xff 0xfe 0x1 0x0 0x0 0x0 0x0 
scsipi_inqmatch: 2/5/1 <, , >
scsipi_inqmatch: 2/5/1 <, , >
cd1 at scsibus0 target 4 lun 0: <PLEXTOR, CD-R   PX-W124TS, 1.07> SCSI2 5/cdrom removable
cd1: sync (50.0ns offset 8), 8-bit (20.000MB/s) transfers
cd1(ahc0:0:4:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x2 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 10 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x4 0x1 0x0 0x0 0x0 0x0 
cd1(ahc0:0:4:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x2 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 10 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x4 0x1 0x0 0x0 0x0 0x0 
scsipi_inqmatch: 2/5/1 <, , >
scsipi_inqmatch: 2/5/1 <, , >
cd0 at scsibus0 target 5 lun 0: <TOSHIBA, CD-ROM XM-6401TA, 1015> SCSI2 5/cdrom removable
cd0: sync (50.0ns offset 16), 8-bit (20.000MB/s) transfers
cd0(ahc0:0:5:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x2 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 10 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x3a 0x0 0x0 0x0 0x0 0x0 
IPsec: Initialized Security Association Processing.
sd0(ahc0:0:3:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x2 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 17 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x3a 0x0 0x0 0x0 0x0 0x0 0xff 0xfe 0x1 0x0 0x0 0x0 0x0 
sd0(ahc0:0:3:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x2 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 17 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x3a 0x0 0x0 0x0 0x0 0x0 0xff 0xfe 0x1 0x0 0x0 0x0 0x0 
sd0(ahc0:0:3:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x2 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 17 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x3a 0x0 0x0 0x0 0x0 0x0 0xff 0xfe 0x1 0x0 0x0 0x0 0x0 
sd0(ahc0:0:3:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x2 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 17 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x3a 0x0 0x0 0x0 0x0 0x0 0xff 0xfe 0x1 0x0 0x0 0x0 0x0 
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)
wsdisplay0: screen 5 added (80x25, vt100 emulation)
wsdisplay0: screen 6 added (80x25, vt100 emulation)
wsdisplay0: screen 7 added (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0

****
**** Ok, here starts the debug output for cd0, the Toshiba CD-ROM.  Everytime
**** I attempt to play audio CD's in the drive, I get an EINVAL back from the
**** OS.  This has been happening for a long time under post 1.5 -current.
****

cd0(ahc0:0:5:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x2 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 10 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x3a 0x0 0x0 0x0 0x0 0x0 
cd0(ahc0:0:5:0):  command: 0x1e,0x0,0x0,0x0,0x0,0x0-[0 bytes]
cd0(ahc0:0:5:0): cdopen: dev=0xf03 (unit 0 (of 4), partition 3)
cd0(ahc0:0:5:0):  command: 0x0,0x0,0x0,0x0,0x0,0x0-[0 bytes]
cd0(ahc0:0:5:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x6 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 10 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x28 0x0 0x0 0x0 0x0 0x0 
cd0(ahc0:0:5:0):  command: 0x0,0x0,0x0,0x0,0x0,0x0-[0 bytes]
cd0(ahc0:0:5:0): cdopen: scsipi_test_unit_ready, error=0
cd0(ahc0:0:5:0):  command: 0x42,0x0,0x40,0x1,0x0,0x0,0x0,0x0,0x30,0x0-[48 bytes]
------------------------------
000: 00 00 00 0c 01 10 01 00 00 00 00 00 ff ff 00 de 
016: 35 01 00 00 c4 9d c7 d3 bc 7b 16 c0 a8 c8 aa d3 
032: 06 00 00 00 24 c8 aa d3 dc 9d c7 d3 df 58 16 c0 
------------------------------
cd0(ahc0:0:5:0):  command: 0x1b,0x0,0x0,0x0,0x1,0x0-[0 bytes]
cd0(ahc0:0:5:0): cdopen: scsipi_start, error=0
cd0(ahc0:0:5:0):  command: 0x1e,0x0,0x0,0x0,0x1,0x0-[0 bytes]
cd0(ahc0:0:5:0): cdopen: scsipi_prevent, error=0
cd0(ahc0:0:5:0):  command: 0x25,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0-[8 bytes]
------------------------------
000: 00 05 14 8e 00 00 08 00 
------------------------------
cd0(ahc0:0:5:0): 2048 bytes @ blk 0
cd0(ahc0:0:5:0):  command: 0x8,0x0,0x0,0x0,0x1,0x0-[2048 bytes]
------------------------------
000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
------------------------------
cd0(ahc0:0:5:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x8 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 10 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x64 0x0 0x0 0x0 0x0 0x0 
cd0(ahc0:0:5:0):  Check Condition on CDB: 0x08 00 00 00 01 00
    SENSE KEY:  Blank Check
     ASC/ASCQ:  Illegal Mode For This Track

cd0(ahc0:0:5:0): 2048 bytes @ blk 1
cd0(ahc0:0:5:0):  command: 0x8,0x0,0x0,0x0,0x1,0x0-[2048 bytes]
------------------------------
000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
------------------------------
cd0(ahc0:0:5:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x8 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 10 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x64 0x0 0x0 0x0 0x0 0x0 
cd0(ahc0:0:5:0):  Check Condition on CDB: 0x08 00 00 00 01 00
    SENSE KEY:  Blank Check
     ASC/ASCQ:  Illegal Mode For This Track

cd0: no disk label
cd0(ahc0:0:5:0):  command: 0x1e,0x0,0x0,0x0,0x0,0x0-[0 bytes]
cd0(ahc0:0:5:0): cdopen: dev=0xf03 (unit 0 (of 4), partition 3)
cd0(ahc0:0:5:0):  command: 0x0,0x0,0x0,0x0,0x0,0x0-[0 bytes]
cd0(ahc0:0:5:0): cdopen: scsipi_test_unit_ready, error=0
cd0(ahc0:0:5:0):  command: 0x42,0x0,0x40,0x1,0x0,0x0,0x0,0x0,0x30,0x0-[48 bytes]
------------------------------
000: 00 00 00 0c 01 10 01 00 00 00 00 00 ff ff 00 d7 
016: 36 01 00 00 c4 9d c7 d3 bc 7b 16 c0 a8 c8 aa d3 
032: 06 00 00 00 24 c8 aa d3 dc 9d c7 d3 df 58 16 c0 
------------------------------
cd0(ahc0:0:5:0):  command: 0x1b,0x0,0x0,0x0,0x1,0x0-[0 bytes]
cd0(ahc0:0:5:0): cdopen: scsipi_start, error=0
cd0(ahc0:0:5:0):  command: 0x1e,0x0,0x0,0x0,0x1,0x0-[0 bytes]
cd0(ahc0:0:5:0): cdopen: scsipi_prevent, error=0
cd0(ahc0:0:5:0):  command: 0x43,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0-[4 bytes]
------------------------------
000: 00 8a 01 10 
------------------------------
cd0(ahc0:0:5:0):  command: 0x43,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x8c,0x0-[140 bytes]
------------------------------
000: 00 8a 01 10 00 10 01 00 00 00 02 21 00 10 02 00 
016: 00 05 04 32 00 10 03 00 00 08 05 26 00 10 04 00 
032: 00 0b 14 49 00 10 05 00 00 0f 09 2b 00 10 06 00 
048: 00 13 15 14 00 10 07 00 00 17 03 1c 00 10 08 00 
------------------------------
cd0(ahc0:0:5:0):  command: 0x43,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0-[4 bytes]
------------------------------
000: 00 8a 01 10 
------------------------------
cd0(ahc0:0:5:0):  command: 0x43,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x8c,0x0-[140 bytes]
------------------------------
000: 00 8a 01 10 00 10 01 00 00 00 02 21 00 10 02 00 
016: 00 05 04 32 00 10 03 00 00 08 05 26 00 10 04 00 
032: 00 0b 14 49 00 10 05 00 00 0f 09 2b 00 10 06 00 
048: 00 13 15 14 00 10 07 00 00 17 03 1c 00 10 08 00 
------------------------------
cd0(ahc0:0:5:0):  command: 0x1a,0x0,0xe,0x0,0x1c,0x0-[28 bytes]
------------------------------
000: 1b 00 00 08 83 00 00 00 00 00 08 00 0e 0e 04 00 
016: 00 00 00 00 01 ff 02 ff 00 00 00 00 
------------------------------
cd0(ahc0:0:5:0):  command: 0x15,0x10,0x0,0x0,0x1c,0x0-[28 bytes]
------------------------------
000: 1b 00 00 08 83 00 00 00 00 00 08 00 0e 0e 04 00 
016: 00 00 00 00 01 ff 02 ff 00 00 00 00 
------------------------------
cd0(ahc0:0:5:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x5 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 10 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x26 0x0 0x0 0x8c 0x0 0x0 
cd0(ahc0:0:5:0):  Check Condition on CDB: 0x15 10 00 00 1c 00
    SENSE KEY:  Illegal Request
     ASC/ASCQ:  Invalid Field In Parameter List
         SKSV:  Error in Parameters, Offset 0, bit 4

cd0(ahc0:0:5:0):  command: 0x1e,0x0,0x0,0x0,0x0,0x0-[0 bytes]

****
**** Just for comparison, I turned on the debug flags on cd1, the Plextor
**** CD-RW and inserted an audio disc, then ran `cdplay -f /dev/rcd1d' 
**** started the disc playing, let it play for a few seconds and stopped
**** it.
****

cd1(ahc0:0:4:0):  sense debug information:
	code 0x70 valid 0x0
	seg 0x0 key 0x6 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 10 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x28 0x0 0x0 0x0 0x0 0x0 
cd1(ahc0:0:4:0):  sense debug information:
	code 0x70 valid 0x1
	seg 0x0 key 0x5 ili 0x0 eom 0x0 fmark 0x0

info: 0x0 0x0 0x0 0x0 followed by 10 extra bytes
	extra: 0x0 0x0 0x0 0x0 0x64 0x0 0x0 0x0 0x0 0x0 
cd1(ahc0:0:4:0):  Check Condition on CDB: 0x08 00 00 00 01 00
    SENSE KEY:  Illegal Request
     ASC/ASCQ:  Illegal Mode For This Track

cd1: dos partition I/O error
cd1(ahc0:0:4:0):  command: 0x1e,0x0,0x0,0x0,0x0,0x0-[0 bytes]
cd1(ahc0:0:4:0): cdopen: dev=0xf0b (unit 1 (of 4), partition 3)
cd1(ahc0:0:4:0):  command: 0x0,0x0,0x0,0x0,0x0,0x0-[0 bytes]
cd1(ahc0:0:4:0): cdopen: scsipi_test_unit_ready, error=0
cd1(ahc0:0:4:0):  command: 0x42,0x0,0x40,0x1,0x0,0x0,0x0,0x0,0x30,0x0-[48 bytes]
------------------------------
000: 00 15 00 0c 01 10 01 00 00 00 00 1e ff ff ff fd 
016: 3e 01 00 00 c4 ed c5 d3 bc 7b 16 c0 08 cc aa d3 
032: 06 00 00 00 84 cb aa d3 dc ed c5 d3 df 58 16 c0 
------------------------------
cd1(ahc0:0:4:0):  command: 0x1b,0x0,0x0,0x0,0x1,0x0-[0 bytes]
cd1(ahc0:0:4:0): cdopen: scsipi_start, error=0
cd1(ahc0:0:4:0):  command: 0x1e,0x0,0x0,0x0,0x1,0x0-[0 bytes]
cd1(ahc0:0:4:0): cdopen: scsipi_prevent, error=0
cd1(ahc0:0:4:0):  command: 0x43,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0-[4 bytes]
------------------------------
000: 00 8a 01 10 
------------------------------
cd1(ahc0:0:4:0):  command: 0x43,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x8c,0x0-[140 bytes]
------------------------------
000: 00 8a 01 10 00 10 01 00 00 00 02 21 00 10 02 00 
016: 00 05 04 32 00 10 03 00 00 08 05 26 00 10 04 00 
032: 00 0b 14 49 00 10 05 00 00 0f 09 2b 00 10 06 00 
048: 00 13 15 14 00 10 07 00 00 17 03 1c 00 10 08 00 
------------------------------
cd1(ahc0:0:4:0):  command: 0x43,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0-[4 bytes]
------------------------------
000: 00 8a 01 10 
------------------------------
cd1(ahc0:0:4:0):  command: 0x43,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x8c,0x0-[140 bytes]
------------------------------
000: 00 8a 01 10 00 10 01 00 00 00 02 21 00 10 02 00 
016: 00 05 04 32 00 10 03 00 00 08 05 26 00 10 04 00 
032: 00 0b 14 49 00 10 05 00 00 0f 09 2b 00 10 06 00 
048: 00 13 15 14 00 10 07 00 00 17 03 1c 00 10 08 00 
------------------------------
cd1(ahc0:0:4:0):  command: 0x1a,0x0,0xe,0x0,0x1c,0x0-[28 bytes]
------------------------------
000: 1b 00 00 08 00 00 00 00 00 00 08 00 0e 0e 04 00 
016: 00 00 00 00 01 ff 02 ff 00 00 00 00 
------------------------------
cd1(ahc0:0:4:0):  command: 0x15,0x10,0x0,0x0,0x1c,0x0-[28 bytes]
------------------------------
000: 1b 00 00 08 00 00 00 00 00 00 08 00 0e 0e 04 00 
016: 00 00 00 00 01 ff 02 ff 00 00 00 00 
------------------------------
cd1(ahc0:0:4:0):  command: 0x43,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0-[4 bytes]
------------------------------
000: 00 8a 01 10 
------------------------------
cd1(ahc0:0:4:0):  command: 0x43,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x8c,0x0-[140 bytes]
------------------------------
000: 00 8a 01 10 00 10 01 00 00 00 02 21 00 10 02 00 
016: 00 05 04 32 00 10 03 00 00 08 05 26 00 10 04 00 
032: 00 0b 14 49 00 10 05 00 00 0f 09 2b 00 10 06 00 
048: 00 13 15 14 00 10 07 00 00 17 03 1c 00 10 08 00 
------------------------------
cd1(ahc0:0:4:0):  command: 0x47,0x0,0x0,0x0,0x2,0x21,0x4a,0x1,0x12,0x0-[0 bytes]
cd1(ahc0:0:4:0):  command: 0x1b,0x0,0x0,0x0,0x0,0x0-[0 bytes]
cd1(ahc0:0:4:0):  command: 0x1e,0x0,0x0,0x0,0x0,0x0-[0 bytes]
cd1(ahc0:0:4:0):  command: 0x1e,0x0,0x0,0x0,0x0,0x0-[0 bytes]

----
Rafal Boni                                                   rafal@mediaone.net