ALSA: hdspm - Enable 32 samples/period on RME RayDAT/AIO
Newer RME cards like RayDAT and AIO support 32 samples per period. This value is encoded as {1,1,1} in the HDSP_LatencyMask bits in the control register. Since {1,1,1} is also the representation for 8192 samples/period on older RME cards, we have to special case 32 samples and 32768 bytes according to the actual card. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
7cb155ff3e
commit
2e61027079
|
@ -1323,12 +1323,27 @@ static int hdspm_set_interrupt_interval(struct hdspm *s, unsigned int frames)
|
||||||
|
|
||||||
spin_lock_irq(&s->lock);
|
spin_lock_irq(&s->lock);
|
||||||
|
|
||||||
frames >>= 7;
|
if (32 == frames) {
|
||||||
n = 0;
|
/* Special case for new RME cards like RayDAT/AIO which
|
||||||
while (frames) {
|
* support period sizes of 32 samples. Since latency is
|
||||||
n++;
|
* encoded in the three bits of HDSP_LatencyMask, we can only
|
||||||
frames >>= 1;
|
* have values from 0 .. 7. While 0 still means 64 samples and
|
||||||
|
* 6 represents 4096 samples on all cards, 7 represents 8192
|
||||||
|
* on older cards and 32 samples on new cards.
|
||||||
|
*
|
||||||
|
* In other words, period size in samples is calculated by
|
||||||
|
* 2^(n+6) with n ranging from 0 .. 7.
|
||||||
|
*/
|
||||||
|
n = 7;
|
||||||
|
} else {
|
||||||
|
frames >>= 7;
|
||||||
|
n = 0;
|
||||||
|
while (frames) {
|
||||||
|
n++;
|
||||||
|
frames >>= 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s->control_register &= ~HDSPM_LatencyMask;
|
s->control_register &= ~HDSPM_LatencyMask;
|
||||||
s->control_register |= hdspm_encode_latency(n);
|
s->control_register |= hdspm_encode_latency(n);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue