Skip to content

Commit d12c51d

Browse files
adiknothtiwai
authored andcommitted
ALSA: hdspm - Fix reported external sample rate on RME MADI and MADIface
In slave mode, the card can only detect the base frequency (32..48kHz) on the MADI link (exception: 96k frames), so the real external sample rate is this base frequency multiplied by 1, 2 or 4 depending on the speed mode. This patch enables 64..192kHz sample rates in clock slave mode, which failed before due to an alleged sample rate mismatch between the MADI link (e.g., 48kHz) and the application in DS/QS mode (e.g., 96kHz, 192kHz). Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 700d1ef commit d12c51d

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎sound/pci/rme9652/hdspm.c‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,22 @@ static int hdspm_external_sample_rate(struct hdspm *hdspm)
12171217
rate = 0;
12181218
break;
12191219
}
1220+
1221+
/* QS and DS rates normally can not be detected
1222+
* automatically by the card. Only exception is MADI
1223+
* in 96k frame mode.
1224+
*
1225+
* So if we read SS values (32 .. 48k), check for
1226+
* user-provided DS/QS bits in the control register
1227+
* and multiply the base frequency accordingly.
1228+
*/
1229+
if (rate <= 48000) {
1230+
if (hdspm->control_register & HDSPM_QuadSpeed)
1231+
rate *= 4;
1232+
else if (hdspm->control_register &
1233+
HDSPM_DoubleSpeed)
1234+
rate *= 2;
1235+
}
12201236
}
12211237
break;
12221238
}

0 commit comments

Comments
 (0)