Finally tagged it right

This commit is contained in:
Mario Danic 2006-11-05 10:21:20 +00:00
parent deaa707ab6
commit a24588393a
23 changed files with 193 additions and 898 deletions

View File

@ -3,8 +3,5 @@
aclocal
libtoolize --copy --force
autoconf
# ts A61101 : libburn is not prepared for config.h
# autoheader
autoheader
automake --foreign --add-missing --copy --include-deps

View File

@ -26,12 +26,12 @@ following possible.
cdrskin. By Thomas Schmitt <scdbackup@gmx.net>
Integrated sub project of libburn.pykix.org but also published via:
http://scdbackup.sourceforge.net/cdrskin_eng.html
http://scdbackup.sourceforge.net/cdrskin-0.2.5.tar.gz
http://scdbackup.sourceforge.net/cdrskin-0.2.4.tar.gz
Copyright (C) 2006 Thomas Schmitt
------------------------------------------------------------------------------
On top of libburn there is implemented cdrskin 0.2.5, a limited cdrecord
On top of libburn there is implemented cdrskin 0.2.4, a limited cdrecord
compatibility wrapper which allows to use some libburn features from
the command line.
Interested users of cdrecord are invited to participate in the development
@ -59,16 +59,16 @@ systems, including 64 bit systems. (Further reports are welcome.)
Compilation, First Glimpse, Installation
Obtain cdrskin-0.2.5.tar.gz , take it to a directory of your choice and do:
Obtain cdrskin-0.2.4.tar.gz , take it to a directory of your choice and do:
tar xzf cdrskin-0.2.5.tar.gz
cd cdrskin-0.2.5
tar xzf cdrskin-0.2.4.tar.gz
cd cdrskin-0.2.4
Or obtain a libburn.pykix.org SVN snapshot,
go into the toplevel directory of the snapshot (e.g. cd libburn_pykix ),
and execute the autotools script ./bootstrap . Use autools version >= 1.7 .
Within that toplevel directory of either cdrskin-0.2.5 or libburn then execute:
Within that toplevel directory of either cdrskin-0.2.4 or libburn then execute:
./configure
make
@ -86,7 +86,7 @@ In order to surely get a standalone binary, execute
cdrskin/compile_cdrskin.sh
Version identification and help texts available afterwards:
Version identification an help texts available afterwards:
cdrskin/cdrskin -version
cdrskin/cdrskin --help
cdrskin/cdrskin -help
@ -181,7 +181,7 @@ See below "Audio CD" for specifications.
madplay -o raw:track04.cd /path/to/track4.mp3
mppdec --raw-le /path/to/track5.mpc track05.cd
cdrskin -v dev=0,1,0 blank=fast -eject speed=48 -sao \
cdrskin dev=0,1,0 blank=fast -eject speed=48 -sao \
-audio -swab track0[1-5].cd /path/to/track6.wav
@ -207,15 +207,10 @@ Run a backup :
Restrictions
The convenient burn mode TAO is becoming available with libburn right now.
First experiments have shown good results with a single track. Nevertheless
the possible pitfalls still have to be explored.
Therefore TAO is still defaulted to mode SAO which needs to know the track
The convenient burn mode TAO is not available with libburn yet.
Therefore it has to be defaulted to mode SAO which needs to know the track
size in advance. non-cdrecord option tao_to_sao_tsize=650m causes each CD
to get burned up to 650 MB regardless of the payload size.
Compile with
cdrskin/compile_cdrskin.sh -experimental
to enable explicit option -tao. (Note that -sao for now is default even then.)
No multi session yet ... Please report your wishes.

View File

@ -1,203 +0,0 @@
#!/bin/sh
set -x
# This script documents how this cdrskin version was derived from
# a vanilla libburn version. It is not intended nor needed for any
# use of cdrskin but included here only to show the technical
# relationship between both projects - which are close friends
# and issue roughly the same software.
#
# Package maintainers are advised to cover rather libburn than
# cdrskin unless they put only emphasis on the cdrecord emulation
# provided by cdrskin. libburn contains cdrskin - cdrskin is an
# oscillating, friendly and coordinated fork of libburn.
#
# Script results are a source tarball and two binaries
# one dynamic and one static in respect to system libs.
# Both binaries are static in respect to libburn.
#
# The script is to be run in the directory above the toplevel
# directory of libburn resp. cdrskin development.
#
# libburn version used: http://libburn.pykix.org
# Downloaded by:
# $ svn co http://libburn-svn.pykix.org/trunk libburn_pykix
# packed up in a tarball just to save it from inadverted changes by
# $ tar czf libburn_svn.tgz libburn_pykix
original="./libburn_svn.tgz"
# Historic moments:
# original="./libburn_svn_A60815.tgz"
# original="./libburn_cdrskin_A60819.tgz"
# The top level directory in that snapshot is named
intermediate="./libburn_pykix"
# My changes are in libburn-0.2.3.ts.develop , mainly in ./cdrskin
changes="./libburn-0.2.3.ts.develop"
skin_rev="0.2.5"
# The result directory and the name of the result tarballs
target="./cdrskin-${skin_rev}"
cdrskin_tarball="./cdrskin-${skin_rev}.tar.gz"
cdrskin_tarball_svn="./cdrskin-${skin_rev}.svn.tar.gz"
# (This once earned me an embarrassingly blooping source tarball)
# compile_dir="$changes"
compile_dir="$target"
compile_cmd="./cdrskin/compile_cdrskin.sh"
compile_static_opts="-static"
compile_result="cdrskin/cdrskin"
bintarget_dynamic="cdrskin_${skin_rev}-x86-suse9_0"
bintarget_static="$bintarget_dynamic"-static
if test -d "$changes"
then
dummy=dummy
else
echo "$0 : FATAL : no directory $changes" >&2
exit 1
fi
for i in "$target" "$intermediate"
do
if test -e "$i"
then
echo "$0 : FATAL : already existing $i" >&2
exit 2
fi
done
if test -f "$original"
then
dummy=dummy
else
echo "$0 : FATAL : no file $original" >&2
exit 3
fi
# Unpack SVN snapshot.
tar xzf "$original"
# Rename the directory to the cdrskin name
mv "$intermediate" "$target"
# Copy the changes from the development tree
#
cdrskin_dir="$changes"/cdrskin
libburn_dir="$changes"/libburn
cdrskin_target="$target"/cdrskin
libburn_target="$target"/libburn
# Create version timestamp
timestamp="$(date -u '+%Y.%m.%d.%H%M%S')"
echo "$timestamp"
echo '#define Cdrskin_timestamP "'"$timestamp"'"' >"$cdrskin_dir"/cdrskin_timestamp.h
# Add the cdrskin files
if test -e "$cdrskin_target"
then
rm -rf "$cdrskin_target"
fi
cp -a "$cdrskin_dir" "$cdrskin_target"
# Remove copied binaries
rm "$cdrskin_target"/*.o
rm "$cdrskin_target"/cdrfifo
rm "$cdrskin_target"/cdrskin
rm "$cdrskin_target"/cleanup
for i in std new make old
do
if test -e "$cdrskin_target"/cdrskin_"$i"
then
rm "$cdrskin_target"/cdrskin_"$i"
fi
done
for i in .deps .dirstamp .libs
do
if test -e "$cdrskin_target"/"$i"
then
rm -rf "$cdrskin_target"/"$i"
fi
done
# Remove unwanted SVN stuff (TODO: avoid downloading it)
for i in "$target"/.svn "$target"/*/.svn
do
if test "$i" = "$target"'/*/.svn'
then
dummy=dummy
else
if test -e "$i"
then
rm -rf "$i"
fi
fi
done
## No more : Add own libburn-README in toplevel
# cp -a "$changes"/README "$target"
## No more : Add modified Makefile.am
# cp -a "$changes"/Makefile.am "$target"
# Make SVN state tarball for the libburn team
tar czf "$cdrskin_tarball_svn" "$target"
# Get over dependecy on autotools. Rely only on cc, make et. al.
# This is not the same as "make dist" but i can do it without
# having to evaluate the quality of said "make dist"
#
( cd "$target" ; ./bootstrap )
# Remove unwanted stuff after bootstrap
for i in "$target"/autom4te.cache
do
if echo "$i" | grep '\*' >/dev/null
then
dummy=dummy
else
if test -e "$i"
then
rm -rf "$i"
fi
fi
done
# Pack it up to the new libburn+cdrskin-tarball
tar czf "$cdrskin_tarball" "$target"
# Produce a static and a dynamic binary
(
cd "$compile_dir" || exit 1
./configure
make
$compile_cmd -do_strip
cp "$compile_result" "../$bintarget_dynamic"
if test -n "$compile_static_opts"
then
$compile_cmd $compile_static_opts -do_strip
cp "$compile_result" "../$bintarget_static"
fi
)
# Remove the build area
# Disable this for debugging the merge process
rm -rf "$target"
# Show the result
./"$bintarget_dynamic" -version
./"$bintarget_static" -version
ls -l "$cdrskin_tarball"
ls -l "$bintarget_dynamic"
ls -l "$bintarget_static"

