mirror of https://github.com/ericonr/sndio.git
switch defaults to 48kHz, 960 frame/block, 8 blocks
This commit is contained in:
parent
cfdd9671b8
commit
47288b2d38
|
@ -111,6 +111,9 @@ The buffer size of the audio device in frames.
|
||||||
A frame consists of one sample for each channel in the stream.
|
A frame consists of one sample for each channel in the stream.
|
||||||
This is the number of frames that will be buffered before being played
|
This is the number of frames that will be buffered before being played
|
||||||
and thus controls the playback latency.
|
and thus controls the playback latency.
|
||||||
|
The default is 7680 or twice the block size
|
||||||
|
.Pq Fl z ,
|
||||||
|
if the block size is set.
|
||||||
.It Xo
|
.It Xo
|
||||||
.Fl C Ar min : Ns Ar max ,
|
.Fl C Ar min : Ns Ar max ,
|
||||||
.Fl c Ar min : Ns Ar max
|
.Fl c Ar min : Ns Ar max
|
||||||
|
@ -244,7 +247,7 @@ Control (MMC) slave mode
|
||||||
.Pq Fl t .
|
.Pq Fl t .
|
||||||
.It Fl r Ar rate
|
.It Fl r Ar rate
|
||||||
Sample rate in Hertz of the stream.
|
Sample rate in Hertz of the stream.
|
||||||
The default is 44100Hz.
|
The default is 48000.
|
||||||
.It Fl s Ar name
|
.It Fl s Ar name
|
||||||
Add
|
Add
|
||||||
.Ar name
|
.Ar name
|
||||||
|
@ -354,8 +357,11 @@ option,
|
||||||
and MTC is used for synchronization, the clock
|
and MTC is used for synchronization, the clock
|
||||||
resolution must be 96, 100 or 120 ticks per second for maximum
|
resolution must be 96, 100 or 120 ticks per second for maximum
|
||||||
accuracy.
|
accuracy.
|
||||||
For instance, 120 ticks per second at 48000Hz corresponds
|
For instance, 100 ticks per second at 48000Hz corresponds
|
||||||
to a 400 frame block size.
|
to a 480 frame block size.
|
||||||
|
The default is 960 or half of the buffer size
|
||||||
|
.Pq Fl b ,
|
||||||
|
if the buffer size is set.
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
On the command line,
|
On the command line,
|
||||||
|
|
|
@ -63,14 +63,21 @@
|
||||||
* sample rate if no ``-r'' is used
|
* sample rate if no ``-r'' is used
|
||||||
*/
|
*/
|
||||||
#ifndef DEFAULT_RATE
|
#ifndef DEFAULT_RATE
|
||||||
#define DEFAULT_RATE 44100
|
#define DEFAULT_RATE 48000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* block size if no ``-z'' is used
|
* block size if neither ``-z'' nor ``-b'' is used
|
||||||
*/
|
*/
|
||||||
#ifndef DEFAULT_ROUND
|
#ifndef DEFAULT_ROUND
|
||||||
#define DEFAULT_ROUND (44100 / 15)
|
#define DEFAULT_ROUND 960
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* buffer size if neither ``-z'' nor ``-b'' is used
|
||||||
|
*/
|
||||||
|
#ifndef DEFAULT_BUFSZ
|
||||||
|
#define DEFAULT_BUFSZ 7860
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -345,12 +352,13 @@ mkdev(char *path, int mode, int bufsz, int round, int hold, int autovol)
|
||||||
return dev_list;
|
return dev_list;
|
||||||
path = "default";
|
path = "default";
|
||||||
}
|
}
|
||||||
if (!bufsz) {
|
if (!bufsz && !round) {
|
||||||
if (!round)
|
round = DEFAULT_ROUND;
|
||||||
round = DEFAULT_ROUND;
|
bufsz = DEFAULT_BUFSZ;
|
||||||
bufsz = round * 4;
|
} else if (!bufsz) {
|
||||||
|
bufsz = round * 2;
|
||||||
} else if (!round)
|
} else if (!round)
|
||||||
round = bufsz / 4;
|
round = bufsz / 2;
|
||||||
d = dev_new(path, mode, bufsz, round, hold, autovol);
|
d = dev_new(path, mode, bufsz, round, hold, autovol);
|
||||||
if (d == NULL)
|
if (d == NULL)
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -283,7 +283,7 @@ dev_open(struct dev *d)
|
||||||
else
|
else
|
||||||
d->opar.rate = d->ipar.rate;
|
d->opar.rate = d->ipar.rate;
|
||||||
if (d->opar.rate == 0)
|
if (d->opar.rate == 0)
|
||||||
d->opar.rate = d->ipar.rate = 44100; /* XXX */
|
d->opar.rate = d->ipar.rate = 48000; /* XXX */
|
||||||
|
|
||||||
if (d->mode & MODE_THRU)
|
if (d->mode & MODE_THRU)
|
||||||
d->mode &= ~MODE_AUDIOMASK;
|
d->mode &= ~MODE_AUDIOMASK;
|
||||||
|
|
Loading…
Reference in New Issue