Skip to contentSkip to conversation

ASoC: wm_adsp: Change ADSPs to be mixer widgets rather the PGAs

RFC PATCH In review Charles Keepax 2 participants 7 messages Dec 18, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 ASoC: wm_adsp: Change ADSPs to be mixer widgets rather the PGAs

PGAs often control the output from a chip and if the DSP is also marked as a PGA it may be powered up after the output has been enabled. This patch changes the ADSP2 cores to be marked as snd_soc_dapm_mixer widgets so they are powered up before any PGAs.

---

Hi,

Was also considering if it would be worth adding an additional snd_soc_dapm_dsp id? That could sit between mixers and pgas, but I can't really see any obvious issue with treating the DSP as a mixer and it is a much simpler change. Although I am open to writing the other change if it is preferred?

Thanks,
Charles

 sound/soc/codecs/wm_adsp.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/codecs/wm_adsp.h +1 -1
index d018dea..795a3b2 100644
@@ -66,7 +66,7 @@ struct wm_adsp {
 		wm_adsp1_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD)
 
 #define WM_ADSP2(wname, num) \
-	SND_SOC_DAPM_PGA_E(wname, SND_SOC_NOPM, num, 0, NULL, 0, \
+	SND_SOC_DAPM_MIXER_E(wname, SND_SOC_NOPM, num, 0, NULL, 0, \
 		wm_adsp2_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD)
 
 extern const struct snd_kcontrol_new wm_adsp1_fw_controls[];
Signature · 1 line
1.7.2.5
maintainer
#1 lore raw
Quoted 6 lines · Charles Keepax

Was also considering if it would be worth adding an additional snd_soc_dapm_dsp id? That could sit between mixers and pgas, but I can't really see any obvious issue with treating the DSP as a mixer and it is a much simpler change. Although I am open to writing the other change if it is preferred?

One of the issues here was trying to ensure that the DSP started up with its inputs stable so noise from them starting didn't propagage into the algorithm and confuse it. The expecation with putting it as a PGA was that it would start with the outputs mute and do a digital unmute to bring them up. Since everything is digital this should all be more robust than it would be for analogue.

If anything I'd have a specific DSP widget type which is one of the last things to start.

#2 lore raw
Quoted 9 lines · Mark Brown
Quoted 6 lines · Charles Keepax

Was also considering if it would be worth adding an additional snd_soc_dapm_dsp id? That could sit between mixers and pgas, but I can't really see any obvious issue with treating the DSP as a mixer and it is a much simpler change. Although I am open to writing the other change if it is preferred?

Quoted 6 lines

One of the issues here was trying to ensure that the DSP started up with its inputs stable so noise from them starting didn't propagage into the algorithm and confuse it. The expecation with putting it as a PGA was that it would start with the outputs mute and do a digital unmute to bring them up. Since everything is digital this should all be more robust than it would be for analogue.

Muting the output is a little tricky though as a graph walk will be required to determine which output was connected, unless you have any handy ideas I have not spotted? I will start having a look to see what could be done on the muting front.

Thanks,
Charles

maintainer
#3 lore raw
Quoted 9 lines · Charles Keepax
Quoted 6 lines · Mark Brown

One of the issues here was trying to ensure that the DSP started up with its inputs stable so noise from them starting didn't propagage into the algorithm and confuse it. The expecation with putting it as a PGA was that it would start with the outputs mute and do a digital unmute to bring them up. Since everything is digital this should all be more robust than it would be for analogue.

Quoted 4 lines

Muting the output is a little tricky though as a graph walk will be required to determine which output was connected, unless you have any handy ideas I have not spotted? I will start having a look to see what could be done on the muting front.

Not the physical output, the DSP output into the rest of the device. It would be very surprising if it powered up making noise.

#4 lore raw
Quoted 8 lines · Mark Brown
Quoted 4 lines · Charles Keepax

Muting the output is a little tricky though as a graph walk will be required to determine which output was connected, unless you have any handy ideas I have not spotted? I will start having a look to see what could be done on the muting front.

Not the physical output, the DSP output into the rest of the device. It would be very surprising if it powered up making noise.

Regrettably, I don't believe there is a way to mute the output of the DSP. Muting the physical output does fix the issue. I could look at seperating out the physical power up of the core and starting the firmware to be seperate widgets, that might also fix the issue and would mean the firmware wouldn't run until the input signal was clean, but I am not sure if feels that neat a solution.

Thanks,
Charles

maintainer
#5 lore raw
Quoted 7 lines · Charles Keepax
Quoted 2 lines · Mark Brown

Not the physical output, the DSP output into the rest of the device. It would be very surprising if it powered up making noise.

Regrettably, I don't believe there is a way to mute the output of the DSP. Muting the physical output does fix the issue. I could

So the DSP powers up outputing stuff? That seems like an interesting design decision (it might need something to reset the buffers on power down I guess).

Quoted 5 lines

look at seperating out the physical power up of the core and starting the firmware to be seperate widgets, that might also fix the issue and would mean the firmware wouldn't run until the input signal was clean, but I am not sure if feels that neat a solution.

That sort of split is something I'd considered doing in the past anyway
- it would be beneficial to be able to overlap the DSP startup with other activities so the delays while bringing up the outputs could be happening while the DSPs are downloading firmware or the firmware is starting up for example. You could also overlap stuff with the RAM startup if that's now taking longer.

#6 lore raw
Quoted 6 lines · Mark Brown
Quoted 4 lines · Charles Keepax
Quoted 2 lines · Mark Brown

Not the physical output, the DSP output into the rest of the device. It would be very surprising if it powered up making noise.

Quoted 6 lines
Quoted 2 lines

Regrettably, I don't believe there is a way to mute the output of the DSP. Muting the physical output does fix the issue. I could

So the DSP powers up outputing stuff? That seems like an interesting design decision (it might need something to reset the buffers on power down I guess).

It is not sure it is so much a design decision but there is an audible pop when the DSP core enable bit is set if it is connected to an unmuted output.

Quoted 7 lines
Quoted 6 lines

look at seperating out the physical power up of the core and starting the firmware to be seperate widgets, that might also fix the issue and would mean the firmware wouldn't run until the input signal was clean, but I am not sure if feels that neat a solution.

Quoted 6 lines

That sort of split is something I'd considered doing in the past anyway
- it would be beneficial to be able to overlap the DSP startup with other activities so the delays while bringing up the outputs could be happening while the DSPs are downloading firmware or the firmware is starting up for example. You could also overlap stuff with the RAM startup if that's now taking longer.

Ok this looks like a potentially viable solution, and I hadn't considered the potential benefits it could have to speed up the audio path bring up time, I shall have a bash at implementing it and see where I get to.

Thanks,
Charles