|
a/src/alsadirect.cpp |
|
b/src/alsadirect.cpp |
|
... |
|
... |
61 |
/* This is used to disable sample rate conversion until playing is actually
|
61 |
/* This is used to disable sample rate conversion until playing is actually
|
62 |
started */
|
62 |
started */
|
63 |
static bool qinit = false;
|
63 |
static bool qinit = false;
|
64 |
|
64 |
|
65 |
static snd_pcm_t *pcm;
|
65 |
static snd_pcm_t *pcm;
|
|
|
66 |
|
|
|
67 |
// A period is data processed between interrupts. When playing,
|
|
|
68 |
// there is one period belonging to the hardware and normally
|
|
|
69 |
// others that the software can fill up. The minimum reasonable is
|
|
|
70 |
// 2 periods (one for us, one for the hardware), which we try to
|
|
|
71 |
// use as this gives minimum latency while being workable. But we
|
|
|
72 |
// have to accept that the driver may have other constraints. Not
|
|
|
73 |
// too sure why we bother actually, because we don't use the
|
|
|
74 |
// resulting config at all while writing...
|
|
|
75 |
// In any case, if we get what we ask for, we have an in-driver
|
|
|
76 |
// latency of between 16KBytes and 32KBytes, 4K to 8K frames (16:2),
|
|
|
77 |
// 200mS at 44.1 Khz
|
|
|
78 |
//
|
66 |
/* These may be changed depending on local alsa caps */
|
79 |
// These may be changed depending on local alsa caps:
|
67 |
static snd_pcm_uframes_t periodsize = 16384; /* Periodsize (bytes) */
|
80 |
static snd_pcm_uframes_t periodsize = 16384; /* Periodsize (bytes) */
|
68 |
static unsigned int periods = 2; /* Number of periods */
|
81 |
static unsigned int periods = 2; /* Number of periods */
|
69 |
|
82 |
|
70 |
static void *alsawriter(void *p)
|
83 |
static void *alsawriter(void *p)
|
71 |
{
|
84 |
{
|