View File

@ -123,7 +123,7 @@ or
/** The official program version */
#ifndef Cdrskin_prog_versioN
#define Cdrskin_prog_versioN "0.2.5"
#define Cdrskin_prog_versioN "0.2.4"
#endif
/** The source code release timestamp */
@ -169,7 +169,6 @@ or
#define Cdrskin_libburn_has_convert_scsi_adR 1
#define Cdrskin_libburn_has_burn_msgS 1
#define Cdrskin_libburn_has_burn_aborT 1
#define Cdrskin_libburn_has_cleanup_handleR 1
#define Cdrskin_libburn_has_audioxtR 1
#define Cdrskin_libburn_has_get_start_end_lbA 1
#define Cdrskin_libburn_has_burn_disc_unsuitablE 1
@ -193,7 +192,7 @@ or
#ifdef Cdrskin_new_api_tesT
/* put macros under test caveat here */
#define Cdrskin_allow_libburn_taO 1
#define Cdrskin_libburn_has_cleanup_handleR 1
#endif
@ -206,6 +205,14 @@ or
#endif /* Cdrskin_libburn_from_pykix_svN */
#ifndef _LARGEFILE_SOURCE
#define _LARGEFILE_SOURCE 1
#endif
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
#endif
/* These macros activate cdrskin workarounds for deficiencies resp.
problematic features of libburn which hopefully will change in
future. */
@ -271,6 +278,7 @@ or
#include <errno.h>
#include <sys/time.h>
/* #include <libburn/libburn.h> */
#include "../libburn/libburn.h"
#ifdef Cdrskin_libburn_has_audioxtR
@ -890,33 +898,11 @@ int Cdrtrack_set_track_type(struct CdrtracK *o, int track_type, int flag)
}
/**
@param flag Bitfield for control purposes:
bit0= size returns number of actually processed source bytes
rather than the predicted fixed_size (if available).
padding returns the difference from number of written
bytes.
*/
int Cdrtrack_get_size(struct CdrtracK *track, double *size, double *padding,
double *sector_size, int flag)
{
*size= track->fixed_size;
*padding= track->padding;
#ifdef Cdrskin_allow_libburn_taO
if((flag&1) && track->libburn_track!=NULL) {
off_t readcounter= 0,writecounter= 0;
burn_track_get_counters(track->libburn_track,&readcounter,&writecounter);
*size= readcounter;
*padding= writecounter-readcounter;
/*
fprintf(stderr,"cdrskin_debug: sizeof(off_t)=%d\n",
sizeof(off_t));
*/
}
#endif
*sector_size= track->sector_size;
return(1);
}
@ -1008,7 +994,7 @@ ex:
*/
int Cdrtrack_open_source_path(struct CdrtracK *track, int *fd, int flag)
{
int is_wav= 0, size_from_file= 0;
int is_wav= 0;
off_t xtr_size= 0;
if(track->source_path[0]=='-' && track->source_path[1]==0)
@ -1040,21 +1026,10 @@ int Cdrtrack_open_source_path(struct CdrtracK *track, int *fd, int flag)
if(fstat(*fd,&stbuf)!=-1)
track->fixed_size= stbuf.st_size;
}
size_from_file= 1;
}
}
#ifdef Cdrskin_allow_libburn_taO
if(track->fixed_size < Cdrtrack_minimum_sizE * track->sector_size
&& (track->fixed_size>0 || size_from_file)) {
#else
if(track->fixed_size < Cdrtrack_minimum_sizE * track->sector_size) {
#endif
if(track->track_type == BURN_AUDIO) {
/* >>> cdrecord: We differ in automatic padding with audio:
Audio tracks must be at least 705600 bytes and a multiple of 2352.
@ -1068,7 +1043,7 @@ int Cdrtrack_open_source_path(struct CdrtracK *track, int *fd, int flag)
"cdrskin: NOTE : Enforcing minimum track size of %.f bytes\n",
Cdrtrack_minimum_sizE*track->sector_size);
track->fixed_size= Cdrtrack_minimum_sizE*track->sector_size;
}
}
}
track->source_fd= *fd;
return(*fd>=0);
@ -2315,8 +2290,7 @@ struct CdrskiN {
/** Progress state info: wether libburn is actually processing payload data */
int is_writing;
/** Previously detected drive state */
enum burn_drive_status previous_drive_status;
/** abort parameters */
int abort_max_wait;
@ -2399,7 +2373,6 @@ int Cdrskin_new(struct CdrskiN **skin, struct CdrpreskiN *preskin, int flag)
o->n_drives= 0;
o->driveno= 0;
o->is_writing= 0;
o->previous_drive_status = BURN_DRIVE_IDLE;
o->abort_max_wait= 74*60;
o->lib_is_initialized= (flag&1);
o->control_pid= getpid();
@ -2576,6 +2549,11 @@ int Cdrskin_reinit_lib_with_adr(struct CdrskiN *skin, int flag)
{
int ret;
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(fprintf(stderr,
"cdrskin_debug: Restarting libburn. flag= %d driveno= %d grabbed= %d \n",
flag,skin->driveno,skin->drive_is_grabbed));
if(skin->drive_is_grabbed)
Cdrskin_release_drive(skin,0);
if(flag&1)
@ -2586,19 +2564,42 @@ int Cdrskin_reinit_lib_with_adr(struct CdrskiN *skin, int flag)
"cdrskin: FATAL : unable to determine persistent drive address\n");
ret= 0; goto ex;
}
/* >>> A60827: this causes a SIGSEGV when releasing the re-initialized drive
skin->drives[skin->driveno].drive after burn (then as
skin->grabbed_drive, but already being 0xb0 in Cdrskin_grab) )
*/
burn_drive_info_free(skin->drives);
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(fprintf(stderr,"cdrskin_debug: Finishing libburn.\n"));
burn_finish();
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(fprintf(stderr,"cdrskin_debug: Initializing libburn.\n"));
if(!burn_initialize()) {
fflush(stdout);
fprintf(stderr,"cdrskin : FATAL : Re-initialization of libburn failed\n");
{ret= -1; goto ex;}
}
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(fprintf(stderr,"cdrskin_debug: Grabbing drive.\n"));
ret= Cdrskin_grab_drive(skin,1|(flag&2));/* uses burn_drive_scan_and_grab() */
if(ret<=0)
{ret=0; goto ex;}
ret= 1;
ex:
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(fprintf(stderr,"cdrskin_debug: Restarting of libburn done. ret= %d\n",
ret));
return(ret);
}
@ -2651,15 +2652,28 @@ int Cdrskin_grab_drive(struct CdrskiN *skin, int flag)
restore_handler= 1;
}
#else
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(fprintf(stderr,
"cdrskin_debug: Trusting in abortability of grabbing process\n"));
#endif /* ! Cdrskin_grab_abort_brokeN */
#ifndef Cdrskin_oldfashioned_api_usE
if(flag&1) {
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(fprintf(stderr,
"cdrskin_debug: Cdrskin_grab_drive() from shutdown libburn\n"));
ret= burn_drive_scan_and_grab(&(skin->drives),skin->preskin->device_adr,
!(flag&2));
if(ret<=0) {
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(fprintf(stderr,
"cdrskin_debug: burn_drive_scan_and_grab ret=%d\n",ret));
if(!(flag&4))
fprintf(stderr,"cdrskin: FATAL : unable to open drive '%s'\n",
skin->preskin->device_adr);
@ -2669,6 +2683,9 @@ int Cdrskin_grab_drive(struct CdrskiN *skin, int flag)
drive= skin->drives[skin->driveno].drive;
skin->grabbed_drive= drive;
} else {
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(fprintf(stderr,
"cdrskin_debug: Cdrskin_grab_drive() on active libburn\n"));
if(strlen(skin->preskin->device_adr)<=0) {
#define Cdrskin_drop_drives_by_forgeT 1
@ -2731,6 +2748,10 @@ int Cdrskin_grab_drive(struct CdrskiN *skin, int flag)
skin->driveno);
goto ex;
}
#else
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(fprintf(stderr,
"cdrskin_debug: Trusting in burn_disc_erasable() after first grab\n"));
#endif /* ! Cdrskin_is_erasable_on_load_is_brokeN */
}
@ -3544,9 +3565,8 @@ int Cdrskin_wait_before_action(struct CdrskiN *skin, int flag)
else
sprintf(speed_text,"%.f",skin->x_speed);
printf(
"Starting to write CD/DVD at speed %s in %s %s mode for single session.\n",
speed_text,(skin->dummy_mode?"dummy":"real"),
(flag&1?"BLANK":skin->write_mode_name));
"Starting to write CD/DVD at speed %s in real %s mode for single session.\n",
speed_text,(flag&1?"BLANK":skin->write_mode_name));
printf("Last chance to quit, starting real write in %3d seconds.",
skin->gracetime);
fflush(stdout);
@ -3559,7 +3579,7 @@ int Cdrskin_wait_before_action(struct CdrskiN *skin, int flag)
}
}
if(skin->verbosity>=Cdrskin_verbose_progresS)
{printf(" Operation starts.\n");fflush(stdout);}
printf(" Operation starts.\n");
return(1);
}
@ -3629,25 +3649,19 @@ int Cdrskin_blank(struct CdrskiN *skin, int flag)
start_time= Sfile_microtime(0);
while(burn_drive_get_status(drive, &p) != BURN_DRIVE_IDLE) {
if(loop_counter>0)
if(skin->verbosity>=Cdrskin_verbose_progresS) {
int percent= 50;
if(p.sectors>0) /* i want a display of 1 to 99 percent */
percent= 1.0+((double) p.sector+1.0)/((double) p.sectors)*98.0;
if(skin->verbosity>=Cdrskin_verbose_progresS)
fprintf(stderr,
"\rcdrskin: blanking ( done %2d%% , %lu seconds elapsed ) ",
percent,(unsigned long) (Sfile_microtime(0)-start_time));
}
sleep(1);
"\rcdrskin: blanking sector %d (%lu seconds elapsed) ",
p.sector,(unsigned long) (Sfile_microtime(0)-start_time));
sleep(2);
loop_counter++;
}
blanking_done:;
skin->drive_is_busy= 0;
if(skin->verbosity>=Cdrskin_verbose_progresS) {
fprintf(stderr,
"\rcdrskin: blanking done \n");
fprintf(stderr,"\n");
printf("Blanking time: %.3fs\n",Sfile_microtime(0)-start_time);
fflush(stdout);
fprintf(stderr,"cdrskin: blanking done\n");
}
Cdrskin_release_drive(skin,0);
return(1);
@ -3694,50 +3708,30 @@ int Cdrskin_burn_pacifier(struct CdrskiN *skin,
current_time= Sfile_microtime(0);
elapsed_total_time= current_time-start_time;
elapsed_time= current_time-*last_time;
time_to_tell= (elapsed_time>=1.0)&&(elapsed_total_time>=1.0);
time_to_tell= (elapsed_time>=1.0);
if(drive_status==BURN_DRIVE_WRITING) {
;
} else if(drive_status==BURN_DRIVE_WRITING_LEADIN
#ifdef Cdrskin_allow_libburn_taO
|| drive_status==BURN_DRIVE_WRITING_PREGAP
#endif
) {
} else if(drive_status==BURN_DRIVE_WRITING_LEADIN) {
if(time_to_tell || skin->is_writing) {
if(skin->verbosity>=Cdrskin_verbose_progresS) {
if(skin->is_writing)
fprintf(stderr,"\n");
fprintf(stderr,
"\rcdrskin: working pre-track (burning since %.f seconds) ",
"\rcdrskin: writing lead-in since %.f seconds ",
elapsed_total_time);
}
skin->is_writing= 0;
advance_interval= 1;
}
{ret= 2; goto ex;}
} else if(drive_status==BURN_DRIVE_WRITING_LEADOUT
#ifdef Cdrskin_allow_libburn_taO
|| drive_status==BURN_DRIVE_CLOSING_TRACK
|| drive_status==BURN_DRIVE_CLOSING_SESSION
#endif
) {
#ifdef Cdrskin_allow_libburn_taO
if(drive_status==BURN_DRIVE_CLOSING_SESSION &&
skin->previous_drive_status!=drive_status)
{printf("\nFixating...\n"); fflush(stdout);}
#endif
} else if(drive_status==BURN_DRIVE_WRITING_LEADOUT) {
if(time_to_tell || skin->is_writing) {
if(skin->verbosity>=Cdrskin_verbose_progresS) {
if(skin->is_writing)
fprintf(stderr,"\n");
fprintf(stderr,
"\rcdrskin: working post-track (burning since %.f seconds) ",
"\rcdrskin: writing lead-out after %.f seconds ",
elapsed_total_time);
}
skin->is_writing= 0;
@ -3763,12 +3757,12 @@ int Cdrskin_burn_pacifier(struct CdrskiN *skin,
if(old_track_idx>=0 && old_track_idx<skin->supposed_track_idx) {
Cdrtrack_get_size(skin->tracklist[old_track_idx],&fixed_size,&padding,
&sector_size,1);
&sector_size,0);
if(skin->verbosity>=Cdrskin_verbose_progresS)
printf("\n");
printf("%sTrack %-2.2d: Total bytes read/written: %.f/%.f (%.f sectors).\n",
debug_mark,old_track_idx+1,fixed_size,fixed_size+padding,
(fixed_size+padding)/sector_size);
debug_mark,old_track_idx+1,fixed_size,fixed_size,
fixed_size/sector_size);
}
sector_size= 2048.0;
@ -3783,7 +3777,7 @@ int Cdrskin_burn_pacifier(struct CdrskiN *skin,
if(written_total_bytes<1024*1024) {
thank_you_for_patience:;
if(time_to_tell || (skin->is_writing && elapsed_total_time>=1.0)) {
if(time_to_tell || skin->is_writing) {
if(skin->verbosity>=Cdrskin_verbose_progresS) {
if(skin->is_writing)
fprintf(stderr,"\n");
@ -3791,9 +3785,9 @@ thank_you_for_patience:;
"\rcdrskin: thank you for being patient since %.f seconds ",
elapsed_total_time);
}
skin->is_writing= 0;
advance_interval= 1;
}
skin->is_writing= 0;
{ret= 2; goto ex;}
}
new_mb= written_total_bytes/(1024*1024);
@ -3948,7 +3942,6 @@ ex:;
*total_count= *last_count;
*last_time= current_time;
}
skin->previous_drive_status= drive_status;
return(ret);
}
@ -3970,7 +3963,6 @@ int Cdrskin_burn(struct CdrskiN *skin, int flag)
double put_counter,get_counter,empty_counter,full_counter;
double start_time,last_time;
double total_count= 0.0,last_count= 0.0,size,padding,sector_size= 2048.0;
double sectors;
printf("cdrskin: beginning to burn disk\n");
@ -3993,8 +3985,7 @@ int Cdrskin_burn(struct CdrskiN *skin, int flag)
return(0);
}
Cdrtrack_get_size(skin->tracklist[i],&size,&padding,&sector_size,0);
if(size>0)
skin->fixed_size+= size+padding;
skin->fixed_size+= size+padding;
}
ret= Cdrskin_grab_drive(skin,0);
@ -4050,11 +4041,8 @@ int Cdrskin_burn(struct CdrskiN *skin, int flag)
frac= (seconds-min*60-sec)*100;
if(frac>99)
frac= 99;
sectors= (int) (skin->fixed_size/sector_size);
if(sectors*sector_size != skin->fixed_size)
sectors++;
printf("Total size: %5d MB (%-2.2d:%-2.2d.%-2.2d) = %d sectors\n",
mb,min,sec,frac,(int) sectors);
mb,min,sec,frac,(int) (skin->fixed_size/sector_size));
seconds+= 2;
min= seconds/60.0;
sec= seconds-min*60;
@ -4062,7 +4050,7 @@ int Cdrskin_burn(struct CdrskiN *skin, int flag)
if(frac>99)
frac= 99;
printf("Lout start: %5d MB (%-2.2d:%-2.2d/%-2.2d) = %d sectors\n",
mb,min,sec,frac,(int) sectors);
mb,min,sec,frac,(int) (skin->fixed_size/sector_size));
}
}
@ -4173,14 +4161,14 @@ int Cdrskin_burn(struct CdrskiN *skin, int flag)
skin->drive_is_busy= 0;
if(skin->verbosity>=Cdrskin_verbose_progresS)
printf("\n");
if(max_track<0) {
if(max_track<=0) {
printf("Track 01: Total bytes read/written: %.f/%.f (%.f sectors).\n",
total_count,total_count,total_count/sector_size);
} else {
Cdrtrack_get_size(skin->tracklist[max_track],&size,&padding,&sector_size,1);
Cdrtrack_get_size(skin->tracklist[max_track],&size,&padding,&sector_size,0);
printf(
"Track %-2.2d: Total bytes read/written: %.f/%.f (%.f sectors).\n",
max_track+1,size,size+padding,(size+padding)/sector_size);
max_track+1,size,size,size/sector_size);
}
if(skin->verbosity>=Cdrskin_verbose_progresS)
printf("Writing time: %.3fs\n",Sfile_microtime(0)-start_time);
@ -4294,7 +4282,11 @@ int Cdrskin_eject(struct CdrskiN *skin, int flag)
}
if(ret>0) {
ret= Cdrskin_release_drive(skin,1);
if(ret<=0)
if(ret>0) {
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(fprintf(stderr,
"cdrskin_debug: supposing drive eject to have worked\n"));
} else
goto sorry_failed_to_eject;
} else {
sorry_failed_to_eject:;
@ -4309,6 +4301,9 @@ sorry_failed_to_eject:;
return(1);
if(Cdrskin_grab_drive(skin,2)>0) {
Cdrskin_release_drive(skin,1);
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(fprintf(stderr,
"cdrskin_debug: supposing drive eject to have worked\n"));
} else {
fprintf(stderr,"cdrskin: SORRY : Failed to finally eject tray.\n");
return(0);
@ -4615,12 +4610,7 @@ set_driveropts:;
}
strcpy(skin->eject_device,argv[i]+13);
if(skin->verbosity>=Cdrskin_verbose_cmD)
#ifdef Cdrskin_burn_drive_eject_brokeN
printf("cdrskin: eject_device : %s\n",skin->eject_device);
#else
printf("cdrskin: ignoring obsolete eject_device=%s\n",
skin->eject_device);
#endif
#ifndef Cdrskin_extra_leaN
@ -4738,11 +4728,7 @@ set_padsize:;
printf("cdrskin: write type : RAW/RAW96R\n");
} else if(strcmp(argv[i],"-sao")==0 || strcmp(argv[i],"-dao")==0) {
#ifndef Cdrskin_allow_libburn_taO
set_sao:;
#endif
strcpy(skin->write_mode_name,"SAO");
skin->write_type= BURN_WRITE_SAO;
skin->block_type= BURN_BLOCK_SAO;
@ -4779,17 +4765,6 @@ set_speed:;
skin->swap_audio_bytes= 0;
} else if(strcmp(argv[i],"-tao")==0) {
#ifdef Cdrskin_allow_libburn_taO
strcpy(skin->write_mode_name,"TAO");
skin->write_type= BURN_WRITE_TAO;
skin->block_type= BURN_BLOCK_MODE1;
if(skin->verbosity>=Cdrskin_verbose_cmD)
printf("cdrskin: write type : TAO\n");
#else /* Cdrskin_allow_libburn_taO */
if(skin->tao_to_sao_tsize<=0.0) {
fprintf(stderr,"cdrskin: FATAL : libburn does not support -tao yet.\n");
fprintf(stderr,"cdrskin: HINT : Try option tao_to_sao_tsize=650m\n");
@ -4798,18 +4773,12 @@ set_speed:;
printf("cdrskin: NOTE : substituting mode -tao by mode -sao\n");
goto set_sao;
#endif /* ! Cdrskin_allow_libburn_taO */
} else if(strncmp(argv[i],"tao_to_sao_tsize=",17)==0) {
skin->tao_to_sao_tsize= Scanf_io_size(argv[i]+17,0);
if(skin->tao_to_sao_tsize>Cdrskin_tracksize_maX)
goto track_too_large;
if(skin->verbosity>=Cdrskin_verbose_cmD)
#ifdef Cdrskin_allow_libburn_taO
printf("cdrskin: size default for non-tao write modes: %.f\n",
#else
printf("cdrskin: replace -tao by -sao with fixed size : %.f\n",
#endif
skin->tao_to_sao_tsize);
} else if(strcmp(argv[i],"-toc")==0) {
@ -4853,19 +4822,16 @@ track_too_large:;
return(0);
}
skin->stdin_source_used= 1;
if(skin->fixed_size<=0.0) {
if(skin->write_type==BURN_WRITE_TAO) {
/* with TAO it is ok to have an undefined track length */;
} else if(skin->tao_to_sao_tsize>0.0) {
skin->fixed_size= skin->tao_to_sao_tsize;
printf(
if(skin->write_type!=BURN_WRITE_TAO &&
skin->fixed_size<=0.0 && skin->tao_to_sao_tsize>0.0) {
skin->fixed_size= skin->tao_to_sao_tsize;
printf(
"cdrskin: NOTE : augmenting non-tao write mode by tao_to_sao_tsize\n");
printf("cdrskin: NOTE : fixed size : %.f\n",skin->fixed_size);
} else {
fprintf(stderr,
printf("cdrskin: NOTE : fixed size : %.f\n",skin->fixed_size);
} else if(skin->fixed_size<=0) {
fprintf(stderr,
"cdrskin: FATAL : \"-\" (stdin) needs a fixed tsize= or tao_to_sao_tsize=\n");
return(0);
}
return(0);
}
} else if(skin->preskin->allow_fd_source==0 &&
argv[i][0]=='#' && (argv[i][1]>='0' && argv[i][1]<='9')) {

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2006.11.04.092909"
#define Cdrskin_timestamP "2006.10.28.132532"

View File

@ -1178,7 +1178,7 @@ Announced full -audio compatibility with cdrecord
------------------------------------ cycled - cdrskin-0.2.3 - 2006.10.25.160540
2006.10.27.114326 [319]
[]
- cdrskin/add_ts_changes_to_libburn_0_2_3
+ cdrskin/add_ts_changes_to_libburn_0_2_4
cdrskin/README
@ -1186,17 +1186,11 @@ cdrskin/cdrskin.c
cdrskin/cdrskin_eng.html
cdrskin/changelog.txt
README
Performed cdrskin version leap to cdrskin-0.2.4
Preparing cdrskin version leap to cdrskin-0.2.4
(To be committed to branch)
2006.10.28.093922 [320]
cdrskin/cdrskin_timestamp.h
Set final timestamp 2006.10.28.093922
------------------------------------ cycled - cdrskin-0.2.4 - 2006.10.28.093922
------------------------------------ cycle - cdrskin-0.2.5
[]
- cdrskin/add_ts_changes_to_libburn_0_2_3
@ -1211,11 +1205,8 @@ Prepare cdrskin version leap to cdrskin-0.2.5
(To be committed to trunk)
------------------------------------ cycled - cdrskin-0.2.5
2006 []
(k3b_on_cdrskin.html)
2006 []
-reset: ioctl(fd,CDROMRESET) ioctl(fd,SG_SCSI_RESET,SG_SCSI_RESET_DEVICE)

View File

@ -6,7 +6,6 @@
debug_opts=
def_opts=
largefile_opts="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1"
libvers="-DCdrskin_libburn_0_2_3"
cleanup_src_or_obj="libburn/cleanup.o"
libdax_msgs_o="libburn/libdax_msgs.o"
@ -51,9 +50,6 @@ do
elif test "$i" = "-oldfashioned"
then
def_opts="$def_opts -DCdrskin_oldfashioned_api_usE"
elif test "$i" = "-no_largefile"
then
largefile_opts=
elif test "$i" = "-do_not_compile_cdrskin"
then
compile_cdrskin=0
@ -80,7 +76,6 @@ do
echo " -cvs_A60220 set macro to match libburn-CVS of 20 Feb 2006."
echo " -libburn_0_2_2 set macro to match libburn-0.2.2."
echo " -libburn_0_2_3 set macro to match current libburn-SVN."
echo " -no_largefile do not use 64 bit off_t (must match libburn)."
echo " -do_not_compile_cdrskin omit compilation of cdrskin/cdrskin."
echo " -experimental use newly introduced libburn features."
echo " -oldfashioned use pre-0.2.2 libburn features only."
@ -104,14 +99,7 @@ echo "Build timestamp : $timestamp"
if test "$compile_cdrskin"
then
echo "compiling program cdrskin/cdrskin.c $static_opts $debug_opts $libvers $def_opts $cleanup_src_or_obj"
cc -I. \
$warn_opts \
$static_opts \
$debug_opts \
$libvers \
$largefile_opts \
$def_opts \
\
cc $warn_opts -I. $static_opts $debug_opts $libvers $def_opts \
-DCdrskin_build_timestamP='"'"$timestamp"'"' \
\
-o cdrskin/cdrskin \

View File

@ -7,11 +7,7 @@ AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([subdir-objects])
dnl A61101 This breaks Linux build (makes 32 bit off_t)
dnl http://sourceware.org/autobook/autobook/autobook_96.html says
dnl one must include some config.h and this was a pitfall.
dnl So why dig the pit at all ?
dnl AM_CONFIG_HEADER(config.h)
AM_CONFIG_HEADER(config.h)
dnl Making releases:
dnl BURN_MICRO_VERSION += 1;

View File

@ -7,7 +7,6 @@
expressing a file or stream size.
XXX we should enforce 64-bitness for off_t
ts A61101 : this is usually done by the build system (if it is not broken)
*/
#include <sys/types.h>
@ -217,16 +216,7 @@ enum burn_drive_status
/** The drive is erasing a disc */
BURN_DRIVE_ERASING,
/** The drive is being grabbed */
BURN_DRIVE_GRABBING,
/* ts A61102 */
/** The drive gets written zeroes before the track payload data */
BURN_DRIVE_WRITING_PREGAP,
/** The drive is told to close a track (TAO only) */
BURN_DRIVE_CLOSING_TRACK,
/** The drive is told to close a session (TAO only) */
BURN_DRIVE_CLOSING_SESSION
BURN_DRIVE_GRABBING
};
/** Information about a track on a disc - this is from the q sub channel of the
@ -927,19 +917,10 @@ struct burn_source *burn_file_source_new(const char *path,
*/
struct burn_source *burn_fd_source_new(int datafd, int subfd, off_t size);
/** Tells how long a track will be on disc
>>> NOTE: Not reliable with tracks of undefined length
*/
/** Tells how long a track will be on disc */
int burn_track_get_sectors(struct burn_track *);
/* ts A61101 */
/** Tells how many source bytes have been read and how many data bytes have
been written by the track during burn */
int burn_track_get_counters(struct burn_track *t,
off_t *read_bytes, off_t *written_bytes);
/** Sets drive read and write speed
@param d The drive to set speed for
@param read Read speed in k/s (0 is max)

View File

@ -303,7 +303,7 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
0x00020006 (FATAL,HIGH) = Too many scsi siblings
0x00020007 (NOTE,HIGH) = Closed O_EXCL scsi siblings
General library operations:
From the hunt on Assert:
0x00020101 (WARNING,HIGH) = Cannot find given worker item
0x00020102 (SORRY,HIGH) = A drive operation is still going on
@ -320,7 +320,7 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
0x0002010c (FATAL,HIGH) = Failed to transfer command to drive
0x0002010d (DEBUG,HIGH) = Could not inquire TOC
0x0002010e (FATAL,HIGH) = Attempt to read ATIP from ungrabbed drive
0x0002010f (DEBUG,HIGH) = SCSI error condition on command
0x0002010f
0x00020110 (FATAL,HIGH) = Persistent drive address too long
0x00020111 (FATAL,HIGH) = Could not allocate new auxiliary object
0x00020112 (SORRY,HIGH) = Bad combination of write_type and block_type
@ -329,9 +329,6 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
0x00020115 (SORRY,HIGH) = Attempt to set track mode to unusable value
0x00020116 (FATAL,HIGH) = Track mode has unusable value
0x00020117 (FATAL,HIGH) = toc_entry of drive is already in use
0x00020118 (DEBUG,HIGH) = Closing track
0x00020119 (DEBUG,HIGH) = Closing session
0x0002011a (NOTE,HIGH) = Padding up track to minimum size
libdax_audioxtr:
0x00020200 (SORRY,HIGH) = Cannot open audio source file

View File

@ -20,15 +20,6 @@
#include "structure.h"
#include "options.h"
#ifdef Libburn_log_in_and_out_streaM
/* <<< ts A61031 */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#endif /* Libburn_log_in_and_out_streaM */
/* ts A61005 */
#include "libdax_msgs.h"
extern struct libdax_msgs *libdax_messenger;
@ -167,13 +158,14 @@ void mmc_close(struct burn_drive *d, int session, int track)
mmc_function_spy("mmc_close");
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
"HOW THAT ? mmc_close() was called", 0, 0);
c.retry = 1;
c.oplen = sizeof(MMC_CLOSE);
memcpy(c.opcode, MMC_CLOSE, sizeof(MMC_CLOSE));
/* ts A61030 : shifted !!session rather than or-ing plain session */
c.opcode[2] = ((!!session)<<1) | !!track;
c.opcode[2] = session | !!track;
c.opcode[4] = track >> 8;
c.opcode[5] = track & 0xFF;
c.page = NULL;
@ -238,14 +230,6 @@ int mmc_write(struct burn_drive *d, int start, struct buffer *buf)
struct command c;
int len;
#ifdef Libburn_log_in_and_out_streaM
/* <<< ts A61031 */
static int tee_fd= -1;
if(tee_fd==-1)
tee_fd= open("/tmp/libburn_sg_written",
O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
#endif /* Libburn_log_in_and_out_streaM */
mmc_function_spy("mmc_write");
pthread_mutex_lock(&d->access_lock);
cancelled = d->cancel;
@ -277,12 +261,7 @@ int mmc_write(struct burn_drive *d, int start, struct buffer *buf)
burn_print(12, "%d, %d, %d, %d\n", c->opcode[6], c->opcode[7], c->opcode[8], c->opcode[9]);
*/
#ifdef Libburn_log_in_and_out_streaM
/* <<< ts A61031 */
if(tee_fd!=-1) {
write(tee_fd,c.page->data,len*2048);
}
#endif /* Libburn_log_in_and_out_streaM */
/* write(fileno(stderr), c.page->data, c.page->bytes);*/
d->issue_command(d, &c);
return 0;
@ -845,7 +824,6 @@ int mmc_setup_drive(struct burn_drive *d)
d->get_nwa = mmc_get_nwa;
d->close_disc = mmc_close_disc;
d->close_session = mmc_close_session;
d->close_track_session = mmc_close;
d->read_buffer_capacity = mmc_read_buffer_capacity;
/* ts A61020 */

View File

@ -19,15 +19,6 @@
#include "toc.h"
#include "write.h"
#ifdef Libburn_log_in_and_out_streaM
/* <<< ts A61031 */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#endif /* Libburn_log_in_and_out_streaM */
/*static unsigned char isrc[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";*/
#define sector_common(X) d->alba++; d->rlba X;
@ -53,8 +44,7 @@ static void uncook_subs(unsigned char *dest, unsigned char *source)
int sector_get_outmode(enum burn_write_types write_type,
enum burn_block_types block_type)
{
/* ts A61103 : extended SAO condition to TAO */
if (write_type == BURN_WRITE_SAO || write_type == BURN_WRITE_TAO)
if (write_type == BURN_WRITE_SAO)
return 0;
else
switch (block_type) {
@ -91,15 +81,6 @@ static void get_bytes(struct burn_track *track, int count, unsigned char *data)
{
int valid, shortage, curr, i, tr;
#ifdef Libburn_log_in_and_out_streaM
/* <<< ts A61031 */
static int tee_fd= -1;
if(tee_fd==-1)
tee_fd= open("/tmp/libburn_sg_readin",
O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
#endif /* Libburn_log_in_and_out_streaM */
/* no track pointer means we're just generating 0s */
if (!track) {
memset(data, 0, count);
@ -126,18 +107,10 @@ static void get_bytes(struct burn_track *track, int count, unsigned char *data)
valid = track->source->read(track->source, data + curr, count - curr);
} else valid = 0;
if (valid <= 0) { /* ts A61031 : extended from (valid == -1) */
if (valid == -1) {
track->eos = 1;
valid = 0;
}
track->sourcecount += valid;
#ifdef Libburn_log_in_and_out_streaM
/* <<< ts A61031 */
if(tee_fd!=-1 && valid>0) {
write(tee_fd, data + curr, valid);
}
#endif /* Libburn_log_in_and_out_streaM */
curr += valid;
shortage = count - curr;
@ -161,12 +134,6 @@ static void get_bytes(struct burn_track *track, int count, unsigned char *data)
if (!shortage)
goto ex;
/* ts A61031 */
if (shortage >= count)
track->track_data_done = 1;
if (track->open_ended)
goto ex;
/* If we're still short, and there's a "next" pointer, we pull from that.
if that depletes, we'll just fill with 0s.
*/
@ -185,6 +152,15 @@ ex:;
if(shortage)
memset(data + curr, 0, shortage); /* this is old icculus.org */
if (track->swap_source_bytes == 1) {
/*
{ static int swapping_count= 0;
fprintf(stderr,"\rlibburn_debug: swapping #%d \r",
swapping_count);
swapping_count++;
}
*/
for (i = 1; i < count; i += 2) {
tr = data[i];
data[i] = data[i-1];
@ -195,9 +171,7 @@ ex:;
/* ts A61009 : seems to hand out sector start pointer in opts->drive->buffer
and to count hand outs as well as reserved bytes */
/* ts A61101 : added parameter track for counting written bytes */
static unsigned char *get_sector(struct burn_write_opts *opts,
struct burn_track *track, int inmode)
static unsigned char *get_sector(struct burn_write_opts *opts, int inmode)
{
struct burn_drive *d = opts->drive;
struct buffer *out = d->buffer;
@ -222,13 +196,6 @@ static unsigned char *get_sector(struct burn_write_opts *opts,
err = d->write(d, d->nwa, out);
if (err == BE_CANCELLED)
return NULL;
/* ts A61101 */
if(track != NULL) {
track->writecount += out->bytes;
track->written_sectors += out->sectors;
}
d->nwa += out->sectors;
out->bytes = 0;
out->sectors = 0;
@ -241,32 +208,6 @@ static unsigned char *get_sector(struct burn_write_opts *opts,
return ret;
}
/* ts A61031 */
/* Revoke the counting of the most recent sector handed out by get_sector() */
static void unget_sector(struct burn_write_opts *opts, int inmode)
{
struct burn_drive *d = opts->drive;
struct buffer *out = d->buffer;
int outmode;
int seclen;
outmode = get_outmode(opts);
if (outmode == 0)
outmode = inmode;
/* ts A61009 : react on eventual failure of burn_sector_length()
(should not happen if API tested properly).
Ensures out->bytes >= out->sectors */
seclen = burn_sector_length(outmode);
if (seclen <= 0)
return;
seclen += burn_subcode_length(outmode);
out->bytes -= seclen;
out->sectors--;
}
/* either inmode == outmode, or outmode == raw. anything else is bad news */
/* ts A61010 : changed type to int in order to propagate said bad news */
/** @return 1 is ok, <= 0 is failure */
@ -394,7 +335,7 @@ int sector_toc(struct burn_write_opts *o, int mode)
unsigned char *data;
unsigned char subs[96];
data = get_sector(o, NULL, mode);
data = get_sector(o, mode);
if (data == NULL)
return 0;
/* ts A61010 */
@ -414,7 +355,7 @@ int sector_pregap(struct burn_write_opts *o,
unsigned char *data;
unsigned char subs[96];
data = get_sector(o, NULL, mode);
data = get_sector(o, mode);
if (data == NULL)
return 0;
/* ts A61010 */
@ -434,7 +375,7 @@ int sector_postgap(struct burn_write_opts *o,
unsigned char subs[96];
unsigned char *data;
data = get_sector(o, NULL, mode);
data = get_sector(o, mode);
if (data == NULL)
return 0;
/* ts A61010 */
@ -606,7 +547,7 @@ int sector_lout(struct burn_write_opts *o, unsigned char control, int mode)
unsigned char subs[96];
unsigned char *data;
data = get_sector(o, NULL, mode);
data = get_sector(o, mode);
if (!data)
return 0;
/* ts A61010 */
@ -625,19 +566,13 @@ int sector_data(struct burn_write_opts *o, struct burn_track *t, int psub)
unsigned char subs[96];
unsigned char *data;
data = get_sector(o, t, t->mode);
data = get_sector(o, t->mode);
if (!data)
return 0;
/* ts A61010 */
if (convert_data(o, t, t->mode, data) <= 0)
return 0;
/* ts A61031 */
if (t->open_ended && t->track_data_done) {
unget_sector(o, t->mode);
return 2;
}
if (!t->source->read_sub)
subcode_user(o, subs, t->entry->point,
t->entry->control, 1, &t->isrc, psub);
@ -687,11 +622,6 @@ int sector_headers_is_ok(struct burn_write_opts *o, int mode)
return 1;
if (o->write_type == BURN_WRITE_SAO)
return 1;
/* ts A61031 */
if (o->write_type == BURN_WRITE_TAO)
return 1;
if (mode & BURN_MODE1)
return 2;
return 0;
@ -720,11 +650,6 @@ void sector_headers(struct burn_write_opts *o, unsigned char *out,
return;
if (o->write_type == BURN_WRITE_SAO)
return;
/* ts A61031 */
if (o->write_type == BURN_WRITE_TAO)
return;
if (mode & BURN_MODE1)
modebyte = 1;

View File

@ -481,7 +481,6 @@ static void enumerate_common(char *fname, int bus_no, int host_no,
out.get_nwa = mmc_get_nwa;
out.close_disc = mmc_close_disc;
out.close_session = mmc_close_session;
out.close_track_session = mmc_close;
out.read_buffer_capacity = mmc_read_buffer_capacity;
out.idata = malloc(sizeof(struct burn_scsi_inquiry_data));
out.idata->valid = 0;

View File

@ -585,40 +585,19 @@ int sg_release(struct burn_drive *d)
return 0;
}
int sg_issue_command(struct burn_drive *d, struct command *c)
{
int done = 0, no_c_page = 0;
int err;
sg_io_hdr_t s;
#ifdef Libburn_log_sg_commandS
/* <<< ts A61030 */
static FILE *fp= NULL;
static int fpcount= 0;
int i;
#endif /* Libburn_log_sg_commandS */
/* <<< ts A60821
debug: for tracing calls which might use open drive fds */
/* ts A60821
<<< debug: for tracing calls which might use open drive fds */
char buf[161];
sprintf(buf,"sg_issue_command d->fd= %d d->released= %d\n",
d->fd,d->released);
mmc_function_spy(buf);
#ifdef Libburn_log_sg_commandS
/* <<< ts A61030 */
if(fp==NULL) {
fp= fopen("/tmp/libburn_sg_command_log","a");
fprintf(fp,"\n-----------------------------------------\n");
}
for(i=0;i<10;i++)
fprintf(fp,"%2.2x ", c->opcode[i]);
fprintf(fp,"\n");
fpcount++;
#endif /* Libburn_log_sg_commandS */
/* ts A61010 : with no fd there is no chance to send an ioctl */
if (d->fd < 0) {
c->error = 1;
@ -691,11 +670,6 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
if (s.sb_len_wr) {
if (!c->retry) {
c->error = 1;
/* ts A61030 */
/* >>> to become d->notify_error() */
scsi_notify_error(d, c, s.sbp, s.sb_len_wr, 0);
return 1;
}
switch (scsi_error(d, s.sbp, s.sb_len_wr)) {
@ -714,31 +688,6 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
return 1;
}
/* ts A61030 */
/* @param flag bit0=do also report TEST UNIT READY failures */
int scsi_notify_error(struct burn_drive *d, struct command *c,
unsigned char *sense, int senselen, int flag)
{
int key, asc, ascq, ret;
char msg[160];
if (c->opcode[0] == 0) /* SPC : TEST UNIT READY command */
if(!(flag & 1))
return 1;
key = sense[2];
asc = sense[12];
ascq = sense[13];
sprintf(msg,"SCSI error condition on command %2.2Xh : ", c->opcode[0]);
sprintf(msg+strlen(msg), "key= %x asc= %x ascq= %x\n", key,asc,ascq);
ret = libdax_msgs_submit(libdax_messenger, d->global_index, 0x0002010f,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH, msg,0,0);
return ret;
}
enum response scsi_error(struct burn_drive *d, unsigned char *sense,
int senselen)
{

View File

@ -64,9 +64,5 @@ int sg_release(struct burn_drive *);
int sg_issue_command(struct burn_drive *, struct command *);
enum response scsi_error(struct burn_drive *, unsigned char *, int);
/* ts A61030 */
/* @param flag bit0=do also report TEST UNIT READY failures */
int scsi_notify_error(struct burn_drive *, struct command *c,
unsigned char *sense, int senselen, int flag);
#endif /* __SG */

View File

@ -22,10 +22,6 @@ enum burn_source_status burn_track_set_source(struct burn_track *t,
return BURN_SOURCE_FAILED;
s->refcount++;
t->source = s;
/* ts A61031 */
t->open_ended = (s->get_size(s) <= 0);
return BURN_SOURCE_OK;
}

View File

@ -274,11 +274,6 @@ void spc_sense_write_params(struct burn_drive *d)
mmc_read_disc_info(d);
}
/* remark ts A61104 :
Although command MODE SELECT is SPC, the content of the
Write Parameters Mode Page (05h) is MMC (Table 108 in MMC-1).
Thus the filling of the mode page should be done by a mmc_ function.
*/
void spc_select_write_params(struct burn_drive *d,
const struct burn_write_opts *o)
{
@ -289,13 +284,6 @@ void spc_select_write_params(struct burn_drive *d,
/* ts A61007 : All current callers are safe. */
/* a ssert(o->drive == d); */
/* <<< A61030
fprintf(stderr,"libburn_debug: write_type=%d multi=%d control=%d\n",
o->write_type,o->multi,o->control);
fprintf(stderr,"libburn_debug: block_type=%d spc_block_type=%d\n",
o->block_type,spc_block_type(o->block_type));
*/
memcpy(c.opcode, SPC_MODE_SELECT, sizeof(SPC_MODE_SELECT));
c.retry = 1;
c.oplen = sizeof(SPC_MODE_SELECT);
@ -321,12 +309,6 @@ void spc_select_write_params(struct burn_drive *d,
+ o->write_type;
c.page->data[11] = (o->multi << 6) | o->control;
c.page->data[12] = spc_block_type(o->block_type);
/* ts A61104 */
if(!(o->control&4)) /* audio (MMC-1 table 61) */
if(o->write_type == BURN_WRITE_TAO) /* ??? for others too ? */
c.page->data[12] = 0; /* Data Block Type: Raw Data */
c.page->data[22] = 0;
c.page->data[23] = 150; /* audio pause length */
/*XXX need session format! */

View File

@ -115,17 +115,6 @@ struct burn_track *burn_track_create(void)
t->pad = 1;
t->entry = NULL;
t->source = NULL;
t->eos = 0;
/* ts A61101 */
t->sourcecount = 0;
t->writecount = 0;
t->written_sectors = 0;
/* ts A61031 */
t->open_ended = 0;
t->track_data_done = 0;
t->postgap = 0;
t->pregap1 = 0;
t->pregap2 = 0;
@ -329,31 +318,6 @@ int burn_track_get_sectors(struct burn_track *t)
return sectors;
}
/* ts A61031 */
int burn_track_is_open_ended(struct burn_track *t)
{
return !!t->open_ended;
}
/* ts A61101 : API function */
int burn_track_get_counters(struct burn_track *t,
off_t *read_bytes, off_t *written_bytes)
{
/*
fprintf(stderr, "libburn_experimental: sizeof(off_t)=%d\n",
sizeof(off_t));
*/
*read_bytes = t->sourcecount;
*written_bytes = t->writecount;
return 1;
}
/* ts A61031 */
int burn_track_is_data_done(struct burn_track *t)
{
return !!t->track_data_done;
}
int burn_track_get_shortage(struct burn_track *t)
{
int size;

View File

@ -31,18 +31,6 @@ struct burn_track
struct burn_source *source;
/** End of Source flag */
int eos;
/* ts A61101 */
off_t sourcecount;
off_t writecount;
off_t written_sectors;
/* ts A61031 */
/** Source is of undefined length */
int open_ended;
/** End of open ended track flag : offset+payload+tail are delivered */
int track_data_done;
/** The audio/data mode for the entry. Derived from control and
possibly from reading the track's first sector. */
int mode;
@ -83,10 +71,4 @@ struct burn_disc
int burn_track_get_shortage(struct burn_track *t);
/* ts A61031 : might go to libburn.h */
int burn_track_is_open_ended(struct burn_track *t);
int burn_track_is_data_done(struct burn_track *t);
#endif /* BURN__STRUCTURE_H */

View File

@ -189,10 +189,6 @@ struct burn_drive
void (*close_disc) (struct burn_write_opts * o);
void (*close_session) ( struct burn_write_opts * o);
/* ts A61029 */
void (*close_track_session) ( struct burn_drive *d,
int session, int track);
int (*test_unit_ready) (struct burn_drive * d);
void (*probe_write_modes) (struct burn_drive * d);
struct params params;

View File

@ -99,7 +99,7 @@ void type_to_form(int mode, unsigned char *ctladr, int *form)
*form |= 0x40;
}
int burn_write_flush(struct burn_write_opts *o, struct burn_track *track)
int burn_write_flush(struct burn_write_opts *o)
{
struct burn_drive *d = o->drive;
@ -108,101 +108,13 @@ int burn_write_flush(struct burn_write_opts *o, struct burn_track *track)
err = d->write(d, d->nwa, d->buffer);
if (err == BE_CANCELLED)
return 0;
/* A61101 */
if(track != NULL) {
track->writecount += d->buffer->bytes;
track->written_sectors += d->buffer->sectors;
}
d->nwa += d->buffer->sectors;
d->buffer->bytes = 0;
d->buffer->sectors = 0;
}
d->sync_cache(d);
return 1;
}
/* ts A61030 */
int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
int tnum)
{
char msg[81];
struct burn_drive *d;
struct burn_track *t;
int todo, step, cancelled, seclen;
d = o->drive;
t = s->track[tnum];
/* ts A61103 : pad up track to minimum size of 600 sectors */
if (t->written_sectors < 300) {
todo = 300 - t->written_sectors;
sprintf(msg,"Padding up track to minimum size (+ %d sectors)",
todo);
libdax_msgs_submit(libdax_messenger, o->drive->global_index,
0x0002011a,
LIBDAX_MSGS_SEV_NOTE, LIBDAX_MSGS_PRIO_HIGH, msg,0,0);
step = BUFFER_SIZE / 4096; /* shall fit any sector size */
if (step <= 0)
step = 1;
seclen = burn_sector_length(t->mode);
if (seclen <= 0)
seclen = 2048;
memset(d->buffer, 0, sizeof(struct buffer));
cancelled = d->cancel;
for (; todo > 0; todo -= step) {
if (step > todo)
step = todo;
d->buffer->bytes = step*seclen;
d->buffer->sectors = step;
d->cancel = 0;
d->write(d, d->nwa, d->buffer);
d->nwa += d->buffer->sectors;
t->writecount += d->buffer->bytes;
t->written_sectors += d->buffer->sectors;
}
d->cancel = cancelled;
}
/* ts A61102 */
d->busy = BURN_DRIVE_CLOSING_TRACK;
sprintf(msg, "Closing track %2.2d", tnum+1);
libdax_msgs_submit(libdax_messenger, o->drive->global_index,0x00020119,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH, msg,0,0);
/* MMC-1 mentions track number 0xFF for "the incomplete track",
MMC-3 does not. I tried both. 0xFF was in effect when other
bugs finally gave up and made way for readable tracks. */
d->close_track_session(o->drive, 0, 0xff); /* tnum+1); */
/* ts A61102 */
d->busy = BURN_DRIVE_WRITING;
return 1;
}
/* ts A61030 */
int burn_write_close_session(struct burn_write_opts *o, struct burn_session *s)
{
libdax_msgs_submit(libdax_messenger, o->drive->global_index,0x00020119,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH,
"Closing session", 0, 0);
/* ts A61102 */
o->drive->busy = BURN_DRIVE_CLOSING_SESSION;
o->drive->close_track_session(o->drive, 1, 0);
/* ts A61102 */
o->drive->busy = BURN_DRIVE_WRITING;
return 1;
}
/* ts A60819:
This is unused since about Feb 2006, icculus.org/burn CVS.
The compiler complains. We shall please our compiler.
@ -390,17 +302,8 @@ XXX this is untested :)
*/
if (!tar[i]->pad) {
rem += burn_track_get_shortage(tar[i]);
/* ts A61101 : I doubt that linking would yield a
desireable effect. With TAO it is
counterproductive in any way.
*/
if (o->write_type == BURN_WRITE_TAO)
tar[i]->source->next = NULL;
else
if (i +1 != ntr)
tar[i]->source->next = tar[i+1]->source;
if (i +1 != ntr)
tar[i]->source->next = tar[i+1]->source;
} else if (rem) {
rem = 0;
runtime++;
@ -514,7 +417,7 @@ int burn_write_session(struct burn_write_opts *o, struct burn_session *s)
{
struct burn_drive *d = o->drive;
struct burn_track *prev = NULL, *next = NULL;
int i, ret;
int i;
d->rlba = 0;
burn_print(1, " writing a session\n");
@ -527,15 +430,9 @@ int burn_write_session(struct burn_write_opts *o, struct burn_session *s)
next = NULL;
if (!burn_write_track(o, s, i))
{ ret = 0; goto ex; }
return 0;
}
/* ts A61103 */
ret = 1;
ex:;
if (o->write_type == BURN_WRITE_TAO)
burn_write_close_session(o, s);
return ret;
return 1;
}
int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
@ -543,18 +440,13 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
{
struct burn_track *t = s->track[tnum];
struct burn_drive *d = o->drive;
int i, tmp = 0, open_ended = 0, ret, nwa;
int i, tmp = 0;
int sectors;
char msg[80];
d->rlba = -150;
/* XXX for tao, we don't want the pregaps but still want post? */
if (o->write_type != BURN_WRITE_TAO) {
/* ts A61102 */
d->busy = BURN_DRIVE_WRITING_PREGAP;
if (t->pregap1)
d->rlba += 75;
if (t->pregap2)
@ -570,35 +462,20 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
for (i = 0; i < 75; i++)
if (!sector_pregap(o, t->entry->point,
pt->entry->control, pt->mode))
{ ret = 0; goto ex; }
return 0;
}
if (t->pregap2)
for (i = 0; i < 150; i++)
if (!sector_pregap(o, t->entry->point,
t->entry->control, t->mode))
{ ret = 0; goto ex; }
return 0;
} else {
o->control = t->entry->control;
d->send_write_parameters(d, o);
/* ts A61103 */
nwa = d->get_nwa(d);
sprintf(msg, "pre-track %2.2d : get_nwa()= %d , d->nwa= %d\n",
tnum+1, nwa, d->nwa);
libdax_msgs_submit(libdax_messenger, d->global_index, 0x000002,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
msg,0,0);
if (nwa > d->nwa)
d->nwa = nwa;
}
/* user data */
/* ts A61102 */
d->busy = BURN_DRIVE_WRITING;
sectors = burn_track_get_sectors(t);
open_ended = burn_track_is_open_ended(t);
/* Update progress */
d->progress.start_sector = d->nwa;
@ -611,11 +488,10 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
burn_print(12, "track %d is %d sectors long\n", tnum, sectors);
/* ts A61030 : this cannot happen. tnum is alsways < s-tracks */
if (tnum == s->tracks)
tmp = sectors > 150 ? 150 : sectors;
for (i = 0; open_ended || i < sectors - tmp; i++) {
for (i = 0; i < sectors - tmp; i++) {
/* ts A61023 : http://libburn.pykix.org/ticket/14
From time to time inquire drive buffer */
@ -623,24 +499,12 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
d->read_buffer_capacity(d);
if (!sector_data(o, t, 0))
{ ret = 0; goto ex; }
/* ts A61031 */
if (open_ended) {
d->progress.sectors = sectors = i;
if (burn_track_is_data_done(t))
break;
}
return 0;
/* update current progress */
d->progress.sector++;
}
for (; i < sectors; i++) {
/* ts A61030: program execution never gets to this point */
fprintf(stderr,"LIBBURN_DEBUG: TNUM=%d TRACKS=%d TMP=%d\n",
tnum, s->tracks, tmp);
burn_print(1, "last track, leadout prep\n");
/* ts A61023 */
@ -648,7 +512,7 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
d->read_buffer_capacity(d);
if (!sector_data(o, t, 1))
{ ret = 0; goto ex; }
return 0;
/* update progress */
d->progress.sector++;
@ -658,40 +522,23 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
for (i = 0; i < 150; i++)
if (!sector_postgap(o, t->entry->point, t->entry->control,
t->mode))
{ ret = 0; goto ex; }
return 0;
i = t->offset;
if (o->write_type == BURN_WRITE_SAO) {
if (d->buffer->bytes) {
int err;
err = d->write(d, d->nwa, d->buffer);
if (err == BE_CANCELLED)
{ ret = 0; goto ex; }
/* A61101 : probably this is not payload data */
/* t->writecount += d->buffer->bytes; */
return 0;
d->nwa += d->buffer->sectors;
d->buffer->bytes = 0;
d->buffer->sectors = 0;
}
}
/* ts A61103 */
ret = 1;
ex:;
if (o->write_type == BURN_WRITE_TAO) {
/* ts A61103 */
/* >>> if cancelled: ensure that at least 600 kB get written */
if (!burn_write_flush(o, t))
ret = 0;
/* ts A61030 */
if (burn_write_close_track(o, s, tnum) <= 0)
ret = 0;
}
return ret;
if (o->write_type == BURN_WRITE_TAO)
if (!burn_write_flush(o))
return 0;
return 1;
}
/* ts A61009 */
@ -722,8 +569,7 @@ void burn_disc_write_sync(struct burn_write_opts *o, struct burn_disc *disc)
struct buffer buf;
struct burn_track *lt;
int first = 1, i;
int nwa;
char msg[80];
int res;
/* ts A60924 : libburn/message.c gets obsoleted
burn_message_clear_queue();
@ -740,14 +586,8 @@ void burn_disc_write_sync(struct burn_write_opts *o, struct burn_disc *disc)
/* Apparently some drives require this command to be sent, and a few drives
return crap. so we send the command, then ignore the result.
*/
nwa = d->get_nwa(d);
/* >>> ts A61031 : one should not ignore the "crap" but find out
when and why it occurs. Multi-session will hardly
work on base of flat guessing.
*/
sprintf(msg, "Inquired nwa: %d", nwa);
libdax_msgs_submit(libdax_messenger, d->global_index, 0x00000002,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO, msg,0,0);
res = d->get_nwa(d);
/* printf("ignored nwa: %d\n", res);*/
d->alba = d->start_lba;
d->nwa = d->alba;
@ -796,19 +636,8 @@ return crap. so we send the command, then ignore the result.
goto fail;
} else {
if (first) {
/* ts A61030 : 0 made the burner take data. */
/* ts A61103 : Meanwhile d->nwa is updated in
burn_write_track() */
if(o->write_type == BURN_WRITE_TAO) {
d->nwa= d->alba = 0;
} else {
d->nwa = -150;
d->alba = -150;
}
d->nwa = -150;
d->alba = -150;
} else {
d->nwa += 4500;
d->alba += 4500;
@ -823,13 +652,8 @@ return crap. so we send the command, then ignore the result.
lt->mode))
goto fail;
} else {
/* ts A61030 */
if (o->write_type != BURN_WRITE_TAO)
if (!burn_write_flush(o, NULL))
goto fail;
if (!burn_write_flush(o))
goto fail;
d->nwa += first ? 6750 : 2250;
d->alba += first ? 6750 : 2250;
}
@ -841,18 +665,15 @@ return crap. so we send the command, then ignore the result.
d->progress.start_sector = 0;
d->progress.sectors = 0;
}
/* ts A61030: extended skipping of flush to TAO: session is closed */
if (o->write_type != BURN_WRITE_SAO && o->write_type != BURN_WRITE_TAO)
if (!burn_write_flush(o, NULL))
if (o->write_type != BURN_WRITE_SAO)
if (!burn_write_flush(o))
goto fail;
sleep(1);
burn_print(1, "done\n");
d->busy = BURN_DRIVE_IDLE;
/* ts A61012 : This return was traditionally missing. I suspect this
/* ts A61012 : This return was traditionally missing, a suspect this
to have caused Cdrskin_eject() failures */
return;

View File

@ -24,11 +24,6 @@ int burn_write_leadout(struct burn_write_opts *o,
int burn_write_session(struct burn_write_opts *o, struct burn_session *s);
int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
int tnum);
int burn_write_flush(struct burn_write_opts *o, struct burn_track *track);
/* ts A61030 : necessary for TAO */
int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
int tnum);
int burn_write_close_session(struct burn_write_opts *o,struct burn_session *s);
int burn_write_flush(struct burn_write_opts *o);
#endif /* BURN__WRITE_H */

View File

@ -35,10 +35,17 @@
*/
/* We shall prepare for times when more than 2 GB of data are to be handled.
This gives POSIX-ly 64 bit off_t */
#ifndef _LARGEFILE_SOURCE
#define _LARGEFILE_SOURCE 1
#endif
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
#endif
/** See this for the decisive API specs . libburn.h is The Original */
/* For using the installed header file : #include <libburn/libburn.h> */
/* This program insists in the own headerfile. */
#include "../libburn/libburn.h"
#include <libburn/libburn.h>
/* libburn is intended for Linux systems with kernel 2.4 or 2.6 for now */
#include <stdio.h>
@ -242,8 +249,7 @@ int libburner_aquire_by_driveno(int *driveno)
int libburner_blank_disc(struct burn_drive *drive, int blank_fast)
{
enum burn_disc_status disc_state;
struct burn_progress p;
int percent = 1;
struct burn_progress progress;
while (burn_drive_get_status(drive, NULL) != BURN_DRIVE_IDLE)
usleep(1001);
@ -275,13 +281,11 @@ int libburner_blank_disc(struct burn_drive *drive, int blank_fast)
}
printf(
"Beginning to %s-blank CD media.\n", (blank_fast?"fast":"full"));
printf(
"Expect some garbage sector numbers and some zeros at first.\n");
burn_disc_erase(drive, blank_fast);
sleep(1);
while (burn_drive_get_status(drive, &p) != BURN_DRIVE_IDLE) {
if(p.sectors>0 && p.sector>=0) /* display 1 to 99 percent */
percent = 1.0 + ((double) p.sector+1.0)
/ ((double) p.sectors) * 98.0;
printf("Blanking ( %d%% done )\n", percent);
while (burn_drive_get_status(drive, &progress) != BURN_DRIVE_IDLE) {
printf("Blanking sector %d\n", progress.sector);
sleep(1);
}
printf("Done\n");