From nobody@FreeBSD.org  Tue Jun  5 13:13:05 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 0FBAC37B40A
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  5 Jun 2001 13:13:05 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.3/8.11.3) id f55KD4e32570;
	Tue, 5 Jun 2001 13:13:04 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200106052013.f55KD4e32570@freefall.freebsd.org>
Date: Tue, 5 Jun 2001 13:13:04 -0700 (PDT)
From: sirmoo@cowbert.2y.net
To: freebsd-gnats-submit@FreeBSD.org
Subject: can't burn audio cds on LG CD-RW CED-8083B
X-Send-Pr-Version: www-1.0

>Number:         27893
>Category:       kern
>Synopsis:       [burncd]: can't burn audio cds on LG CD-RW CED-8083B
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    remko
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 05 13:20:00 PDT 2001
>Closed-Date:    Sat Jan 27 19:02:39 GMT 2007
>Last-Modified:  Sat Jan 27 19:02:39 GMT 2007
>Originator:     Peter Lai
>Release:        4.3-STABLE
>Organization:
CowbertNet, Cesium Hyperfine Enterprises
>Environment:
FreeBSD cowbert.2y.net 4.3-STABLE FreeBSD 4.3-STABLE #0: Tue May 17 11:04:13 EDT 2001     root@cowbert.2y.net:/usr/src/sys/compile/COWBERT43  i386
>Description:
when using burncd to write in audio mode, nothing gets written, and the resulting burncd message is:

next writeable LBA 0
writing from file foo.raw size 39735 KB

only wrote -1 of 37632 bytes

and exits.

kernel messages:
Jun  5 15:21:25 cowbert /kernel: acd0: READ_TOC - ILLEGAL REQUEST asc=64 ascq=00 error=04
Jun  5 15:21:25 cowbert /kernel: acd: mode sense  00-3a-00-00-00-00-00-00-05-32-01-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
Jun  5 15:21:25 cowbert /kernel: acd: modeselect pagesize=60
Jun  5 15:21:25 cowbert /kernel: acd: mode select  00-3a-00-00-00-00-00-00-05-32-11-c0-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
Jun  5 15:21:25 cowbert /kernel: acd0: WRITE_BIG - ILLEGAL REQUEST asc=64 ascq=00 error=04

data mode burns fine even at 4X speed.

in case it's useful, here's dmesg.boot
acd: mode sense  00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
acd: mode sense  00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
acd: mode sense  00-1c-70-00-00-00-00-00-2a-14-07-07-71-67-29-03-16-0d-00-ff-08-00-10-8a-00-00-02-c2-02-c2
acd0: CD-RW <LG CD-RW CED-8083B> at ata1-master using PIO4

>How-To-Repeat:
burncd -f /dev/acd0c -s 1 audio foo.raw
>Fix:
none.
>Release-Note:
>Audit-Trail:

From: Erik Rothwell <erothwell@callgtn.com>
To: <freebsd-gnats-submit@FreeBSD.org>, <sirmoo@cowbert.2y.net>
Cc:  
Subject: Re: misc/27893: can't burn audio cds on LG CD-RW CED-8083B
Date: Sun, 4 Nov 2001 14:45:41 -0500 (EST)

 I was having a very similar problem with the LG CD-RW CED-8080B. I've
 discovered that the problem only appears to arise if the next writeable
 LBA on the disc is 0. If next writeable LBA is greater than 0, audio/raw
 mode tracks burn fine.
 
 For instance:
 
 [3:51am] # truss -o audio.1.out burncd -f /dev/acd0c -t audio audio.raw
 
 next writeable LBA 0
 writing from file audio.raw size 689 KB
 
 only wrote -1 of 37632 bytes
 
 However, burn a small data track first...
 
 [3:55am] # truss -o data.out burncd -f /dev/acd0c -t data test.iso
 
 next writeable LBA 0
 writing from file test.iso size 128 KB
 written this track 128 KB (100%) total 128 KB
 
 [3:56am] # truss -o audio.2.out burncd -f /dev/acd0c -t audio audio.raw
 
 next writeable LBA 66
 writing from file audio.raw size 689 KB
 written this track 689 KB (100%) total 689 KB
 
 Voil=E0, audio. Hope this helps track down the error...
 
 Erik.
 

From: David Syphers <dsyphers@uchicago.edu>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: misc/27893: can't burn audio cds on LG CD-RW CED-8083B
Date: Wed, 30 Jan 2002 16:40:03 -0600

 The exact same errors arise using a LG CD-RW CED-8120B (on 4.5-RC) when 
 trying to write audio tracks.
 
 -David Syphers
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Thu Jan 31 01:48:09 PST 2002 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27893 
State-Changed-From-To: open->feedback 
State-Changed-By: sheldonh 
State-Changed-When: Thu Jan 31 01:58:13 PST 2002 
State-Changed-Why:  
This PR can make no progress until someone debugs the problem 
or sends Soren a drive to test himself. 

