* ALSA - Channel swap
@ 2014-08-19 13:37 Tomas Matejka
2014-08-19 16:13 ` Daniel Mack
0 siblings, 1 reply; 5+ messages in thread
From: Tomas Matejka @ 2014-08-19 13:37 UTC (permalink / raw)
To: alsa-devel
Good afternoon,
i have a problem:
I use sound codec CS4202, which I control with AT91SAM9263.
I'm using ALSA sound library. When i use CAPTURE mode, sometimes it
swaps left and right channel.
I have found this discussions on Internet, where is described similar
problem:
http://pl.it-usenet.org/thread/17996/3593/
http://sinustrom.info/2013/03/21/atmel-soc-ssc-channel-swapping/
I have figured out, that the problem could be in driver or in ALSA
library. Have you any solution ? Did you encountered similar problem ?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ALSA - Channel swap
2014-08-19 13:37 ALSA - Channel swap Tomas Matejka
@ 2014-08-19 16:13 ` Daniel Mack
2014-08-20 12:37 ` Tomas Matejka
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Mack @ 2014-08-19 16:13 UTC (permalink / raw)
To: Tomas Matejka, alsa-devel
On 08/19/2014 03:37 PM, Tomas Matejka wrote:
> Good afternoon,
> i have a problem:
> I use sound codec CS4202, which I control with AT91SAM9263.
> I'm using ALSA sound library. When i use CAPTURE mode, sometimes it
> swaps left and right channel.
> I have found this discussions on Internet, where is described similar
> problem:
>
> http://pl.it-usenet.org/thread/17996/3593/
> http://sinustrom.info/2013/03/21/atmel-soc-ssc-channel-swapping/
>
> I have figured out, that the problem could be in driver or in ALSA
> library. Have you any solution ? Did you encountered similar problem ?
When the mismatch happens, you'll certainly have wrong data on the I2S
bus, so that bug cannot be caused by the codec driver.
The most likely reason is that the platform's (AT91SAM9263) ASoC
implementation has a problem syncing up the playback and record streams,
probably in its DMA bits. I'd start searching in that area.
I personally never worked with this platform, but for anyone else to
help you, you should provide more information, such as the kernel
version you're working with.
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ALSA - Channel swap
2014-08-19 16:13 ` Daniel Mack
@ 2014-08-20 12:37 ` Tomas Matejka
2014-08-20 12:41 ` Daniel Mack
2014-08-20 13:00 ` Daniel Mack
0 siblings, 2 replies; 5+ messages in thread
From: Tomas Matejka @ 2014-08-20 12:37 UTC (permalink / raw)
To: Daniel Mack, alsa-devel
My kernel version is 3.2.18.
I can't uderstand this, does this mean that using Atmel, Linux and audio
codec always result to channel swapping?
It would be very strange. How could codec manufacturer sell codec, which
swaps channels ?
I need this for application that requires that audio channels can't be
randomly swapped.
Dne 19.8.2014 18:13, Daniel Mack napsal(a):
> On 08/19/2014 03:37 PM, Tomas Matejka wrote:
>> Good afternoon,
>> i have a problem:
>> I use sound codec CS4202, which I control with AT91SAM9263.
>> I'm using ALSA sound library. When i use CAPTURE mode, sometimes it
>> swaps left and right channel.
>> I have found this discussions on Internet, where is described similar
>> problem:
>>
>> http://pl.it-usenet.org/thread/17996/3593/
>> http://sinustrom.info/2013/03/21/atmel-soc-ssc-channel-swapping/
>>
>> I have figured out, that the problem could be in driver or in ALSA
>> library. Have you any solution ? Did you encountered similar problem ?
> When the mismatch happens, you'll certainly have wrong data on the I2S
> bus, so that bug cannot be caused by the codec driver.
>
> The most likely reason is that the platform's (AT91SAM9263) ASoC
> implementation has a problem syncing up the playback and record streams,
> probably in its DMA bits. I'd start searching in that area.
>
> I personally never worked with this platform, but for anyone else to
> help you, you should provide more information, such as the kernel
> version you're working with.
>
>
> Daniel
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ALSA - Channel swap
2014-08-20 12:37 ` Tomas Matejka
@ 2014-08-20 12:41 ` Daniel Mack
2014-08-20 13:00 ` Daniel Mack
1 sibling, 0 replies; 5+ messages in thread
From: Daniel Mack @ 2014-08-20 12:41 UTC (permalink / raw)
To: Tomas Matejka, alsa-devel
Hi,
On 08/20/2014 02:37 PM, Tomas Matejka wrote:
> My kernel version is 3.2.18.
> I can't uderstand this, does this mean that using Atmel, Linux and audio
> codec always result to channel swapping?
> It would be very strange. How could codec manufacturer sell codec, which
> swaps channels ?
> I need this for application that requires that audio channels can't be
> randomly swapped.
It's probably only a race condition that can be fixed in software. I've
seen such issues before.
But in order to work on this and get more feedback, you have to try a
more recent kernel (3.16 or 3.17-rc1). Maybe the issue is even already
fixed.
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ALSA - Channel swap
2014-08-20 12:37 ` Tomas Matejka
2014-08-20 12:41 ` Daniel Mack
@ 2014-08-20 13:00 ` Daniel Mack
1 sibling, 0 replies; 5+ messages in thread
From: Daniel Mack @ 2014-08-20 13:00 UTC (permalink / raw)
To: Tomas Matejka; +Cc: alsa-devel
On 08/20/2014 02:37 PM, Tomas Matejka wrote:
> My kernel version is 3.2.18.
> I can't uderstand this, does this mean that using Atmel, Linux and audio
> codec always result to channel swapping?
> It would be very strange. How could codec manufacturer sell codec, which
> swaps channels ?
Also, as I've told you before, the Codec is most probably not the
cultprit here. Try and play a wave file that only has signal on the left
side, and provide some input to the Codec's left channel only. Then see
what your scope shows on the SDIN/SDOUT lines, while putting the trigger
on the LRCLK. If your Codec is causing the problem, you'll already see
the channel swap on the bus, but I bet you won't. Instead, the problem
is in how the Atmel I2S hardware block transports the data into and out
of your memory, and that's likely related to its DMA implementation.
Anyway - the first step is to boot an up-to-date kernel.
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-08-20 13:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-19 13:37 ALSA - Channel swap Tomas Matejka
2014-08-19 16:13 ` Daniel Mack
2014-08-20 12:37 ` Tomas Matejka
2014-08-20 12:41 ` Daniel Mack
2014-08-20 13:00 ` Daniel Mack
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).