Hello Mike,

On 10/18/18 12:57, Mike Brady wrote:
> +     ktime_t now = ktime_get();
> +
> +     /* Give userspace better delay reporting by interpolating between GPU
> +      * notifications, assuming audio speed is close enough to the clock
> +      * used for ktime
> +      */
> +
> +     if ((ktime_to_ns(alsa_stream->interpolate_start)) &&
> +         (ktime_compare(alsa_stream->interpolate_start, now) < 0)) {
> +             u64 interval =
> +                     (ktime_to_ns(ktime_sub(now,
> +                             alsa_stream->interpolate_start)));
> +             u64 frames_output_in_interval =
> +                     div_u64((interval * runtime->rate), 1000000000);
> +             snd_pcm_sframes_t frames_output_in_interval_sized =
> +                     -frames_output_in_interval;
> +             runtime->delay = frames_output_in_interval_sized;
> +     }

This doesn't look like a good solution for me. More like a workaround. What is
the root cause of the delay?

Best Regards,
Kirill
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to