On Apr 25 2018 08:42, Takashi Sakamoto wrote:
@@ -300,10 +333,9 @@ int snd_dice_stream_start_duplex(struct snd_dice *dice, unsigned int rate)
"fail to get sampling rate\n");
return err;
}
- if (rate == 0)
+
+ if (rate != 0)
rate = curr_rate;
Oops. I realized that the condition change is my mistake... This night I
repost revised version, sorry...
- if (rate != curr_rate)
- return -EINVAL;
/* Judge to need to restart streams. */
for (i = 0; i < MAX_STREAMS; i++) {
@@ -318,7 +350,7 @@ int snd_dice_stream_start_duplex(struct snd_dice *dice, unsigned int rate)
break;
}
}
- need_to_start = (i < MAX_STREAMS);
+ need_to_start = (rate != curr_rate || i < MAX_STREAMS);
if (need_to_start) {
/* Stop transmission. */
@@ -327,7 +359,7 @@ int snd_dice_stream_start_duplex(struct snd_dice *dice, unsigned int rate)
stop_streams(dice, AMDTP_OUT_STREAM, &rx_params);
release_resources(dice);
- err = ensure_phase_lock(dice);
+ err = ensure_phase_lock(dice, rate);
if (err < 0) {
dev_err(&dice->unit->device,
"fail to ensure phase lock\n");
Thanks
Takashi Sakamoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel