From: Timur Tabi <timur@freescale.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
alsa-devel@alsa-project.org, broonie@opensource.wolfsonmicro.com,
javier.martin@vista-silicon.com,
Sascha Hauer <kernel@pengutronix.de>
Subject: Re: [PATCH 1/2] ASoC: fsl_ssi: Let it understand mono
Date: Wed, 19 Sep 2012 16:49:15 -0500 [thread overview]
Message-ID: <505A3DDB.4060208@freescale.com> (raw)
In-Reply-To: <CAOMZO5D-oHc8hdakFHPHSW_duAZ+dMuM77wUn=K=7jUMwxmg-A@mail.gmail.com>
Fabio Estevam wrote:
> On Tue, Sep 18, 2012 at 1:14 PM, Timur Tabi <timur@freescale.com> wrote:
>> Fabio Estevam wrote:
>>>
>>> Can you please try to play a mono track on your PowerPC platform with these
>>> series applied?
>>
>> I'm pretty sure this won't work. The SSI is programmed to expect a left
>> and right sample. There is no code in fsl_ssi.c for checking the channel
>> count and adjusting the hardware accordingly. I don't see any code like
>> that in imx-ssi.c either, so I don't even know how it's supposed to work.
>
> It works for me on mx6qsabrelite.
I just don't see how that's possible.
> However, in order to play the mono track at the correct rate I also need:
>
> --- a/sound/soc/codecs/sgtl5000.c
> +++ b/sound/soc/codecs/sgtl5000.c
> @@ -938,7 +938,7 @@ static struct snd_soc_dai_driver sgtl5000_dai = {
> .name = "sgtl5000",
> .playback = {
> .stream_name = "Playback",
> - .channels_min = 1,
> + .channels_min = 2,
> .channels_max = 2,
> /*
> * only support 8~48K + 96
That's because the SGTL5000 codec has (apparently) support for mono audio:
/* set mono to save power */
snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, stereo,
channels == 1 ? 0 : stereo);
The problem I have with mono support is that the I2S standard says the
LRCLK is used to distinguish between the left and right channels of a
given sample.
I do not know of any way to get the SSI to treat the left and right
channel as two separate samples.
I can imagine, however, a situation where the SSI is *tricked* into
thinking that it's playing stereo audio when it really isn't. The codec
then treats the left and right channels as two different samples, and
fakes out the clock as well.
I don't know of any codec that does this.
I do know of codecs that support a "left/right fill mode" where it
duplicates the data automatically in the left and right timeslots. But I
don't think any codec that I've used supports this.
> I would like to understand when channels_min should be set to 1 or 2
> in the platform driver (sound/soc/fsl/fsl_ssi.c in this case) or
> inside the codec. Could anyone clarify this, please?
I still have seen no explanation as to how mono audio can work on an I2S
device. The I2S standard calls for a left and right channel in every
sample, and the playback frequency is based on that sample rate.
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2012-09-19 21:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-18 16:03 [PATCH 1/2] ASoC: fsl_ssi: Let it understand mono Fabio Estevam
2012-09-18 16:03 ` [PATCH 2/2] ASoC: cs4270: Remove mono support Fabio Estevam
2012-09-24 13:49 ` Timur Tabi
2012-09-25 12:53 ` Mark Brown
2012-09-25 17:22 ` UAC2 device recognized during boot but won't output sound Joao Bonina
2012-09-18 16:14 ` [PATCH 1/2] ASoC: fsl_ssi: Let it understand mono Timur Tabi
2012-09-19 14:07 ` Fabio Estevam
2012-09-19 21:49 ` Timur Tabi [this message]
2012-09-22 14:56 ` Mark Brown
2012-09-24 13:50 ` Timur Tabi
2012-09-25 12:53 ` Mark Brown
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=505A3DDB.4060208@freescale.com \
--to=timur@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=fabio.estevam@freescale.com \
--cc=festevam@gmail.com \
--cc=javier.martin@vista-silicon.com \
--cc=kernel@pengutronix.de \
/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 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).