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]
Date:   Thu, 11 Jan 2018 16:14:31 +0000
From:   "Fischer, Christian" <fischerc@...ssphone.de>
To:     Mark Brown <broonie@...nel.org>
CC:     "alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
        "lgirdwood@...il.com" <lgirdwood@...il.com>,
        "perex@...ex.cz" <perex@...ex.cz>,
        "tiwai@...e.com" <tiwai@...e.com>,
        "richard.leitner@...data.com" <richard.leitner@...data.com>,
        "fabio.estevam@....com" <fabio.estevam@....com>,
        "bhumirks@...il.com" <bhumirks@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: AW: [PATCH] ASoC: sgtl5000: fix powerup/down of micbias-voltage

Hi Mark,

Unfortunately, this was not the case with my tests.
The supply is switched off at the start of the driver, but when starting a recording not started.
The function "mic_bias_event" only consumes SND_SOC_DAPM_POST_PMU (0x02) and SND_SOC_DAPM_PRE_PMD (0x04).

I changed:
> SND_SOC_DAPM_SUPPLY("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0, 
> mic_bias_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
to:
> SND_SOC_DAPM_SUPPLY("Mic Bias", SGTL5000_CHIP_MIC_CTRL, 8, 0, 
> mic_bias_event, 0xFF),
To receive all events.

And added this to "mic_bias_event":
> dev_info(codec->dev, "mic_bias_event event: %d\n", event);

At probing I got this:
sgtl5000 1-000a: mic_bias_event event: 128
sgtl5000 1-000a: mic_bias_event event: 4 --> /* before widget power down, this disables the mic-bias-resistor */
sgtl5000 1-000a: mic_bias_event event: 8 --> /* after widget power down */

Testing:
arecord -D "hw:0,1" -c 2 -f S16_LE -t wav test_recording.wav
Recording WAVE 'test_recording.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo
==> no event was fired

With my patch included, at probing:
sgtl5000 1-000a: mic_bias_event event: 128
sgtl5000 1-000a: mic_bias_event event: 4 --> /* before widget power down, this disables the mic-bias-resistor */
sgtl5000 1-000a: mic_bias_event event: 8 --> /* after widget power down */

Testing:
arecord -D "hw:0,1" -c 2 -f S16_LE -t wav test_recording.wav
Recording WAVE 'test_recording.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo
[   82.341376] sgtl5000 1-000a: mic_bias_event event: 1 --> /* before widget power up */
[   82.762701] sgtl5000 1-000a: mic_bias_event event: 2  --> /* after widget power up, this enables the supply */
^CAborted by signal Interrupt...
[   90.362685] sgtl5000 1-000a: mic_bias_event event: 4 --> /* before widget power down, this disables the mic-bias-resistor */
[   90.369561] sgtl5000 1-000a: mic_bias_event event: 8 --> /* after widget power down */
==> events are working

The disadvantage is that this is also done when playing audio:
aplay -D "hw:0,0" -c 2 -f S16_LE -t wav test_recording.wav
sgtl5000 1-000a: mic_bias_event event: 1
sgtl5000 1-000a: mic_bias_event event: 2
Playing WAVE 'test_recording.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo
sgtl5000 1-000a: mic_bias_event event: 4
sgtl5000 1-000a: mic_bias_event event: 8

I'm not so into ALSA, maybe there is another way to set the event properly.

Kind regards,
Christian

-----Ursprüngliche Nachricht-----
Von: Mark Brown [mailto:broonie@...nel.org] 
Gesendet: Donnerstag, 11. Januar 2018 16:07
An: Fischer, Christian <fischerc@...ssphone.de>
Cc: alsa-devel@...a-project.org; lgirdwood@...il.com; perex@...ex.cz; tiwai@...e.com; richard.leitner@...data.com; fabio.estevam@....com; bhumirks@...il.com; linux-kernel@...r.kernel.org
Betreff: Re: [PATCH] ASoC: sgtl5000: fix powerup/down of micbias-voltage

On Thu, Jan 11, 2018 at 09:40:31AM +0100, fischerc@...ssphone.de wrote:

> The mic-bias-voltage should get powered up/down automatically.
> Added missing DAPM_PRE and DAPM_POST widgets to fire up the mic_bias_event function.

> +	SND_SOC_DAPM_PRE("MIC_BIAS_PRE", mic_bias_event),
> +	SND_SOC_DAPM_POST("MIC_BIAS_POST", mic_bias_event),

I don't understand what this is intended to do.  The mic_bias_event() callback is already hooked up to the Mic Bias supply widget, it should be invoked whenever the bias is turned on and off already?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