1 From 48f4f82875a8bc8fe399714114daee135592d963 Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Mon, 29 Apr 2019 19:16:14 +0100
4 Subject: [PATCH 434/725] Revert "bcm2835: interpolate audio delay"
6 commit fb4b9f02986fcb5ae751106ef9b027806b5dd750 upstream.
8 This reverts commit fb8cc99f05687ca5565dc53a7ee0dd86aefad952.
10 .../vc04_services/bcm2835-audio/bcm2835-pcm.c | 12 +-----------
11 .../staging/vc04_services/bcm2835-audio/bcm2835.h | 1 -
12 2 files changed, 1 insertion(+), 12 deletions(-)
14 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
15 +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
17 /* hardware definition */
18 static const struct snd_pcm_hardware snd_bcm2835_playback_hw = {
19 .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
20 - SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_BATCH),
21 + SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
22 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
23 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
25 @@ -81,8 +81,6 @@ void bcm2835_playback_fifo(struct bcm283
26 alsa_stream->pos %= alsa_stream->buffer_size;
29 - alsa_stream->interpolate_start = ktime_get_ns();
31 if (alsa_stream->substream) {
33 snd_pcm_period_elapsed(alsa_stream->substream);
34 @@ -308,7 +306,6 @@ static int snd_bcm2835_pcm_prepare(struc
35 alsa_stream->buffer_size = snd_pcm_lib_buffer_bytes(substream);
36 alsa_stream->period_size = snd_pcm_lib_period_bytes(substream);
38 - alsa_stream->interpolate_start = ktime_get_ns();
40 audio_debug("buffer_size=%d, period_size=%d pos=%d frame_bits=%d\n",
41 alsa_stream->buffer_size, alsa_stream->period_size,
42 @@ -400,19 +397,12 @@ snd_bcm2835_pcm_pointer(struct snd_pcm_s
44 struct snd_pcm_runtime *runtime = substream->runtime;
45 struct bcm2835_alsa_stream *alsa_stream = runtime->private_data;
46 - u64 now = ktime_get_ns();
48 audio_debug("pcm_pointer... (%d) hwptr=%d appl=%d pos=%d\n", 0,
49 frames_to_bytes(runtime, runtime->status->hw_ptr),
50 frames_to_bytes(runtime, runtime->control->appl_ptr),
53 - /* Give userspace better delay reporting by interpolating between GPU
54 - * notifications, assuming audio speed is close enough to the clock
56 - if (alsa_stream->interpolate_start && alsa_stream->interpolate_start < now)
57 - runtime->delay = -(int)div_u64((now - alsa_stream->interpolate_start) * runtime->rate, 1000000000);
59 return snd_pcm_indirect_playback_pointer(substream,
60 &alsa_stream->pcm_indirect,
62 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
63 +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
64 @@ -133,7 +133,6 @@ struct bcm2835_alsa_stream {
66 unsigned int buffer_size;
67 unsigned int period_size;
68 - u64 interpolate_start;
71 struct bcm2835_audio_instance *instance;