alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Does amixer has to be used to make a complete path in ASoC?
@ 2011-05-23  0:41 Feng Ye
  2011-05-23  1:01 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Feng Ye @ 2011-05-23  0:41 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org; +Cc: Mark Brown

Hello,

I wrote ASoC driver with interacts with WM8750 codec chip.  It does not work, no sound at all. Some codec registers are not programmed right, and the check_power callback (in soc-dapm.c) always return 0.
I think the problem may not be in the driver, instead, amixer should be used to select the codec mixer settings to build a complete audio path (like the LEFT MIXER in wm8750).
I have following questions:

1.       Is my understanding correct? amixer has to be used before aplay?

2.       Is there way to do it in the code instead of using amixer?

3.       If amixer has to be used, where I can find sample wm8750 amixer setting usage for a simple playback from I2S in to Lout1 & Rout1 out?

Here's the simple code in my driver, just FYI:
static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = {
                SND_SOC_DAPM_SPK("Ext Speaker", NULL),
};
static const struct snd_soc_dapm_route wm8750_audio_map[] = {
                { "Ext Speaker", NULL, "LOUT1" },
                { "Ext Speaker", NULL, "ROUT1" },
};
... (in dai_link init function):
                err = snd_soc_dapm_new_controls(codec, wm8750_dapm_widgets, ARRAY_SIZE(wm8750_dapm_widgets));
...
                snd_soc_dapm_add_routes(codec, wm8750_audio_map, ARRAY_SIZE(wm8750_audio_map));
                snd_soc_dapm_sync(codec);
... (in snd_soc_ops startup function):
                snd_soc_dapm_enable_pin(codec, "Ext Speaker");


Thanks,
Feng

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Does amixer has to be used to make a complete path in ASoC?
  2011-05-23  0:41 Does amixer has to be used to make a complete path in ASoC? Feng Ye
@ 2011-05-23  1:01 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2011-05-23  1:01 UTC (permalink / raw)
  To: Feng Ye; +Cc: alsa-devel@alsa-project.org

On Sun, May 22, 2011 at 05:41:14PM -0700, Feng Ye wrote:

Please fix your mail client to word wrap within paragraphs.  I've
reflowed your mail for legibility.

> I think the problem may not be in the driver, instead, amixer should
> be used to select the codec mixer settings to build a complete audio
> path (like the LEFT MIXER in wm8750).

Yes, exactly.

> I have following questions:

> 1.       Is my understanding correct? amixer has to be used before aplay?

Yes.

> 2.       Is there way to do it in the code instead of using amixer?

No.

> 3.       If amixer has to be used, where I can find sample wm8750
> amixer setting usage for a simple playback from I2S in to Lout1 &
> Rout1 out?

In general you need to look at the DAPM map in the driver and figure out
how to connect whatever your audio source is to an output - most of the
control will be in the CODEC.  Look at the DAPM routes between the
widgets and figure out what to connect - the driver source will have a
routing table like your driver has in the form:

	{ destination, control, source }

so if control is not NULL the control with the specified name needs to
be enabled.  The debugfs files for the DAPM widgets (look under asoc/ in
debugfs) can help here.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-23  1:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-23  0:41 Does amixer has to be used to make a complete path in ASoC? Feng Ye
2011-05-23  1:01 ` Mark Brown

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).