Subject: Attempting to play audio CDs causes drive clicking?
To: None <port-i386@netbsd.org>
From: Brian de Alwis <bsd@manumission.org>
List: port-i386
Date: 01/09/2000 00:28:17
I can't seem to play audio CDs using my ASUS S500/A ATAPI CD-ROM.
(bootup info appended below).  xmcd is able to sense the disk and
read the CD information (it successfully looks up the CD in the CDDB).
Choosing play causes the drive to emit `clicking' sounds, like the
head is being snapped back for some reason. This happens about 10 times
before the program fails; xcdplayer
produces:

    ioctl(cdromsubchnl): /dev/rcd0d: Input/output error
    ioctl(cdromsubchnl): /dev/rcd0d: Input/output error

(xmcd error log appended below). The syslog has repeated:

    pciide0:1:0: lost interrupt
	    type: atapi
	    c_bcount: 48
	    c_skip: 0
    pciide0:1:0: device timeout, c_bcount=48, c_skip=0
    cd0: transfer error, downgrading to DMA mode 2
    cd0(pciide0:1:0): using PIO mode 4, DMA mode 2 (using DMA data
    transfers)

The DMA is downgraded twice. I noticed from cd(4) man page
mentions:

    The audio code in the cd driver only support SCSI-2 standard
    audio commands.  Because many CD-ROM manufacturers have not followed
    the standard, there are many CD-ROM drives for which audio will
    not work.  Some work is planned to support some of the more common
    `broken' CD-ROM drives; however, this is not yet under way.

Could this be the problem? Is there any way I can figure out if
this is true for my CD-ROM? 

Help? I'm pretty lost about where to go next.
Is anybody else able to play audio CDs on an ATAPI CD-ROM
under NetBSD?  The media cable is connected between the drive and
my audio card (which does work), and am able to cause audio CDs to
be played under Windows.

Thanks.


Boot-up information:

    NetBSD 1.4.1 (GFFC) #5: Sun Dec  5 09:19:57 PST 1999
	bsd@gffc.manumission.org:/usr/src/sys/arch/i386/compile/GFFC
    [trimmed]
    pciide0 at pci0 dev 4 function 1: Intel 82371AB IDE controller (PIIX4)
    pciide0: bus-master DMA support present
    pciide0: primary channel wired to compatibility mode
    [trimmed wd0 stuff]
    pciide0: primary channel interrupting at irq 14
    pciide0: secondary channel wired to compatibility mode
    atapibus0 at pciide0 channel 1
    cd0 at atapibus0 drive 0: <ASUS CD-S500/A, , V3.1H> type 5 cdrom removable
    cd0: 32-bits data port
    cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2
    pciide0: secondary channel interrupting at irq 15
    wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)
    cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)
    [trimmed]
    pciide0:1:0: lost interrupt
	    type: atapi
	    c_bcount: 0
	    c_skip: 0
    pciide0:1:0: device timeout, c_bcount=0, c_skip=0
    cd0: transfer error, downgrading to DMA mode 2
    cd0(pciide0:1:0): using PIO mode 4, DMA mode 2 (using DMA data transfers)
    pciide0:1:0: lost interrupt
	    type: atapi
	    c_bcount: 48
	    c_skip: 0
    pciide0:1:0: device timeout, c_bcount=48, c_skip=0
    cd0: transfer error, downgrading to PIO mode 4
    cd0(pciide0:1:0): using PIO mode 4
    pciide0:1:0: lost interrupt
	    type: atapi
	    c_bcount: 48
	    c_skip: 0
    pciide0:1:0: device timeout, c_bcount=48, c_skip=0
    pciide0:1:0: lost interrupt
	    type: atapi
	    c_bcount: 48
	    c_skip: 0
    pciide0:1:0: device timeout, c_bcount=48, c_skip=0
    [repeated...]

