All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: samsung: In the i2s_set_sysclk() callback we are currently clearing all bits of the IISMOD register in i2s_set_sysclk. It's due to an incorrect mask used for the AND operation which is introduced in commit a5a56871f804edac93a53b5e871c0e9818fb9033 (ASoC: samsung: add support for exynos7 I2S controller) and also adds the missing break statement.
@ 2014-11-20  9:49 ` Padmavathi Venna
  0 siblings, 0 replies; 6+ messages in thread
From: Padmavathi Venna @ 2014-11-20  9:49 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc, alsa-devel
  Cc: broonie, kgene.kim, sbkim73, Sylwester Nawrocki

Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 sound/soc/samsung/i2s.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 0df6547..e1ace52 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -494,7 +494,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
 		if (dir == SND_SOC_CLOCK_IN)
 			mod |= 1 << i2s_regs->cdclkcon_off;
 		else
-			mod &= 0 << i2s_regs->cdclkcon_off;
+			mod &= ~(1 << i2s_regs->cdclkcon_off);
 
 		i2s->rfs = rfs;
 		break;
@@ -551,10 +551,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
 		}
 
 		if (clk_id == 0)
-			mod &= 0 << i2s_regs->rclksrc_off;
+			mod &= ~(1 << i2s_regs->rclksrc_off);
 		else
 			mod |= 1 << i2s_regs->rclksrc_off;
 
+		break;
 	default:
 		dev_err(&i2s->pdev->dev, "We don't serve that!\n");
 		return -EINVAL;
-- 
1.7.4.4

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

* [PATCH] ASoC: samsung: In the i2s_set_sysclk() callback we are currently clearing all bits of the IISMOD register in i2s_set_sysclk. It's due to an incorrect mask used for the AND operation which is introduced in commit a5a56871f804edac93a53b5e871c0e9818fb9033 (ASoC: samsung: add support for exynos7 I2S controller) and also adds the missing break statement.
@ 2014-11-20  9:49 ` Padmavathi Venna
  0 siblings, 0 replies; 6+ messages in thread
From: Padmavathi Venna @ 2014-11-20  9:49 UTC (permalink / raw)
  To: linux-arm-kernel

Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 sound/soc/samsung/i2s.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 0df6547..e1ace52 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -494,7 +494,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
 		if (dir == SND_SOC_CLOCK_IN)
 			mod |= 1 << i2s_regs->cdclkcon_off;
 		else
-			mod &= 0 << i2s_regs->cdclkcon_off;
+			mod &= ~(1 << i2s_regs->cdclkcon_off);
 
 		i2s->rfs = rfs;
 		break;
@@ -551,10 +551,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
 		}
 
 		if (clk_id == 0)
-			mod &= 0 << i2s_regs->rclksrc_off;
+			mod &= ~(1 << i2s_regs->rclksrc_off);
 		else
 			mod |= 1 << i2s_regs->rclksrc_off;
 
+		break;
 	default:
 		dev_err(&i2s->pdev->dev, "We don't serve that!\n");
 		return -EINVAL;
-- 
1.7.4.4

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

* Re: [alsa-devel] [PATCH] ASoC: samsung: In the i2s_set_sysclk() callback we are currently clearing all bits of the IISMOD register in i2s_set_sysclk. It's due to an incorrect mask used for the AND operation which is introduced in commit a5a56871f804edac93a53b5e871c0e9818fb9033 (ASoC: samsung: add support for exynos7 I2S controller) and also adds the missing break statement.
  2014-11-20  9:49 ` Padmavathi Venna
@ 2014-11-20 10:08   ` Padma Venkat
  -1 siblings, 0 replies; 6+ messages in thread
From: Padma Venkat @ 2014-11-20 10:08 UTC (permalink / raw)
  To: Padmavathi Venna
  Cc: linux-arm-kernel, linux-samsung-soc, alsa-devel, sbkim73,
	kgene.kim, broonie, Sylwester Nawrocki

Hi,

On 11/20/14, Padmavathi Venna <padma.v@samsung.com> wrote:
> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
> ---
>  sound/soc/samsung/i2s.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
> index 0df6547..e1ace52 100644
> --- a/sound/soc/samsung/i2s.c
> +++ b/sound/soc/samsung/i2s.c
> @@ -494,7 +494,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
>  		if (dir == SND_SOC_CLOCK_IN)
>  			mod |= 1 << i2s_regs->cdclkcon_off;
>  		else
> -			mod &= 0 << i2s_regs->cdclkcon_off;
> +			mod &= ~(1 << i2s_regs->cdclkcon_off);
>
>  		i2s->rfs = rfs;
>  		break;
> @@ -551,10 +551,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
>  		}
>
>  		if (clk_id == 0)
> -			mod &= 0 << i2s_regs->rclksrc_off;
> +			mod &= ~(1 << i2s_regs->rclksrc_off);
>  		else
>  			mod |= 1 << i2s_regs->rclksrc_off;
>
> +		break;
>  	default:
>  		dev_err(&i2s->pdev->dev, "We don't serve that!\n");
>  		return -EINVAL;
> --
> 1.7.4.4
>

Please ignore this patch as subject line is not proper.

