All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH alsa-lib 1/2] pcm_hw: Remove unused fields in struct
@ 2013-05-30 10:26 David Henningsson
  2013-05-30 10:26 ` [PATCH alsa-lib 2/2] pcm_plugin: Fix return value of snd_pcm_rewind David Henningsson
  0 siblings, 1 reply; 5+ messages in thread
From: David Henningsson @ 2013-05-30 10:26 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, arun.raghavan, David Henningsson

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;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH alsa-lib 2/2] pcm_plugin: Fix return value of snd_pcm_rewind
  2013-05-30 10:26 [PATCH alsa-lib 1/2] pcm_hw: Remove unused fields in struct David Henningsson
@ 2013-05-30 10:26 ` David Henningsson
  2013-05-30 12:05   ` Jaroslav Kysela
  0 siblings, 1 reply; 5+ messages in thread
From: David Henningsson @ 2013-05-30 10:26 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, arun.raghavan, David Henningsson

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)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH alsa-lib 2/2] pcm_plugin: Fix return value of snd_pcm_rewind
  2013-05-30 10:26 ` [PATCH alsa-lib 2/2] pcm_plugin: Fix return value of snd_pcm_rewind David Henningsson
@ 2013-05-30 12:05   ` Jaroslav Kysela
  2013-06-26  6:36     ` Arun Raghavan
  0 siblings, 1 reply; 5+ messages in thread
From: Jaroslav Kysela @ 2013-05-30 12:05 UTC (permalink / raw)
  To: David Henningsson; +Cc: tiwai, alsa-devel, arun.raghavan

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

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project; Red Hat, Inc.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH alsa-lib 2/2] pcm_plugin: Fix return value of snd_pcm_rewind
  2013-05-30 12:05   ` Jaroslav Kysela
@ 2013-06-26  6:36     ` Arun Raghavan
  2013-06-26  9:28       ` Jaroslav Kysela
  0 siblings, 1 reply; 5+ messages in thread
From: Arun Raghavan @ 2013-06-26  6:36 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: tiwai, alsa-devel, David Henningsson

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH alsa-lib 2/2] pcm_plugin: Fix return value of snd_pcm_rewind
  2013-06-26  6:36     ` Arun Raghavan
@ 2013-06-26  9:28       ` Jaroslav Kysela
  0 siblings, 0 replies; 5+ messages in thread
From: Jaroslav Kysela @ 2013-06-26  9:28 UTC (permalink / raw)
  To: Arun Raghavan; +Cc: tiwai, alsa-devel, David Henningsson

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

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project; Red Hat, Inc.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-26  9:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-30 10:26 [PATCH alsa-lib 1/2] pcm_hw: Remove unused fields in struct David Henningsson
2013-05-30 10:26 ` [PATCH alsa-lib 2/2] pcm_plugin: Fix return value of snd_pcm_rewind David Henningsson
2013-05-30 12:05   ` Jaroslav Kysela
2013-06-26  6:36     ` Arun Raghavan
2013-06-26  9:28       ` Jaroslav Kysela

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.