Christos Posted October 16, 2017 Share Posted October 16, 2017 Hi, Got OPiPC with legacy and Ubuntu desktop, build 5.33. Gonna attach some external dynamic mic to OPiPC in place of the on-board condenser mic, replacing it. How can we stop the mic bias voltage? Can we do that from Alsa or Pulseaudio? Christos Link to comment Share on other sites More sharing options...
Christos Posted October 17, 2017 Author Share Posted October 17, 2017 Any ideas anyone? Is that so difficult? Link to comment Share on other sites More sharing options...
martinayotte Posted October 17, 2017 Share Posted October 17, 2017 If you have looked at the schematic, the Mic bias voltage is provided by R67, so I presume that just un-solder that R67 should make you happy ... Link to comment Share on other sites More sharing options...
Christos Posted October 17, 2017 Author Share Posted October 17, 2017 Thanks for looking. Yes, I know that, yet what I'm after is a ad-hoc change, whenever I want to have the condenser mic and the bias enabled, or the dynamic and bias disabled, solder/desolder resistor is not exactly useful this way. Is there any pulseaudio or alsa/mixer/something switch that enables/disables the bias in H3? Link to comment Share on other sites More sharing options...
martinayotte Posted October 17, 2017 Share Posted October 17, 2017 I doubt pulseaudio/alsa know any thing about the MicBias, since MicBias is an SoC related thing. But looking at the AllWinner H3 datasheet, there is a register named MIC1G_MICBAIS_CTR which bit6 is MMICBIASEN described as "Master Microphone Bias enable". Therefore, we need to look if the kernel driver is taking care of that using a DT setting. EDIT : if not supported by DT binding, maybe a small C application could be written to switch this bit thru memory mapping of /dev/mem, like GPIO libs are doing. Link to comment Share on other sites More sharing options...
Christos Posted October 17, 2017 Author Share Posted October 17, 2017 DT is for mainline 4.x and not for legacy (3.x), right? I've seen the kernel sources and the bits where mic bias is enabled/disabled https://github.com/armbian/linux/tree/sun8i/sound/soc/sunxi/audiocodec but I hoped that something easier like pulseaudio or alsa switch would suffice, it looks that I have to do it the hard way with an external application. If you got some pointer for me to see any github or so, example for such an application I would be happy (have not done so far direct memory register manipulation from userspace app), I could modify it based on the register info seen on the sources above for mic bias register enable/disable bits. Thanks anyway for all info. EDIT: Think I found something useful, I'll give it a try the hard way with direct register setting with these: https://github.com/tomba/rwmem and https://github.com/pavel-a/devmemX Link to comment Share on other sites More sharing options...
martinayotte Posted October 18, 2017 Share Posted October 18, 2017 Yes, the devmemX looks like a good staring point ! To figure out the register address, I strongly suggest you to download this PDF : http://linux-sunxi.org/File:Allwinner_H3_Datasheet_V1.2.pdf Link to comment Share on other sites More sharing options...
Recommended Posts