Subject: playing audio CDs
To: None <port-i386@netbsd.org>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: port-i386
Date: 04/14/2001 19:38:37
I am trying simply to play an audio CD with little success.

% cdplay info
track     start  duration   block  length   type
-------------------------------------------------
    1   0:02.33   4:09.57      33   18582  audio
    2   4:10.15   5:10.48   18615   23148  audio
...
   18  50:59.08   1:06.47  229283    4847  audio
  170  52:03.55         -  234130       -      -
% cdplay play
% cdplay status
Audio status:   playing
Current track:  1
Position:       0:02.60
Media catalog:  inactive
Left volume:    255
Right volume:   255

and the CD is spinning but I hear nothing!

% mixerctl -a
outputs.master=248,248
inputs.fmsynth=128,128
inputs.fmsynth.mute=off
inputs.fmsynth.swap=off
inputs.cd=128,128
inputs.cd.mute=off
inputs.cd.swap=off
outputs.cd.mute=off
inputs.dac=128,128
inputs.mic=0
inputs.mic.mute=off
inputs.mic.swap=off
outputs.mic.mute=off
inputs.line=0,0
inputs.line.mute=off
inputs.line.swap=off
outputs.line.mute=off
record.source=mic
equalization.treble=128,128
equalization.bass=128,128
inputs.pc_speaker=128
inputs.input=128,128
outputs.output=128,128
inputs.agc=off

% audioplay /dos/WINDOWS/MEDIA/CHIMES.WAV

does work - am I right in believing that audioplay will use the same mixerctl
settings as cdplay so they must be correct?

Next I attempted to read the CD into wav files and play those as CHIMES worked:

# cdda2wav -B -D/dev/cd0d
Type: ROM, Vendor 'CREATIVE' Model 'CD3231E  UC100  ' Revision '  1.' no MMC
cdda2wav: Input/output error. mode sense g0: scsi sendcmd: retryable error
CDB:  1A 00 01 00 0C 00
status: 0x0 (GOOD STATUS)
resid: 12
cmd finished after 0.003s timeout 300s
get_orig_sectorsize mode sense failed
249856 bytes buffer memory requested, 4 buffers, 26 sectors
#Cdda2wav version 1.9_netbsd_1.5o_i386_i386 soundcard support
AUDIOtrack pre-emphasis  copy-permitted tracktype channels
      1-18           no              no     audio    2
Table of Contents: total tracks:18, (total time 52:03.55)
  1.( 4:07.57),  2.( 5:08.48),  3.( 3:49.60),  4.( 7:06.62),  5.( 4:31.48)
  6.( 2:02.67),  7.( 1:18.50),  8.( 1:20.25),  9.( 1:34.53), 10.( 2:06.22)
 11.( 1:51.55), 12.( 1:08.35), 13.( 5:51.18), 14.( 0:58.35), 15.( 0:48.32)
 16.( 5:57.70), 17.( 1:12.63), 18.( 1:04.47),

Table of Contents: starting sectors
  1.(      33),  2.(   18615),  3.(   41763),  4.(   58998),  5.(   91010)
  6.(  111383),  7.(  120600),  8.(  126500),  9.(  132525), 10.(  139628)
 11.(  149100), 12.(  157480), 13.(  162615), 14.(  188958), 15.(  193343)
 16.(  196975), 17.(  223820), 18.(  229283), lead-out(  234130)
CDINDEX discid: jIr3w2Nh18.KGnVXl1Horc7A6ec-
CDDB discid: 0x160c3112
CD-Text: detected
CD-Extra: not detected
samplefile size will be 550596188 bytes.
recording 3121.02933 seconds stereo with 16 bits @ 44100.0 Hz ->'audio'...
overlap:min/max/cur, jitter, percent_done:
??/??/??/???????   0%cdda2wav: Input/output error. Read12: scsi sendcmd: retryable error
CDB:  D8 00 00 00 00 21 00 00 00 1A 00 00
status: 0x0 (GOOD STATUS)
resid: 61152
cmd finished after 0.004s timeout 300s
26/ 0/ 1/  -2352   0%cdda2wav: Input/output error. Read12: scsi sendcmd: retryable error
CDB:  D8 00 00 00 00 3A 00 00 00 1A 00 00
status: 0x0 (GOOD STATUS)
resid: 61152
cmd finished after 0.004s timeout 300s

etc.

which produced .wav files with a header and nulls ie., no sound on play back,
just nothing for the right length of time eg:

% hexdump -C audio_11.wav
00000000  52 49 46 46 64 bf 2c 01  57 41 56 45 66 6d 74 20  |RIFFd.,.WAVEfmt |
00000010  10 00 00 00 01 00 02 00  44 ac 00 00 10 b1 02 00  |........D.......|
00000020  04 00 10 00 64 61 74 61  40 bf 2c 01 00 00 00 00  |....data@.,.....|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
012cbf60  00 00 00 00 00 00 00 00  00 00 00 00              |............|
012cbf6c

(cdda2wav from cdrecord 1.9)

A probably irrelevant note:
cd0 at atapibus0 drive 0: <CREATIVE CD3231E, , UC101> type 5 cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2
pciide0: secondary channel interrupting at irq 15
cd0(pciide0:1:0): using PIO mode 3, DMA mode 1 (using DMA data transfers)

I needed to limit to PIO 3 as mode 4 lead to data errors. The BIOS also detects
the CD drive as being 3 not 4.

Any thoughts/hints?

Cheers,

Patrick