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