1.\" $MirOS: src/usr.bin/cdio/cdio.1,v 1.3 2010/03/06 19:57:40 tg Exp $
2.\" $OpenBSD: cdio.1,v 1.55 2010/03/01 02:09:44 krw Exp $
3.\"
4.\" Copyright (c) 1995 Serge V. Vakulenko
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software
17.\"    must display the following acknowledgement:
18.\"	This product includes software developed by Serge V. Vakulenko.
19.\" 4. The name of the author may not be used to endorse or promote products
20.\"    derived from this software without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32.\"
33.Dd $Mdocdate: March 6 2010 $
34.Dt CDIO 1
35.Os
36.Sh NAME
37.Nm cdio
38.Nd compact disc control utility
39.Sh SYNOPSIS
40.Nm cdio
41.Op Fl sv
42.Oo Fl d Ar host :
43.Ar port Oc
44.Op Fl f Ar device
45.Op Ar command args ...
46.Sh DESCRIPTION
47The
48.Nm
49program is a compact disc control utility,
50with support for playing audio CDs and TAO CD writing.
51.Pp
52If no command is given,
53.Nm
54enters interactive mode, reading commands from the standard input.
55.Pp
56The options are as follows:
57.Bl -tag -width Ds
58.It Xo
59.Fl d
60.Ar host : Ns Ar port
61.Xc
62Specifies a CDDB host
63.Bq default: freedb.freedb.org:cddb .
64.It Fl f Ar device
65Specifies the name of the CD device, such as
66.Pa /dev/rcd0c
67or
68.Pa mcd0 .
69Both absolute and relative paths to
70.Pa /dev
71filenames are possible;
72the raw partition name is added if needed.
73.It Fl s
74Silent mode.
75Do not print table headers or human-readable comments.
76.It Fl v
77Verbose mode.
78A second occurence of
79.Fl v
80causes even more information to be printed.
81.El
82.Pp
83The available commands are listed below.
84Only as many characters as are required to uniquely identify a command
85need be specified.
86If no command is given,
87only a track number or range,
88then
89.Ic play
90is assumed.
91.Bl -tag -width Ds
92.It Ic blank
93Minimally blank the disc.
94.It Ic cddbinfo Op Ar n
95Print the Table Of Contents (TOC) after matching the disc with the CDDB.
96In case of multiple matches, reissue the command with
97.Ar n .
98.It Ic cdid
99Print the disc ID that will be used for matching with the CDDB.
100.It Ic cdplay Op Ar track1-trackN ...
101Play specified tracks from disk.
102Unlike
103.Ic play ,
104the CD player need not be connected to an audio device;
105instead it rips tracks from disk and outputs audio data to
106the default
107.Xr audio 4
108device or
109.Xr aucat 1
110socket.
111Both individual tracks and track ranges may be specified.
112If range is specified in descending order tracks will be played in descending order.
113If the first value in the range is omitted, tracks from first track on disk to the specified one will be played.
114If the last value in the range is omitted, tracks from the specified track to the last track on disk will be played.
115.It Ic cdrip Op Ar track1-trackN ...
116Rip specified tracks from disk.
117Audio tracks are saved as WAVE sound files.
118All tracks will be saved in the current working directory.
119If parameters are omitted, all tracks are ripped.
120Both individual tracks and track ranges may be specified, in the same format as the
121.Ic cdplay
122command.
123.It Ic close
124Inject the disc.
125.It Ic debug Ar on | off
126Enable/disable the debugging mode of the CD device driver.
127.It Ic device Ar devname
128Make
129.Ar devname
130the current CD device.
131This is the equivalent of quitting
132.Nm
133and restarting with a different device.
134.It Ic eject
135Eject the disc.
136.It Ic exit
137A synonym for
138.Ic quit .
139.It Ic help
140Print the list of available commands.
141.It Ic info
142Print the Table Of Contents (TOC).
143If
144.Fl v
145is also specified,
146the current features and current profile is printed.
147If
148.Fl v
149is specified twice,
150the complete list of supported profiles
151and a hex dump of each current feature is printed.
152.It Ic lock
153Lock the drive door, preventing it from being opened manually.
154The lock is only in effect during run time of
155.Nm ,
156and can be rescinded with, for example, the
157.Ic eject
158command.
159.It Ic next
160Play the next track.
161If we're at the last track, stop.
162.It Ic pause
163Stop playing.
164Do not stop the disc.
165.It Xo Ic play
166.Oo Ar track1 Ns Op Ar .index1
167.Op Ar track2 Ns Op Ar .index2 Oc
168.Xc
169Play from
170.Ar track1
171to
172.Ar track2 ;
173an optional index point can be specified for each track.
174If only one track is specified, play from that track to the end of the disc.
175If no tracks are specified, play the whole disc.
176.It Xo Ic play
177.Oo Op Ar tr1
178.Ar m1 : Ns Ar s1 Ns Oo
179.Ar .f1 Oc
180.Op Ar tr2
181.Oo Ar m2 : Ns Ar s2 Ns
182.Op Ar .f2 Oc Oc
183.Xc
184Play from the absolute address
185(MSF) defined by
186.Ar m1
187in minutes,
188.Ar s1
189in seconds,
190frame number
191.Ar f1 ,
192to the absolute address defined by
193.Ar m2
194in minutes,
195.Ar s2
196in seconds,
197frame number
198.Ar f2 .
199If a track number is specified
200.Pq tr Ns Ar X ,
201then the minutes, seconds, and frame numbers
202are relative to the start of that track.
203Minutes are in the range 0\(en99.
204Seconds are in the range 0\(en59.
205Frame numbers are in the range 0\(en74.
206.It Ic play Op Ar #block Op Ar len
207Play starting from the logical
208.Ar block
209using
210.Ar len
211logical blocks.
212.It Ic previous
213Play the previous track.
214If we're at the first track, restart.
215.It Ic quit
216Quit the program.
217.It Ic replay
218Replay the current track.
219.It Ic reset
220Perform a hardware reset of the device.
221.It Ic resume
222Resume playing.
223Used after the
224.Ic pause
225command.
226.It Ic set Ar lba | msf
227Set LBA
228.Pq Ar lba
229or minute-second-frame
230.Pq Ar msf
231ioctl mode.
232The default is minute-second-frame ioctl mode.
233.It Ic status
234Print information about the disc:
235the current playing status and position,
236the current media catalog status,
237and the current values of the volume for left and right channels.
238.It Ic stop
239Stop the disc.
240.It Xo Ic tao
241.Op Fl ad
242.Op Fl s Ar speed
243.Ar trackfile ...
244.Xc
245.Bq command line only
246\ \&Write a track-at-once CD containing the specified
247.Ar trackfile .
248.Pp
249The options are as follows:
250.Pp
251.Bl -tag -width Ds -compact
252.It Fl a
253Write files as audio tracks.
254File formats of audio tracks may be CDDA or WAVE
255with 2 channels of PCM audio,
256signed 16-bit (little endian) values sampled at 44100 Hz.
257.It Fl d
258Write files as data tracks (the default).
259.It Fl s Ar speed
260Specify a write speed for tracks.
261.Ar speed
262may be a numerical value between 1 and
263the maximum speed supported by the media and drive,
264or one of the literal strings
265.Dq auto
266or
267.Dq max ,
268meaning the optimal or maximum speed detected.
269.El
270.It Ic volume Ar left_channel Ar right_channel
271Set the volume of the left channel to
272.Ar left_channel
273and the volume of the right channel to
274.Ar right_channel .
275Allowed values are in the range 0\-255.
276.It Xo Ic volume
277.Ic left \*(Ba
278.Ic right \*(Ba
279.Ic mono \*(Ba
280.Ic stereo \*(Ba
281.Ic mute
282.Xc
283Respectively:
284play the left subtrack on both left and right channels;
285play the right subtrack on both left and right channels;
286set mono mode;
287set stereo mode;
288turn the sound off.
289.El
290.Sh ENVIRONMENT
291.Bl -tag -width "AUDIODEVICEXXX"
292.It Ev DISC , CDROM
293Specifies the name of the CD device to use.
294If both
295.Ev DISC
296and
297.Ev CDROM
298are set,
299.Ev DISC
300takes precedence.
301If neither
302.Ev DISC
303nor
304.Ev CDROM
305are set,
306the default is
307.Pa cd0 .
308See also the
309.Fl f
310option, above.
311.It Ev AUDIODEVICE
312Name of the
313.Xr aucat 1
314socket to connect to, or path to the
315.Xr audio 4
316device to use.
317.El
318.Sh FILES
319.Bl -tag -width /dev/rmcd0c -compact
320.It Pa /dev/rcd0c
321.It Pa /dev/rmcd0c
322.El
323.Sh SEE ALSO
324.Xr aucat 1 ,
325.Xr audioctl 1 ,
326.Xr mixerctl 1 ,
327.Xr audio 4
328.Sh HISTORY
329The
330.Nm
331command is based on
332.Nm cdcontrol ,
333which first appeared in
334.Fx 2.1 .
335.Sh AUTHORS
336Jean-Marc Zucconi,
337Andrey A. Chernov,
338Serge V. Vakulenko,
339Marc Espie
340