switch defaults to 48kHz, 960 frame/block, 8 blocks

This commit is contained in:
Alexandre Ratchov 2012-03-22 09:32:51 +01:00
parent cfdd9671b8
commit 47288b2d38
3 changed files with 26 additions and 12 deletions

View File

@ -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.
This is the number of frames that will be buffered before being played
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
.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 .
.It Fl r Ar rate
Sample rate in Hertz of the stream.
The default is 44100Hz.
The default is 48000.
.It Fl s Ar name
Add
.Ar name
@ -354,8 +357,11 @@ option,
and MTC is used for synchronization, the clock
resolution must be 96, 100 or 120 ticks per second for maximum
accuracy.
For instance, 120 ticks per second at 48000Hz corresponds
to a 400 frame block size.
For instance, 100 ticks per second at 48000Hz corresponds
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
.Pp
On the command line,

View File

@ -63,14 +63,21 @@
* sample rate if no ``-r'' is used
*/
#ifndef DEFAULT_RATE
#define DEFAULT_RATE 44100
#define DEFAULT_RATE 48000
#endif
/*
* block size if no ``-z'' is used
* block size if neither ``-z'' nor ``-b'' is used
*/
#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
/*
@ -345,12 +352,13 @@ mkdev(char *path, int mode, int bufsz, int round, int hold, int autovol)
return dev_list;
path = "default";
}
if (!bufsz) {
if (!round)
round = DEFAULT_ROUND;
bufsz = round * 4;
if (!bufsz && !round) {
round = DEFAULT_ROUND;
bufsz = DEFAULT_BUFSZ;
} else if (!bufsz) {
bufsz = round * 2;
} else if (!round)
round = bufsz / 4;
round = bufsz / 2;
d = dev_new(path, mode, bufsz, round, hold, autovol);
if (d == NULL)
exit(1);

View File

@ -283,7 +283,7 @@ dev_open(struct dev *d)
else
d->opar.rate = d->ipar.rate;
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)
d->mode &= ~MODE_AUDIOMASK;