All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Daniel Mack <zonque@gmail.com>
Cc: alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Sven Neumann <s.neumann@raumfeld.com>, Liam Girdwood <lrg@ti.com>,
	Haojian Zhuang <haojian.zhuang@marvell.com>
Subject: Re: Swapped channels issue on pxa-ssp based platforms
Date: Mon, 07 Nov 2011 21:19:07 +0100	[thread overview]
Message-ID: <4EB83D3B.2050906@ladisch.de> (raw)
In-Reply-To: <4EB817FC.4000905@gmail.com>

Daniel Mack wrote:
> we're hunting a weird bug on PXA3xx/ssp based audio devices which causes
> the playback channels to be swapped when the capture stream is started
> at the same time. Content for the left channel appears on the right and
> vice versa, in approximately 50% of all test runs

IIRC there was some other CPU where it was tried to program a generic
serial output to handle I²S data.  The same symptoms appeared because
it was not possible to synchronize the start of the L/R signal to the
start of the DMA.

Apparently, the starting of the capture stream affects the L/R
synchronization of the playback stream.

Does starting playback first work?

> I guess this is some sort of a race condition in the stream startup,
> and suspected sound/soc/pxa/pxa-ssp.c to lack some locking, so I added
> a spinlock around all register read-modify-write cycles. But that doesn't
> seem to be the reason.

I'd guess this is a race in the programming of the L/R clock signals;
try putting a lock/mutex about all the stream initialization code, and
maybe adding some delay.


Regards,
Clemens

  reply	other threads:[~2011-11-07 20:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07 17:40 Swapped channels issue on pxa-ssp based platforms Daniel Mack
2011-11-07 20:19 ` Clemens Ladisch [this message]
2011-11-08 11:39   ` Mark Brown
2011-11-08 11:46     ` Daniel Mack
2011-11-08 12:27       ` Mark Brown
2011-11-08 12:38         ` Daniel Mack
2011-11-08  2:54 ` Haojian Zhuang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EB83D3B.2050906@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=haojian.zhuang@marvell.com \
    --cc=lrg@ti.com \
    --cc=s.neumann@raumfeld.com \
    --cc=zonque@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.