xmcd -debug produces:

    XMCD v2.5 PL1 DEBUG MODE

    [...trimmed...]
    libdi: NetBSD ioctl method
    [...trimmed...]
    Common parameters:
	    device:				/dev/rcd0d
    [...trimmed...]
    Device-specific (privileged) parameters:
	    devnum:				0
	    deviceList:			/dev/rcd0d
	    deviceInterfaceMethod:		2
	    driveVendorCode:		0
	    numDiscs:			1
	    mediumChangeMethod:		0
	    scsiAudioVolumeBase:		0
	    minimumPlayBlocks:		25
	    playAudio10Support:		False
	    playAudio12Support:		False
	    playAudioMSFSupport:		True
	    playAudioTISupport:		True
	    loadSupport:			True
	    ejectSupport:			True
	    modeSenseSetDBD:		False
	    volumeControlSupport:		True
	    balanceControlSupport:		True
	    channelRouteSupport:		False
	    pauseResumeSupport:		True
	    strictPauseResume:		False
	    playPausePlay:			False
	    caddyLockSupport:		True
	    curposFormat:			False
	    noTURWhenPlaying:		False

    Device-specific (user-modifiable) parameters:
	    volumeControlTaper:		0
	    channelRoute:			0
	    spinDownOnLoad:			True
	    playOnLoad:			False
	    ejectOnDone:			False
	    ejectOnExit:			False
	    stopOnExit:			True
	    exitOnEject:			False
	    closeOnEject:			False
	    caddyLock:			True
	    repeatMode:			False
	    shuffleMode:			False
	    multiPlay:			False
	    reversePlay:			False
	    internalSpeakerEnable:		False


    Lock file: /tmp/.cdaudio/lock.f03

    Open: /dev/rcd0d

    IOCTL: CDIOCREADSUBCHANNEL arg=0xefbfd12c ret=0

    status=CD_AS_PLAY_COMPLETED

    IOCTL: CDIOREADTOCHEADER arg=0xefbfd128 ret=0

    IOCTL: CDIOCREADSUBCHANNEL arg=0xefbfd12c ret=0

    status=CD_AS_PLAY_COMPLETED

    IOCTL: CDIOREADTOCHEADER arg=0xefbfd128 ret=0

    IOCTL: CDIOREADTOCENTRYS arg=0xefbfd120 ret=0

    a1=0x20000 a2=0xc142a00

    IOCTL: CDIOCREADSUBCHANNEL arg=0xefbfd12c ret=0

    status=CD_AS_PLAY_COMPLETED

    IOCTL: CDIOREADTOCHEADER arg=0xefbfd128 ret=0

    IOCTL: CDIOREADTOCENTRYS arg=0xefbfd120 ret=0

    a1=0x20000 a2=0xc142a00

    IOCTL: CDIOCREADSUBCHANNEL arg=0xefbfd3a0 ret=0

    status=CD_AS_PLAY_COMPLETED

    IOCTL: CDIOREADTOCHEADER arg=0xefbfd39c ret=0

    IOCTL: CDIOREADTOCENTRYS arg=0xefbfd394 ret=0

    a1=0x20000 a2=0xc142a00

    ioc_vol data bytes:
    0000    ff ff 00 00 -- -- -- --  -- -- -- -- -- -- -- --    ................

    IOCTL: CDIOCSETVOL arg=0xefbfd3a4 ret=0

    IOCTL: CDIOREADTOCHEADER arg=0xefbfd3d4 ret=0

    ioc_toc_header data bytes:
    0000    6a 00 01 0c -- -- -- --  -- -- -- -- -- -- -- --    j...............

    ioc_read_toc_entry data bytes:
    0000    02 01 68 00 80 95 0e 00  -- -- -- -- -- -- -- --    ..h.............

    IOCTL: CDIOREADTOCENTRYS arg=0xefbfd388 ret=0

    cd_toc_entry data bytes:
    0000    00 10 01 00 00 00 02 00  00 10 02 00 00 04 2f 16    ............../.
    0010    00 10 03 00 00 08 31 0f  00 10 04 00 00 0c 1e 11    ......1.........
    0020    00 10 05 00 00 10 06 07  00 10 06 00 00 14 04 41    ...............A
    0030    00 10 07 00 00 18 19 2a  00 10 08 00 00 1c 39 11    .......*......9.
    0040    00 10 09 00 00 20 1e 28  00 10 0a 00 00 23 03 16    ..... .(.....#..
    0050    00 10 0b 00 00 27 0e 2a  00 10 0c 00 00 2a 14 0c    .....'.*.....*..
    0060    00 10 aa 00 00 2e 28 37  -- -- -- -- -- -- -- --    ......(7........

    IOCTL: CDIOCPREVENT arg=0x0 ret=0

    IOCTL: CDIOCSTOP arg=0x0 ret=0

    Writing current disc info file: /tmp/.cdaudio/curr.f03

    [...trimmed...]

    * PLAY_PAUSE

    IOCTL: CDIOCREADSUBCHANNEL arg=0xefbfd13c ret=0

    status=CD_AS_PLAY_COMPLETED

    IOCTL: CDIOREADTOCHEADER arg=0xefbfd138 ret=0

    IOCTL: CDIOREADTOCENTRYS arg=0xefbfd130 ret=0

    a1=0x20000 a2=0xc142a00

    IOCTL: CDIOCSTART arg=0x0 ret=0

    ioc_play_msf data bytes:
    0000    00 02 00 2e 28 2d -- --  -- -- -- -- -- -- -- --    ....(-..........

    IOCTL: CDIOCPLAYMSF arg=0xefbfd144 ret=0

    Writing current disc info file: /tmp/.cdaudio/curr.f03

    ioc_read_subchannel data bytes:
    0000    02 01 00 00 30 00 00 00  14 d3 bf ef -- -- -- --    ....0...........

    IOCTL: CDIOCREADSUBCHANNEL arg=0xefbfd2ec ret=-1
    CD audio: ioctl error on /dev/rcd0d: cmd=CDIOCREADSUBCHANNEL errno=5

    IOCTL: CDIOCREADSUBCHANNEL arg=0xefbfd2a4 ret=-1
    CD audio: ioctl error on /dev/rcd0d: cmd=CDIOCREADSUBCHANNEL errno=5

    Writing current disc info file: /tmp/.cdaudio/curr.f03

    IOCTL: CDIOCREADSUBCHANNEL arg=0xefbfd2a4 ret=-1
    CD audio: ioctl error on /dev/rcd0d: cmd=CDIOCREADSUBCHANNEL errno=19

    IOCTL: CDIOCREADSUBCHANNEL arg=0xefbfd2a4 ret=-1
    CD audio: ioctl error on /dev/rcd0d: cmd=CDIOCREADSUBCHANNEL errno=5
    [repeated until...]
    Close: /dev/rcd0d