Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: Re: [PATCH 3/6] ASoC: Intel: Add Haswell and Broadwell PCM platform driver
Date: Fri, 21 Feb 2014 14:16:03 +0900	[thread overview]
Message-ID: <20140221051603.GC25940@sirena.org.uk> (raw)
In-Reply-To: <1392932927-9725-3-git-send-email-liam.r.girdwood@linux.intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 1908 bytes --]

On Thu, Feb 20, 2014 at 09:48:44PM +0000, Liam Girdwood wrote:

Applied, thanks.  Again a few comments below.

> +/* simple volume table */
> +static const u32 volume_map[] = {
> +	HSW_VOLUME_MAX >> 30,

Interesting one here.  On the one hand we always say to present the
hardware features as directly as possible to the application layer.  On
the other hand I'd not be surprised if some userspaces failed to deal
constructively with a full 31 bits of linearly mapped volume control
(but I'm not sure how common they are and really they ought to be
fixed).  Anyway, not a problem more just a comment.

> +	if (!pcm_data->stream) {
> +		pcm_data->volume[0] =
> +			hsw_mixer_to_ipc(ucontrol->value.integer.value[0]);
> +		pcm_data->volume[1] =
> +			hsw_mixer_to_ipc(ucontrol->value.integer.value[1]);
> +		mutex_unlock(&pcm_data->mutex);
> +		return 0;
> +	}

It looks like we only record the volume when the stream is idle.  What
happens if the user changes the volume while it's idle, starts playing,
changes again then stops playing?  It's possible I missed the bit where
it gets saved but I did look.

> +	if (!pcm_data->stream) {
> +		ucontrol->value.integer.value[0] =
> +			hsw_ipc_to_mixer(pcm_data->volume[0]);
> +		ucontrol->value.integer.value[1] =
> +			hsw_ipc_to_mixer(pcm_data->volume[1]);
> +		mutex_unlock(&pcm_data->mutex);
> +		return 0;
> +	}
> +
> +	sst_hsw_stream_get_volume(hsw, pcm_data->stream, 0, 0, &volume);
> +	ucontrol->value.integer.value[0] = hsw_ipc_to_mixer(volume);
> +	sst_hsw_stream_get_volume(hsw, pcm_data->stream, 0, 1, &volume);
> +	ucontrol->value.integer.value[1] = hsw_ipc_to_mixer(volume);
> +	mutex_unlock(&pcm_data->mutex);

Can the DSP adjust its own volume autonomously?

> +static int create_adsp_page_table(struct hsw_priv_data *pdata,
> +	struct snd_soc_pcm_runtime *rtd,
> +	unsigned char *dma_area, size_t size, int pcm, int stream)

No helper for this?

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2014-02-21  5:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20 21:48 [PATCH 1/6] ASoC: Intel: Add support for Haswell/Broadwell DSP Liam Girdwood
2014-02-20 21:48 ` [PATCH 2/6] ASoC: Intel: Add Haswell/Broadwell IPC Liam Girdwood
2014-02-21  5:03   ` Mark Brown
2014-02-20 21:48 ` [PATCH 3/6] ASoC: Intel: Add Haswell and Broadwell PCM platform driver Liam Girdwood
2014-02-21  5:16   ` Mark Brown [this message]
2014-02-21  7:11     ` Takashi Iwai
2014-02-23  3:19       ` Mark Brown
2014-02-24 20:00         ` Liam Girdwood
2014-02-21  7:28   ` Takashi Iwai
2014-02-24 20:07     ` Liam Girdwood
2014-02-20 21:48 ` [PATCH 4/6] ASoC: Intel: Add trace support for Haswell/Broadwell SST IPC messages Liam Girdwood
2014-02-21  5:19   ` Mark Brown
2014-02-24 19:50     ` Liam Girdwood
2014-02-20 21:48 ` [PATCH 5/6] ASoC: Intel: Add build support for Haswell ADSP Liam Girdwood
2014-02-21  5:19   ` Mark Brown
2014-02-20 21:48 ` [PATCH 6/6] ASoC: Intel: Add Haswell Machine support Liam Girdwood
2014-02-21  5:22   ` Mark Brown
2014-02-24 19:55     ` Liam Girdwood
2014-02-21  5:01 ` [PATCH 1/6] ASoC: Intel: Add support for Haswell/Broadwell DSP Mark Brown
2014-02-21 13:05   ` Jarkko Nikula
2014-02-24 20:09     ` Liam Girdwood
2014-02-24 19:47   ` 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=20140221051603.GC25940@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=tiwai@suse.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