Skip to content

Commit

Permalink
ALSA: hdspm - Report external rate in slave mode on PCI MADI
Browse files Browse the repository at this point in the history
As a follow-up to a97bda7, report the
external sample rate as system_sample_rate when in slave mode.

For PCIe MADI cards, the DDS value automatically contains the external
sample rate, but the PCI version needs this manual workaround.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Adrian Knoth authored and Takashi Iwai committed Oct 20, 2012
1 parent 41285a9 commit 21a164d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions sound/pci/rme9652/hdspm.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ static inline void snd_hdspm_initialize_midi_flush(struct hdspm *hdspm);
static int hdspm_update_simple_mixer_controls(struct hdspm *hdspm);
static int hdspm_autosync_ref(struct hdspm *hdspm);
static int snd_hdspm_set_defaults(struct hdspm *hdspm);
static int hdspm_system_clock_mode(struct hdspm *hdspm);
static void hdspm_set_sgbuf(struct hdspm *hdspm,
struct snd_pcm_substream *substream,
unsigned int reg, int channels);
Expand Down Expand Up @@ -1989,10 +1990,14 @@ static int hdspm_get_system_sample_rate(struct hdspm *hdspm)
rate = hdspm_calc_dds_value(hdspm, period);

if (rate > 207000) {
/* Unreasonable high sample rate as seen on PCI MADI cards.
* Use the cached value instead.
*/
rate = hdspm->system_sample_rate;
/* Unreasonable high sample rate as seen on PCI MADI cards. */
if (0 == hdspm_system_clock_mode(hdspm)) {
/* master mode, return internal sample rate */
rate = hdspm->system_sample_rate;
} else {
/* slave mode, return external sample rate */
rate = hdspm_external_sample_rate(hdspm);
}
}

return rate;
Expand Down

0 comments on commit 21a164d

Please sign in to comment.