[alsa-devel] [PATCH alsa-lib 1/2] pcm_hw: Remove unused fields in struct
These fields are not used, and their name similarity to other fields are quite confusing when trying to debug alsa-lib.
Signed-off-by: David Henningsson david.henningsson@canonical.com --- src/pcm/pcm_hw.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index 0f3226d..196393d 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -95,8 +95,6 @@ typedef struct { volatile struct snd_pcm_mmap_status * mmap_status; struct snd_pcm_mmap_control *mmap_control; struct snd_pcm_sync_ptr *sync_ptr; - snd_pcm_uframes_t hw_ptr; - snd_pcm_uframes_t appl_ptr; int period_event; snd_timer_t *period_timer; struct pollfd period_timer_pfd;
In case the rewind did not rewind as much as expected, e g due to time delay between the latest avail update and the rewind, we must properly account for that in the plugin layer.
Otherwise, the plugin's appl ptr and the hw's appl ptr become unsynchronised, which is very bad, especially in mmap_shadow plugins, e g, this could cause the overlapping memcpy in the softvol plugin as seen here: https://bugs.freedesktop.org/show_bug.cgi?id=64299
Signed-off-by: David Henningsson david.henningsson@canonical.com --- src/pcm/pcm_plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Btw, I was also considering always syncing the appl.ptr (for playback) with the slave in snd_pcm_plugin_avail_update, like we do for the hw.ptr. Do you think this would be a good idea?
diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c index 96218a8..17157e8 100644 --- a/src/pcm/pcm_plugin.c +++ b/src/pcm/pcm_plugin.c @@ -219,9 +219,9 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t snd_atomic_write_end(&plugin->watom); return sframes; } - snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) frames); + snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) sframes); snd_atomic_write_end(&plugin->watom); - return (snd_pcm_sframes_t) frames; + return (snd_pcm_sframes_t) sframes; }
static snd_pcm_sframes_t snd_pcm_plugin_forwardable(snd_pcm_t *pcm)
Date 30.5.2013 12:26, David Henningsson wrote:
In case the rewind did not rewind as much as expected, e g due to time delay between the latest avail update and the rewind, we must properly account for that in the plugin layer.
Thank you very much for this fix. I applied both patches to alsa-lib's repo.
Jaroslav
On Thu, 2013-05-30 at 14:05 +0200, Jaroslav Kysela wrote:
Date 30.5.2013 12:26, David Henningsson wrote:
In case the rewind did not rewind as much as expected, e g due to time delay between the latest avail update and the rewind, we must properly account for that in the plugin layer.
Thank you very much for this fix. I applied both patches to alsa-lib's repo.
Could we get a release with these patches? This does bite people a bit.
-- Arun
Date 26.6.2013 08:36, Arun Raghavan wrote:
On Thu, 2013-05-30 at 14:05 +0200, Jaroslav Kysela wrote:
Date 30.5.2013 12:26, David Henningsson wrote:
In case the rewind did not rewind as much as expected, e g due to time delay between the latest avail update and the rewind, we must properly account for that in the plugin layer.
Thank you very much for this fix. I applied both patches to alsa-lib's repo.
Could we get a release with these patches? This does bite people a bit.
I'll try to prepare alsa-lib 1.0.27.2 package in a few hours.
Jaroslav
participants (3)
-
Arun Raghavan
-
David Henningsson
-
Jaroslav Kysela