mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: Bo Shen <voice.shen@atmel.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.de>,
	"'alsa-devel@alsa-project.org'" <alsa-devel@alsa-project.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [alsa-devel] [PATCH] ASoC: atmel_ssc_dai: Track playback and capture CMR dividers separately.
Date: Tue, 21 Oct 2014 11:02:57 +0000	[thread overview]
Message-ID: <75c3727e997844dd90e68dae4b00282b@EMAIL.axentia.se> (raw)
In-Reply-To: <544620C8.4040001@atmel.com>

Hi again!

> Hi Peter,
> 
> On 10/21/2014 03:55 PM, Peter Rosin wrote:
> > Hi!
> >
> > (and thank you for the pointer to the example with the ssc-dai in
> > master mode)
> >
> >> Hi Peter,
> >>
> >> On 10/20/2014 09:45 PM, Peter Rosin wrote:
> >>>   From 1e5621d7b9887c648d1a66238dc82d715c1e2cad Mon Sep 17
> 00:00:00
> >>> 2001
> >>> From: Peter Rosin <peda@axentia.se>
> >>> Date: Mon, 20 Oct 2014 14:38:04 +0200
> >>> Subject: [PATCH] ASoC: atmel_ssc_dai: Track playback and capture CMR
> >> dividers
> >>>    separately.
> >>>
> >>> The CMR divider register is shared by playback and capture. The SSC
> >>> driver therefore tries to enforce rules so that the needed register
> >>> content do not conflict during simultaneous playback/capture.
> >>> However, the implementation also prevents changing the register
> >>> content in a half-duplex scenario, which is needed when changing
> sample rates.
> >>
> >> I am not fully get what you mean here, do you mean:
> >>     - when playback, first playback 48kHz, and then playback 8Khz,
> >> the 8Khz still playback in 48kHz mode?
> >>
> >> or other things?
> >
> > I do not know exactly why the problem occurs, but it might be
> > connected to the library (proprietary) we are using. It apparently
> > uses the OSS interface and somehow it opens a stream and changes the
> > playback sample-rate a couple of time before it settles on something.
> > I don't know why this is done, and I have no control over it. The end
> > result is that without this patch, the ssc-dai driver returns -EBUSY
> > when the library changes the playback sample-rate (the driver returns
> > -EBUSY because it thinks that the new sample rate does not match a
> > previously given capture sample-rate, but that is of course bogus when no
> capture is going on at all).
> 
> If this issue is caused by your proprietary library, please fix in the library.

Ah, but it's not "our" proprietary library to fix, it's simply a library that we
are using (speech synthesis, not our area of expertise). So, I'm not in a
position to simply fix it, as I have no source code.

> I don't know how this code can fix your issue and also there is no
> improvement to the code and it absolutely increase work (choose which
> clock to configure: tcmr or rcmr) for the SSC work in master. And also this
> patch may confuse the end user, let them thinking the clock for tcmr and
> rcmr can configure seperately.

I added some traces to our hw_params and got the following (without the patch):

[  161.170000] atmel ssc startup
[  161.170000]  TFA9879: axentia_asoc_tfa9879_hw_params - mclk rate 66000000
[  161.180000]  TFA9879: axentia_asoc_tfa9879_hw_params - bclk rate 128000
[  161.180000]  TFA9879: axentia_asoc_tfa9879_hw_params - bclk divider 128
[  161.190000]  TFA9879: axentia_asoc_tfa9879_hw_params - period 7
[  161.200000]  TFA9879: axentia_asoc_tfa9879_hw_params - mclk rate 66000000
[  161.200000]  TFA9879: axentia_asoc_tfa9879_hw_params - bclk rate 128000
[  161.210000]  TFA9879: axentia_asoc_tfa9879_hw_params - bclk divider 128
[  161.220000]  TFA9879: axentia_asoc_tfa9879_hw_params - period 7
[  161.230000]  TFA9879: axentia_asoc_tfa9879_hw_params - mclk rate 66000000
[  161.230000]  TFA9879: axentia_asoc_tfa9879_hw_params - bclk rate 256000
[  161.240000]  TFA9879: axentia_asoc_tfa9879_hw_params - bclk divider 64
[  161.250000]  TFA9879: axentia_asoc_tfa9879_hw_params - Failed to set cpu dai clk divider
[  161.260000] axentia-tfa9879-audio sound.9: ASoC: machine hw_params failed: -16

> So, I think keep the code as is (without this patch applied), what's your
> opinion?

In that case we'll simply carry the patch ourselves. I don't know why the above
happens, or if it is caused by bad behavior in the library, or what. But I do know
that the library is unusable for us without some action.

I thought it was an improvement, and therefore sent the patch...

Cheers,
Peter

  reply	other threads:[~2014-10-21 11:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-20 13:45 Peter Rosin
2014-10-21  1:54 ` [alsa-devel] " Bo Shen
2014-10-21  7:55   ` Peter Rosin
2014-10-21  9:00     ` Bo Shen
2014-10-21 11:02       ` Peter Rosin [this message]
2014-10-21 13:05       ` Peter Rosin
2014-10-22  1:27         ` Bo Shen
2014-10-22  4:47           ` Peter Rosin
2014-10-22  8:09             ` Bo Shen
2014-10-22  8:33               ` Peter Rosin
2014-10-22  9:23                 ` Bo Shen
2014-10-22 11:42                   ` Peter Rosin

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=75c3727e997844dd90e68dae4b00282b@EMAIL.axentia.se \
    --to=peda@axentia.se \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    --cc=voice.shen@atmel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®