[alsa-devel] [PATCH 05/11] ALSA: dice: enable to change current sampling transmission frequency

Takashi Sakamoto o-takashi at sakamocchi.jp
Thu Apr 26 13:01:28 CEST 2018


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


More information about the Alsa-devel mailing list