Consider this a call for hardware or debugging. :-) 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27893 

From: Sren Schmidt <sos@freebsd.dk>
To: sheldonh@FreeBSD.org
Cc: freebsd-bugs@FreeBSD.org, sos@FreeBSD.org
Subject: Re: misc/27893: can't burn audio cds on LG CD-RW CED-8083B
Date: Thu, 31 Jan 2002 10:53:13 +0100 (CET)

 It seems sheldonh@FreeBSD.org wrote:
 > Synopsis: can't burn audio cds on LG CD-RW CED-8083B
 > 
 > Responsible-Changed-From-To: freebsd-bugs->sos
 > Responsible-Changed-By: sheldonh
 > Responsible-Changed-When: Thu Jan 31 01:48:09 PST 2002
 > Responsible-Changed-Why: 
 > Over to maintainer.
 
 Known problem on the LG devices, somebody needs to sit down and
 debug this problem, or send me a drive to experiment with...
 
 -Sren
State-Changed-From-To: feedback->analyzed 
State-Changed-By: sos 
State-Changed-When: Wed May 1 05:17:38 PDT 2002 
State-Changed-Why:  
Could I have you try the following patch, it should fit in both 
-current and a relatively new -stable.. 

cvs diff: Diffing . 
Index: burncd.c 
=================================================================== 
RCS file: /home/ncvs/src/usr.sbin/burncd/burncd.c,v 
retrieving revision 1.25 
diff -u -r1.25 burncd.c 
--- burncd.c    22 Apr 2002 13:44:42 -0000      1.25 
+++ burncd.c    29 Apr 2002 20:12:17 -0000 
@@ -367,13 +367,14 @@ 
format = CDR_SESS_CDROM_XA; 

