DALIB(3)

NAME
dalib - support for Digital Audio Tapes (DAT)

INTRODUCTION
The DAT support library provides a simple method to access specific brands of SCSI DDS Streamers in Audio Mode to read and write DAT tapes.

The library is a layer between the kernel and the userlevel functions, hiding most of the de- and encoding functionality needed. Its goal was to abstract the data structure on the tape as much as possible and make access to the tapedevice similar to audiostreams (as read from /dev/audio) and to the characterdevice semantics.

Before using the features of the library you have to initialize the library for a tapdevice or file and 'open' a datfiledescriptor. You can do that using either da_open or da_init. (Please check the resp. manpages.)
To close a datfiledescriptor and save the internal status use da_close.
For reading and writing on datfiledescriptors you may use da_write and da_read.
To set and get parameters or initiate actions use da_control.

STRUCTS
Structures and unions used by the API:

  struct da_time
	struct da_time {
		u8      indexnr;
		u8      hour;
		u8      minute;
		u8      second;
		u8      frame;
	};
u8 is an unsigned 8 bit wide integers.

  struct da_date
	struct da_date {
		u8      weekday;
		u8      year;
		u8      month;
		u8      day;
		u8      hour;
		u8      minute;
		u8      second;
	};

  struct da_isrc
	struct  da_isrc {
		u32     country;
		u32     producer;
		u8      year;
		u32     serialnr;
	};
Country and Producer are given out by special registries, the year are the last two bcd numbers of the year the song was recorded and serialnr is a serial number given out by the producer.

  struct da_catalognr
A struct containing the catalognr (usually the EAN or UPC).
	struct  da_catalognr {
		u8      nr[14];
	};
Every element of nr represents a ASCII letter/number of the barcode.

  struct da_tocentry
	struct  da_tocentry {
		u32     prognr;
		u8      value;
		u8      hour;
		u8      minute;
		u8      second;
		u8      frame;
		char    *name;
	};

  struct da_locate
	union _da_loc_un {
		struct  da_time time;
		int     prognr;
	};
	struct da_locate {
		u8      type;
		u8      nextop;
		union   _da_loc_un u;
	};

  struct da_position
	struct da_position {
		u32     prognr;
		u8      indexnr;
		struct  da_time progtime;
		struct  da_time abstime;
		struct  da_time runtime;
	};

  struct da_trackname
	struct  da_trackname {
		int     prognr;
		char    *name;
		int     namelen;
	};

  union da_callback_data
	struct _da_toc {
		int     tocentries;
		struct  da_tocentry     *toc;
	};
	union   da_callback_data {
		int     prognr;
		int     samplerate;
		int     channels;
		struct  da_subid subid;
		struct  da_time time;
		struct  da_date date;
		struct  _da_toc toc;
		char    *trackname;
	};

  struct da_subid
	struct  da_subid {
		u32     emphasis:2;
		u32     samplerate:2;
	#define DA_SUBID_SAMPLERATE_48KHZ       0
	#define DA_SUBID_SAMPLERATE_441KHZ      1
	#define DA_SUBID_SAMPLERATE_32KHZ       2
		u32     channels:2;
	#define DA_SUBID_CHANNELS_2     0
	#define DA_SUBID_CHANNELS_4     1
		u32     encoding:2;
	#define DA_SUBID_ENCODING_16    0
	#define DA_SUBID_ENCODING_12    1
		u32     width   :2;
	#define DA_SUBID_WIDTH_NORMAL   0
	#define DA_SUBID_WIDTH_WIDE     1
		u32     scms    :2;
	#define DA_SUBID_SCMS_ALLOWED   0
	#define DA_SUBID_SCMS_DENIED    2
		u32     datapacket:2;
	};

SEE ALSO
da_open(3),da_close(3),da_init(3),da_control(3),da_add_callback(3),da_read(3),da_write(3)

AUTHOR
Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>