RE: [PATCH] ALSA: pcm: fix incorrect hw_base increase

2020-05-17 Thread Lu, Brent
> > I tried to imagine a negative impact for this hw_ptr_jiffies update when the > DMA position is not updated from the driver and I haven't found any so far. > > Let's apply this and we'll see in future :-) > > And yes, the patch description should be improved (DMA ptr is not updated / > stream

Re: [PATCH] ALSA: pcm: fix incorrect hw_base increase

2020-05-15 Thread Jaroslav Kysela
Dne 15. 05. 20 v 12:39 Takashi Iwai napsal(a): On Fri, 15 May 2020 11:30:54 +0200, Jaroslav Kysela wrote: Dne 15. 05. 20 v 11:04 Lu, Brent napsal(a): Is this a bugfix needed for older kernels as well? When did this issue show up? thanks, greg k-h It happens when DMA stop moving data from

Re: [PATCH] ALSA: pcm: fix incorrect hw_base increase

2020-05-15 Thread Takashi Iwai
On Fri, 15 May 2020 11:36:19 +0200, Lu, Brent wrote: > > > > > Updating hw_ptr_jiffies at that code path looks correct, but it still > > leaves the > > question why this condition happens. It means that the actual hwptr isn't > > changed and yet only jiffies increase significantly; it means tha

Re: [PATCH] ALSA: pcm: fix incorrect hw_base increase

2020-05-15 Thread Takashi Iwai
On Fri, 15 May 2020 11:30:54 +0200, Jaroslav Kysela wrote: > > Dne 15. 05. 20 v 11:04 Lu, Brent napsal(a): > >> > >> Is this a bugfix needed for older kernels as well? When did this issue > >> show > >> up? > >> > >> thanks, > >> > >> greg k-h > > > > It happens when DMA stop moving data from ho

Re: [PATCH] ALSA: pcm: fix incorrect hw_base increase

2020-05-15 Thread Jaroslav Kysela
Dne 15. 05. 20 v 11:04 Lu, Brent napsal(a): Is this a bugfix needed for older kernels as well? When did this issue show up? thanks, greg k-h It happens when DMA stop moving data from host to DSP/DAI for a long time (> half of buffer time). I know host driver should do something about it. Bu

RE: [PATCH] ALSA: pcm: fix incorrect hw_base increase

2020-05-15 Thread Lu, Brent
> > Updating hw_ptr_jiffies at that code path looks correct, but it still leaves > the > question why this condition happens. It means that the actual hwptr isn't > changed and yet only jiffies increase significantly; it means that the > hardware > can't report proper pointer, and it should hav

RE: [PATCH] ALSA: pcm: fix incorrect hw_base increase

2020-05-15 Thread Lu, Brent
> > Is this a bugfix needed for older kernels as well? When did this issue show > up? > > thanks, > > greg k-h It happens when DMA stop moving data from host to DSP/DAI for a long time (> half of buffer time). I know host driver should do something about it. But if not, the HWSYNC will keep in

Re: [PATCH] ALSA: pcm: fix incorrect hw_base increase

2020-05-15 Thread Takashi Iwai
On Fri, 15 May 2020 06:09:39 +0200, Brent Lu wrote: > > The hw_base will be increased by runtime->buffer_size frames > unconditionally if the runtime->status->hw_ptr is not updated for over > half of buffer time. As the hw_base increases, so does the > runtime->status->hw_ptr which could lead to i

Re: [PATCH] ALSA: pcm: fix incorrect hw_base increase

2020-05-15 Thread Greg Kroah-Hartman
On Fri, May 15, 2020 at 12:09:39PM +0800, Brent Lu wrote: > The hw_base will be increased by runtime->buffer_size frames > unconditionally if the runtime->status->hw_ptr is not updated for over > half of buffer time. As the hw_base increases, so does the > runtime->status->hw_ptr which could lead t

[PATCH] ALSA: pcm: fix incorrect hw_base increase

2020-05-14 Thread Brent Lu
The hw_base will be increased by runtime->buffer_size frames unconditionally if the runtime->status->hw_ptr is not updated for over half of buffer time. As the hw_base increases, so does the runtime->status->hw_ptr which could lead to invalid return value when user space program calls snd_pcm_avail