Thanks
Padma
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>

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

* [alsa-devel] [PATCH] ASoC: samsung: In the i2s_set_sysclk() callback we are currently clearing all bits of the IISMOD register in i2s_set_sysclk. It's due to an incorrect mask used for the AND operation which is introduced in commit a5a56871f804edac93a53b5e871c0e9818fb9033 (ASoC: samsung: add support for exynos7 I2S controller) and also adds the missing break statement.
@ 2014-11-20 10:08   ` Padma Venkat
  0 siblings, 0 replies; 6+ messages in thread
From: Padma Venkat @ 2014-11-20 10:08 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 11/20/14, Padmavathi Venna <padma.v@samsung.com> wrote:
> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
> ---
>  sound/soc/samsung/i2s.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
> index 0df6547..e1ace52 100644
> --- a/sound/soc/samsung/i2s.c
> +++ b/sound/soc/samsung/i2s.c
> @@ -494,7 +494,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
>  		if (dir == SND_SOC_CLOCK_IN)
>  			mod |= 1 << i2s_regs->cdclkcon_off;
>  		else
> -			mod &= 0 << i2s_regs->cdclkcon_off;
> +			mod &= ~(1 << i2s_regs->cdclkcon_off);
>
>  		i2s->rfs = rfs;
>  		break;
> @@ -551,10 +551,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
>  		}
>
>  		if (clk_id == 0)
> -			mod &= 0 << i2s_regs->rclksrc_off;
> +			mod &= ~(1 << i2s_regs->rclksrc_off);
>  		else
>  			mod |= 1 << i2s_regs->rclksrc_off;
>
> +		break;
>  	default:
>  		dev_err(&i2s->pdev->dev, "We don't serve that!\n");
>  		return -EINVAL;
> --
> 1.7.4.4
>

Please ignore this patch as subject line is not proper.

Thanks
Padma
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>

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

* usb: offset in trigger_tstamp?
  2014-11-20 10:08   ` Padma Venkat
  (?)
@ 2014-11-20 16:56   ` Pierre-Louis Bossart
  2014-11-21 13:28     ` Clemens Ladisch
  -1 siblings, 1 reply; 6+ messages in thread
From: Pierre-Louis Bossart @ 2014-11-20 16:56 UTC (permalink / raw)
  To: alsa-devel

I was trying to find a bug in the timestamping logic I am working on and after some time I realized the USB audio class driver seems to have an issue.
If I instrument the code in sound/usb/pcm.c, I see a offset of up to 6ms between the  snd_usb_substream_playback_trigger and prepare_playback_urb steps

[45053.102625] trigger_start  
[45053.108320] prepare_playback_urb

My understanding is that empty URBs are submitted in the prepare step to avoid underflows, which is fine. The problem with that is that the trigger_tstamp value is captured before audio transfers actually start and there is a constant offset when trying to track audio/system time drifts or do basic a/v sync.

Any suggestions on how to fix this? I can't figure out if this is an off-by-one error or another bug.
Feedback welcome.
-Pierre

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

* Re: usb: offset in trigger_tstamp?
  2014-11-20 16:56   ` usb: offset in trigger_tstamp? Pierre-Louis Bossart
@ 2014-11-21 13:28     ` Clemens Ladisch
  0 siblings, 0 replies; 6+ messages in thread
From: Clemens Ladisch @ 2014-11-21 13:28 UTC (permalink / raw)
  To: Pierre-Louis Bossart, alsa-devel

Pierre-Louis Bossart wrote:
> I was trying to find a bug in the timestamping logic I am working on
> and after some time I realized the USB audio class driver seems to
> have an issue.
> If I instrument the code in sound/usb/pcm.c, I see a offset of up to
> 6ms between the  snd_usb_substream_playback_trigger and
> prepare_playback_urb steps
>
> [45053.102625] trigger_start
> [45053.108320] prepare_playback_urb
>
> My understanding is that empty URBs are submitted in the prepare step
> to avoid underflows, which is fine. The problem with that is that the
> trigger_tstamp value is captured before audio transfers actually start
> and there is a constant offset when trying to track audio/system time
> drifts or do basic a/v sync.

Most other devices have a FIFO that gets filled quickly when the stream
is started.  This results in a small offset in the opposite direction.

AFAICS you cannot avoid having an offset when trying to relate the
trigger_tstamp value to the sample clock.


Regards,
Clemens

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

end of thread, other threads:[~2014-11-21 13:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-20  9:49 [PATCH] ASoC: samsung: In the i2s_set_sysclk() callback we are currently clearing all bits of the IISMOD register in i2s_set_sysclk. It's due to an incorrect mask used for the AND operation which is introduced in commit a5a56871f804edac93a53b5e871c0e9818fb9033 (ASoC: samsung: add support for exynos7 I2S controller) and also adds the missing break statement Padmavathi Venna
2014-11-20  9:49 ` Padmavathi Venna
2014-11-20 10:08 ` [alsa-devel] " Padma Venkat
2014-11-20 10:08   ` Padma Venkat
2014-11-20 16:56   ` usb: offset in trigger_tstamp? Pierre-Louis Bossart
2014-11-21 13:28     ` Clemens Ladisch

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.