From nobody@FreeBSD.org  Thu Feb  7 19:50:02 2002
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 16E6337B420
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  7 Feb 2002 19:49:55 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id g183ntK73242;
	Thu, 7 Feb 2002 19:49:55 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200202080349.g183ntK73242@freefall.freebsd.org>
Date: Thu, 7 Feb 2002 19:49:55 -0800 (PST)
From: Edmond Shum <shumzai@yahoo.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: burncd cannot write audio file as the 1st track in a session
X-Send-Pr-Version: www-1.0

>Number:         34725
>Category:       bin
>Synopsis:       burncd cannot write audio file as the 1st track in a session
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 07 19:50:04 PST 2002
>Closed-Date:    Sun May 04 03:00:17 PDT 2003
>Last-Modified:  Sun May 04 03:00:17 PDT 2003
>Originator:     Edmond Shum
>Release:        4.5
>Organization:
>Environment:
FreeBSD antares 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Mon Jan 28 14:31:56 GMT 2002     murray@builder.freebsdmall.com:/usr/src/sys/compile/GENERIC  i386

>Description:
burncd cannot write audio track when it is the 1st in the session. It 
must follow a data file. :

burncd -m -f /dev/acd0c audio test.wav test2.wav ...... [fixate]
will fail with the console messages:
acd0: WRITE_BIG - ILLEGAL REQUEST asc=64 ascq=00 error=00

However, if it is preceded by a data file, it works fine:
burncd [-m] -f /dev/acd0c data /tmp/zero audio test.wav test2.wav ...... [fixate]
( success ) 

The cdrw I am using: acd0: CD-RW <Hewlett-Packard CD-Writer Plus 9100b> at ata1-master using PIO4


>How-To-Repeat:
Command with:
burncd [-m] -f /dev/acd0c audio [audio file]
will definitely fail
>Fix:
      
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Fri Feb 8 02:14:04 PST 2002 
Responsible-Changed-Why:  
Over to the burncd author. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=34725 
State-Changed-From-To: open->feedback 
State-Changed-By: sos 
State-Changed-When: Wed May 1 05:19:09 PDT 2002 
State-Changed-Why:  
Could you plase try this patch, its valid for both -current 
and -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=34725 

From: Edmond Shum <shumzai@yahoo.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/34725:burncd cannot write audio file as the 1st track in a session
Date: Thu, 2 May 2002 21:54:23 -0500

 Sorry to tell you that it doesn't work. Not only can it not write the audio as 
 the first track, it cannot write after a data track:
 
 >vega# /home/leo/burncd.sos/burncd -v -m -t -f /dev/acd0c data /tmp/null audio IsLove.wav 
 >adding type 0x08 file /tmp/null size 600 KB 300 blocks
 >adding type 0x00 file IsLove.wav size 39104 KB 17026 blocks (0 padded)  
 >next writeable LBA 0 
 >addr = 0 size = 614400 blocks = 300 
 >writing from file /tmp/null size 600 KB 
 >written this track 600 KB (100%) total 600 KB
 >next writeable LBA 302
 >addr = 302 size = 40042880 blocks = 17026   
 >writing from file IsLove.wav size 39104 KB 
 > 
 >only wrote -1 of 37632 bytes err=5                                   
 
 
 Before patching:
 >vega# burncd -v -m -t -f /dev/acd0c data /tmp/null audio IsLove.wav
 >adding type 0x08 file /tmp/null size 600 KB 300 blocks
 >?adding type 0x00 file IsLove.wav size 39104 KB 17026 blocks (0 padded) 
 >next writeable LBA 0
 >addr = 0 size = 614400 blocks = 300       
 >writing from file /tmp/null size 600 KB
 >written this track 600 KB (100%) total 600 KB
 >next writeable LBA 302
 >addr = 302 size = 40042880 blocks = 17026
 >writing from file IsLove.wav size 39104 KB
 >written this track 39106 KB (100%) total 39706 KB 
 
 Edmond Shum
State-Changed-From-To: feedback->closed 
State-Changed-By: sos 
State-Changed-When: Sun May 4 02:59:13 PDT 2003 
State-Changed-Why:  
Belived to e fixed in -current (5.1). 

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