All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jhnikula@gmail.com>
To: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: alsa-devel <alsa-devel@alsa-project.org>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Peter Ujfalusi <peter.ujfalusi@nokia.com>,
	Graeme Gregory <gg@slimlogic.co.uk>
Subject: Re: [PATCH] ASoC - Add support for upto 16 channels on OMAP MCBSP
Date: Thu, 5 Nov 2009 09:51:43 +0200	[thread overview]
Message-ID: <20091105095143.995beeea.jhnikula@gmail.com> (raw)
In-Reply-To: <1257364009.2887.665.camel@odin>

On Wed, 04 Nov 2009 19:46:49 +0000
Liam Girdwood <lrg@slimlogic.co.uk> wrote:

> > > +	/* calc best frame size for rate and clock divider */
> > > +	do {
> > > +		frame_size = (mcbsp_data->in_freq / div) / params_rate(params);
> > > +		pr_debug("freq %d, rate %d, frame size %d, div %d\n",
> > > +				mcbsp_data->in_freq, params_rate(params), frame_size, div);
> > > +
> > > +		if (frame_size > 256)
> > > +			div++;
> > > +	} while (frame_size > 256);
> > > +

This would be better if it tries to calculate minimum frame size. Now
the algorithm stops when the frame_size is 256 and leads to higher
bit clock.

E.g. 4 * 16bits * 48 kHz and using 96 MHz internal clock:

Algorithm: div = 8, frame_size = 250 and bit clock = 12 MHz.

Possible dividers and frame_sizes:

25*80 (-> best, bit clock = 3.840 MHz)
20*100
16*125
10*200
8*250

> > This chunk changes the semantics of other devices which I have never tested.
> > 
> > I also dont know how much damage it does if it does to slave mode. In fact
> > I think it might break it in cases which are actually allowable as it uses
> > the omap as its clock constraint and not the clock source.
> > 
> 
IRCC, the CLKGDV doesn't have effect while OMAP is slave but I can test
that with Beagle.

> Btw, this has been reworked to avoid all I2S paths since you last worked
> on it.
> 
Probably that is not necessary if the algorithm above finds a frame
size (½ for dual-phase frames) which doesn't exceed I2S word size?
Uniform code is allways better :-)


-- 
Jarkko
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2009-11-05  7:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-04 17:53 [PATCH] ASoC - Add support for upto 16 channels on OMAP MCBSP Liam Girdwood
2009-11-04 18:28 ` Mark Brown
2009-11-04 18:55 ` Graeme Gregory
2009-11-04 19:46   ` Liam Girdwood
2009-11-05  7:51     ` Jarkko Nikula [this message]
2009-11-05 14:55       ` Liam Girdwood
2009-11-05 19:28         ` Jarkko Nikula
2009-11-05 20:08           ` Liam Girdwood
2009-11-06 13:20             ` Mark Brown
2009-11-06 14:25               ` Liam Girdwood
2009-11-06 15:00                 ` Mark Brown
2009-11-05  8:14   ` Peter Ujfalusi
2009-11-05  8:26 ` Peter Ujfalusi
2009-11-05 10:05   ` Liam Girdwood

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=20091105095143.995beeea.jhnikula@gmail.com \
    --to=jhnikula@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=gg@slimlogic.co.uk \
    --cc=lrg@slimlogic.co.uk \
    --cc=peter.ujfalusi@nokia.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.