if (i == 0) { 
-                       addr += tracks[i].pregap; 
tracks[i].addr = addr; 
- 
+                       cue_ent(&cue[j++], bt2ctl[tracks[i].block_type],  
+                               0x01, i+1, 0x0, bt2df[tracks[i].block_type], 
+                               0x00, addr); 
+                       addr += tracks[i].pregap; 
cue_ent(&cue[j++], bt2ctl[tracks[i].block_type],  
0x01, i+1, 0x1, bt2df[tracks[i].block_type], 
0x00, addr); 
- 
} 
else { 
if (tracks[i].pregap) { 
@@ -471,9 +472,6 @@ 

if (ioctl(fd, CDRIOCSETBLOCKSIZE, &track_info->block_size) < 0) 
err(EX_IOERR, "ioctl(CDRIOCSETBLOCKSIZE)"); 
- 
-       if (track_info->addr >= 0) 
-               lseek(fd, track_info->addr * track_info->block_size, SEEK_SET); 

if (verbose) 
fprintf(stderr, "addr = %d size = %d blocks = %dn", 


http://www.freebsd.org/cgi/query-pr.cgi?pr=27893 

From: "Graham Batty" <graham@ript.net>
To: <freebsd-gnats-submit@FreeBSD.org>, <sirmoo@cowbert.2y.net>
Cc:  
Subject: Re: misc/27893: can't burn audio cds on LG CD-RW CED-8083B
Date: Wed, 12 Jun 2002 01:08:06 -0600

 With this patch I get the following on my LG drive on latest -stable: (dmesg
 for drive is "acd0: CD-RW <LG CD-RW CED-8083B> at ata1-master PIO4")
 
 mercury# burncd -f /dev/acd0a -t -v audio ??
 adding type 0x00 file 01 size 14092 KB 6136 blocks (0 padded)
 next writeable LBA 0
 addr = 0 size = 14430208 blocks = 6136
 writing from file 01 size 14092 KB
 
 only wrote -1 of 37632 bytes err=5
 
 Which is identical to the output of the unpatched -stable copy of burncd.
 
 Also, I get this (and have been getting since 4.4 or so, when I first tried)
 on the console:
 acd0: WRITE_BIG - ILLEGAL REQUEST asc=0x64 ascq=0x00 error=0x00
 
 So, this patch does not appear to solve the problem.
 Graham.
 

From: "Graham Batty" <graham@ript.net>
To: <freebsd-gnats-submit@FreeBSD.org>, <sirmoo@cowbert.2y.net>
Cc: <sos@freebsd.dk>
Subject: Re: misc/27893: can't burn audio cds on LG CD-RW CED-8083B
Date: Thu, 13 Jun 2002 00:13:51 -0600

 As noted in http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/34725 the patch
 proposed here (and there) also renders the 'fix' of data track at LBA 0
 unusable. The two issues do seem similar, however.
 Graham.
 

From: Martin Machacek <m@m3a.cz>
To: freebsd-gnats-submit@FreeBSD.org, sirmoo@cowbert.2y.net
Cc:  
Subject: Re: misc/27893: can't burn audio cds on LG CD-RW CED-8083B
Date: Sat, 24 Aug 2002 04:15:21 -0700

 Just a datapoint. The same problem happens with FreeBSD 4.6-STABLE as of Wed Aug
 21 and Teac ATA CD writer CD-W54E. The drive is being identified as:
 
 acd0: CD-RW <CD-W54E> at ata1-slave PIO4
 
 Audio tracks cannot be written as the first track on the disk, burncd returns
 error and console message is being logged (the same as already reported).
 However it seems to work if I put a zero sized data track first.
 
 martin@bubak:~/tmp> uname -a
 FreeBSD bubak.m3a.cz 4.6-STABLE FreeBSD 4.6-STABLE #2: Wed Aug 21 22:58:44 PDT 2002     martin@bubak.m3a.cz:/usr/src/sys/compile/BUBAK  i386
 martin@bubak:~/tmp> burncd -f /dev/acd0a -s 2 data dummy audio track[1-9].cdr fixate
 next writeable LBA 0
 writing from file dummy size 0 KB
 
 next writeable LBA 0
 writing from file track1.cdr size 32512 KB
 written this track 32512 KB (100%) total 32512 KB
 next writeable LBA 14307
 writing from file track2 size 39453 KB
 ...
 
 
 However, burncd got completely stuck after fixating the CD:
 
 written this track 39396 KB (100%) total 414962 KB
 fixating CD, please wait..
 
 75396 martin    -6   0   880K   468K acdfix   0:22  0.00%  0.00% burncd
 
 truss -p 75396 does not show any activity. The process cannot be killed.
 
 I can try patches and do some debugging if somebody gives me hints where to
 start and what to look for.
 
         Martin 
 
 --
 [PGP KeyID F3F409C4]

From: "Graham Batty" <graham@ript.net>
To: <freebsd-gnats-submit@FreeBSD.org>
Cc: <sirmoo@cowbert.2y.net>, <m@m3a.cz>
Subject: Re: misc/27893: can't burn audio cds on LG CD-RW CED-8083B
Date: Tue, 21 Jan 2003 23:21:22 -0700

 Since there have been some changes to the ata stuff in fbsd5 (especially the
 incorporation of the atapicam support), I figured I should do an update.
 Here are my results.
 
 Results with various packages in FreeBSD 5.0:
 - burncd still does the same thing, and does NOT work
 - burncd -d (Disk At Once mode) does NOT work either
 - with atapicam (all are installed from ports):
  - cdrtools/cdrecord does NOT work
  - cdrtools/cdrecord -dao DOES work
  - cdrdao DOES work, perfectly in fact.
 
 So it seems that the problem is, in particular, unique to non-DAO tracks. On
 the plus side, it is finally possible for those of us with this set of
 drives to actually burn audio cds.
 
 Detailed results (all tests produce the same results in dummy mode as in
 actual write mode, my comments in []):
 
 bash-2.05b$ sudo burncd -t -v -f /dev/acd0 audio *.wav fixate
 adding type 0x00 file pricen musical.wav size 80804 KB 35180 blocks (0
 padded)
 next writeable LBA 0
 addr = 0 size = 82743296 blocks = 35180
 writing from file pricen musical.wav size 80804 KB
 
 only wrote -1 of 37632 bytes err=5
 
 fixating CD, please wait..
 burncd: ioctl(CDRIOCFIXATE): Input/output error
 
 [on console]
 acd0: WRITE_BIG - ILLEGAL REQUEST asc=0x64 ascq=0x00 error=0x00
 acd0: CLOSE_TRACK/SESSION - ILLEGAL REQUEST asc=0x2c ascq=0x04 error=0x00
 
 bash-2.05b$ sudo burncd -t -d -v -f /dev/acd0 audio *.wav fixate
 adding type 0x00 file pricen musical.wav size 80804 KB 35180 blocks (0
 padded)
 next writeable LBA 0
 CUE sheet:
 01 00 00 01 00 00 02 00
 01 01 01 00 00 00 04 00
 01 aa 01 01 00 07 35 05
 addr = 150 size = 82743296 blocks = 35180
 writing from file pricen musical.wav size 80804 KB
 
 only wrote -1 of 37632 bytes err=16
 
 [note that only on failure with this one, it still seems to try and fixate
 the disc, and the drive and disc are left unusable for a relatively long
 period of time]
 
 bash-2.05b$ sudo cdrecord -v -dummy dev=1,0,0 *.wav
 Cdrecord 1.11a39 (i386-unknown-freebsd5.0) Copyright (C) 1995-2002 Jrg
 Schilling
 TOC Type: 0 = CD-DA
 scsidev: '1,0,0'
 scsibus: 1 target: 0 lun: 0
 Using libscg version 'schily-0.7'
 atapi: 0
 Device type    : Removable CD-ROM
 Version        : 0
 Response Format: 1
 Vendor_info    : 'LG      '
 Identifikation : 'CD-RW CED-8083B '
 Revision       : '1.05'
 Device seems to be: Generic mmc CD-RW.
 Using generic SCSI-3/mmc CD-R driver (mmc_cdr).
 Driver flags   : MMC SWABAUDIO
 Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R
 Drive buf size : 1024000 = 1000 KB
 FIFO size      : 4194304 = 4096 KB
 cdrecord: Bad audio track size 82735632 for track 01.
 cdrecord: Audio tracks must be at least 705600 bytes and a multiple of 2352.
 cdrecord: See -pad option.
 bash-2.05b$ sudo cdrecord -v -dummy -pad dev=1,0,0 *.wav
 Cdrecord 1.11a39 (i386-unknown-freebsd5.0) Copyright (C) 1995-2002 Jrg
 Schilling
 TOC Type: 0 = CD-DA
 scsidev: '1,0,0'
 scsibus: 1 target: 0 lun: 0
 Using libscg version 'schily-0.7'
 atapi: 0
 Device type    : Removable CD-ROM
 Version        : 0
 Response Format: 1
 Vendor_info    : 'LG      '
 Identifikation : 'CD-RW CED-8083B '
 Revision       : '1.05'
 Device seems to be: Generic mmc CD-RW.
 Using generic SCSI-3/mmc CD-R driver (mmc_cdr).
 Driver flags   : MMC SWABAUDIO
 Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R
 Drive buf size : 1024000 = 1000 KB
 FIFO size      : 4194304 = 4096 KB
 Track 01: audio   78 MB (07:49.02) no preemp pad
 Total size:       78 MB (07:49.02) = 35177 sectors
 Lout start:       79 MB (07:51/02) = 35177 sectors
 Current Secsize: 2048
 ATIP info from disk:
   Indicated writing power: 4
   Is not unrestricted
   Is not erasable
   Disk sub type: Medium Type A, low Beta category (A-) (2)
   ATIP start of lead in:  -12508 (97:15/17)
   ATIP start of lead out: 359849 (79:59/74)
 Disk type:    Short strategy type (Phthalocyanine or similar)
 Manuf. index: 22
 Manufacturer: Ritek Co.
 Blocks total: 359849 Blocks current: 359849 Blocks remaining: 324672
 Starting to write CD/DVD at speed 4 in dummy TAO mode for single session.
 Last chance to quit, starting dummy write    0 seconds. Operation starts.
 Waiting for reader process to fill input buffer ... input buffer ready.
 Starting new track at sector: 0
 Track 01:    0 of   78 MB written.cdrecord: Input/output error. write_g1:
 scsi sendcmd: retryable error
 CDB:  2A 00 00 00 00 00 00 00 1B 00
 status: 0x2 (CHECK CONDITION)
 Sense Bytes: 70 00 05 00 00 00 00 0A 00 00 00 00 64 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00
 Sense Key: 0x5 Illegal Request, Segment 0
 Sense Code: 0x64 Qual 0x00 (illegal mode for this track) Fru 0x0
 Sense flags: Blk 0 (not valid)
 cmd finished after 0.001s timeout 40s
 
 write track data: error after 0 bytes
 Sense Bytes: 70 00 00 00 00 00 00 0A 00 00 00 00 00 00 00 00 00 00
 Writing  time:    5.020s
 Average write speed  93.6x.
 Fixating...
 WARNING: Some drives don't like fixation in dummy mode.
 Fixating time:    0.002s
 cdrecord: fifo had 64 puts and 1 gets.
 cdrecord: fifo was 0 times empty and 0 times full, min fill was 100%.
 
 [verbose bugger]
 
 bash-2.05b$ sudo cdrecord -v -dummy -dao -pad dev=1,0,0 *.wav
 Cdrecord 1.11a39 (i386-unknown-freebsd5.0) Copyright (C) 1995-2002 Jrg
 Schilling
 TOC Type: 0 = CD-DA
 scsidev: '1,0,0'
 scsibus: 1 target: 0 lun: 0
 Using libscg version 'schily-0.7'
 atapi: 0
 Device type    : Removable CD-ROM
 Version        : 0
 Response Format: 1
 Vendor_info    : 'LG      '
 Identifikation : 'CD-RW CED-8083B '
 Revision       : '1.05'
 Device seems to be: Generic mmc CD-RW.
 Using generic SCSI-3/mmc CD-R driver (mmc_cdr).
 Driver flags   : MMC SWABAUDIO
 Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R
 Drive buf size : 1024000 = 1000 KB
 FIFO size      : 4194304 = 4096 KB
 Track 01: audio   78 MB (07:49.02) no preemp pad
 Total size:       78 MB (07:49.02) = 35177 sectors
 Lout start:       79 MB (07:51/02) = 35177 sectors
 Current Secsize: 2048
 ATIP info from disk:
   Indicated writing power: 4
   Is not unrestricted
   Is not erasable
   Disk sub type: Medium Type A, low Beta category (A-) (2)
   ATIP start of lead in:  -12508 (97:15/17)
   ATIP start of lead out: 359849 (79:59/74)
 Disk type:    Short strategy type (Phthalocyanine or similar)
 Manuf. index: 22
 Manufacturer: Ritek Co.
 Blocks total: 359849 Blocks current: 359849 Blocks remaining: 324672
 Starting to write CD/DVD at speed 4 in dummy SAO mode for single session.
 Last chance to quit, starting dummy write    0 seconds. Operation starts.
 Waiting for reader process to fill input buffer ... input buffer ready.
 Sending CUE sheet...
 cdrecord: WARNING: Drive returns wrong startsec (0) using -150
 Writing pregap for track 1 at -150
 Starting new track at sector: 0
 Track 01:   78 of   78 MB written (fifo 100%) [buf  94%]   4.1x.
 WARNING: padding up to secsize.
 Track 01: Total bytes read/written: 82735632/82736304 (35177 sectors).
 Writing  time:  158.624s
 Average write speed   3.0x.
 Min drive buffer fill was 94%
 Fixating...
 WARNING: Some drives don't like fixation in dummy mode.
 Fixating time:   26.128s
 cdrecord: fifo had 1303 puts and 1303 gets.
 cdrecord: fifo was 0 times empty and 1238 times full, min fill was 98%.
 
 [I found the part about WARNING: Drive returns wrong startsec (0) using -150
 particularily interesting. Maybe that will help sos debug it?]
 
 bash-2.05b$ sudo cdrdao write --device 1,0,0 ~/test.toc
 Cdrdao version 1.1.7 - (C) Andreas Mueller <andreas@daneb.de>
   SCSI interface library - (C) Joerg Schilling
   Paranoia DAE library - (C) Monty
 
 Check http://cdrdao.sourceforge.net/drives.html#dt for current driver
 tables.
 
 Using libscg version 'andreas-0.5-UNIXWARE_Patch'
 
 1,0,0: LG CD-RW CED-8083B       Rev: 1.05
 Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0010)
 
 Disk seems to be written - hit return to reload disk.
 
 Reloading disk...
 WARNING: Unit not ready, still trying...
 WARNING: Unit not ready, still trying...
 Starting write at speed 4...
 Pausing 10 seconds - hit CTRL-C to abort.
 Process can be aborted with QUIT signal (usually CTRL-\).
 Executing power calibration...
 Power calibration successful.
 Writing track 01 (mode AUDIO/AUDIO )...
 Wrote 78 of 78 MB (Buffer 100%).
 Wrote 35177 blocks. Buffer fill min 100%/max 100%.
 Flushing cache...
 Writing finished successfully.
 
State-Changed-From-To: analyzed->feedback 
State-Changed-By: remko 
State-Changed-When: Sat Dec 30 21:42:47 UTC 2006 
State-Changed-Why:  
Hello, can you tell me whether this problem is still current 
on freebsd 6.x? 


Responsible-Changed-From-To: sos->remko 
Responsible-Changed-By: remko 
Responsible-Changed-When: Sat Dec 30 21:42:47 UTC 2006 
Responsible-Changed-Why:  
grab the pr 

http://www.freebsd.org/cgi/query-pr.cgi?pr=27893 
State-Changed-From-To: feedback->closed 
State-Changed-By: remko 
State-Changed-When: Sat Jan 27 19:02:37 UTC 2007 
State-Changed-Why:  
feedback timeout 

http://www.freebsd.org/cgi/query-pr.cgi?pr=27893 
>Unformatted:
