lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1489578203.15165.46.camel@nxp.com>
Date:   Wed, 15 Mar 2017 11:43:24 +0000
From:   Daniel Baluta <daniel.baluta@....com>
To:     "ckeepax@...nsource.wolfsonmicro.com" 
        <ckeepax@...nsource.wolfsonmicro.com>,
        "broonie@...nel.org" <broonie@...nel.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "shengjiu.wang@...escale.com" <shengjiu.wang@...escale.com>,
        "patches@...nsource.wolfsonmicro.com" 
        <patches@...nsource.wolfsonmicro.com>,
        "tiwai@...e.com" <tiwai@...e.com>,
        "lgirdwood@...il.com" <lgirdwood@...il.com>,
        Viorel Suman <viorel.suman@....com>,
        Mihai Serban <mihai.serban@....com>,
        "alsa-devel@...a-project.org" <alsa-devel@...a-project.org>
Subject: Re: [RFC PATCH] ASoC: wm8960: Use physical width for bclk

On Mi, 2017-03-15 at 09:19 +0000, Charles Keepax wrote:
> On Tue, Mar 14, 2017 at 06:57:02PM +0200, Daniel Baluta wrote:
> > 
> > bclk is derived from sysclk with the help of bclk_divs. Anyhow, for
> > S20_3LE format there is no bclk_divs that could be used to derive
> > an exact bclk.
> > 
> > We can fix this by using storage size instead the exact
> > number of bits of the sample when computing bclk.
> > 
> > With this approach we can play S20_3LE encoded files at the cost of
> > some unused BCLK cycles for S20_3LE and S24_LE.
> > 
> > Signed-off-by: Daniel Baluta <daniel.baluta@....com>
> > ---
> >  sound/soc/codecs/wm8960.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
> > index e1429e3..18ca5fc 100644
> > --- a/sound/soc/codecs/wm8960.c
> > +++ b/sound/soc/codecs/wm8960.c
> > @@ -722,7 +722,8 @@ static int wm8960_hw_params(struct
> > snd_pcm_substream *substream,
> >  	bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
> >  	int i;
> >  
> > -	wm8960->bclk = snd_soc_params_to_bclk(params);
> > +	wm8960->bclk = params_physical_width(params) *
> > +		params_channels(params) * params_rate(params);
> >  	if (params_channels(params) == 1)
> >  		wm8960->bclk *= 2;
> Would quite like to see Mark's thoughts on this. Feels a bit to
> me (although I am not certain) like we are solving the problem in
> the wrong place, isn't this really setting the desired BCLK and
> then in wm8960_configure_clocking we should set the lowest BCLK
> we can that is greater than or equal to the desired.

Is there any standard way of doing this in ASoC? Couldn't find any
example where the bitclk is relaxed to lowest value greater than the
desired one.

I have prepared some patches with this approach, you can look at them
here:

http://pastebin.com/0xW0E82N - some refactoring of sysclk search
http://pastebin.com/QRt1UT7Q - relax bitclk value

Daniel.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