Skip to content

Commit 2e04067

Browse files
popcornmixThadeu Lima de Souza Cascardo
authored andcommitted
Revert "bcm2835: interpolate audio delay"
This reverts commit 83eca61.
1 parent bbe5cbd commit 2e04067

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

sound/arm/bcm2835-pcm.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/* hardware definition */
2626
static struct snd_pcm_hardware snd_bcm2835_playback_hw = {
2727
.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
28-
SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_BATCH),
28+
SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
2929
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
3030
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
3131
.rate_min = 8000,
@@ -99,8 +99,6 @@ static irqreturn_t bcm2835_playback_fifo_irq(int irq, void *dev_id)
9999
alsa_stream->pos %= alsa_stream->buffer_size;
100100
}
101101

102-
alsa_stream->interpolate_start = ktime_get_ns();
103-
104102
if (alsa_stream->substream) {
105103
if (new_period)
106104
snd_pcm_period_elapsed(alsa_stream->substream);
@@ -401,7 +399,6 @@ static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream)
401399
alsa_stream->buffer_size = snd_pcm_lib_buffer_bytes(substream);
402400
alsa_stream->period_size = snd_pcm_lib_period_bytes(substream);
403401
alsa_stream->pos = 0;
404-
alsa_stream->interpolate_start = ktime_get_ns();
405402

406403
audio_debug("buffer_size=%d, period_size=%d pos=%d frame_bits=%d\n",
407404
alsa_stream->buffer_size, alsa_stream->period_size,
@@ -498,7 +495,6 @@ snd_bcm2835_pcm_pointer(struct snd_pcm_substream *substream)
498495
{
499496
struct snd_pcm_runtime *runtime = substream->runtime;
500497
bcm2835_alsa_stream_t *alsa_stream = runtime->private_data;
501-
u64 now = ktime_get_ns();
502498

503499
audio_info(" .. IN\n");
504500

@@ -507,12 +503,6 @@ snd_bcm2835_pcm_pointer(struct snd_pcm_substream *substream)
507503
frames_to_bytes(runtime, runtime->control->appl_ptr),
508504
alsa_stream->pos);
509505

510-
/* Give userspace better delay reporting by interpolating between GPU
511-
* notifications, assuming audio speed is close enough to the clock
512-
* used for ktime */
513-
if (alsa_stream->interpolate_start && alsa_stream->interpolate_start < now)
514-
runtime->delay = -(int)div_u64((now - alsa_stream->interpolate_start) * runtime->rate, 1000000000);
515-
516506
audio_info(" .. OUT\n");
517507
return snd_pcm_indirect_playback_pointer(substream,
518508
&alsa_stream->pcm_indirect,

sound/arm/bcm2835.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ typedef struct bcm2835_alsa_stream {
137137
unsigned int pos;
138138
unsigned int buffer_size;
139139
unsigned int period_size;
140-
u64 interpolate_start;
141140

142141
uint32_t enable_fifo_irq;
143142
irq_handler_t fifo_irq_handler;

0 commit comments

Comments
 (0)