[Letux-kernel] Audio Offset for handsfree speakers

H. Nikolaus Schaller hns at goldelico.com
Wed Dec 1 19:55:48 CET 2021



> Am 01.12.2021 um 19:23 schrieb Michael Mrozek <info at openpandora.de>:
> 
> Am Mittwoch, dem 01.12.2021 um 19:04 +0100 schrieb H. Nikolaus Schaller:
>> 
> 
> Hi,
> 
>>> Just changing one register does sound easy enough to do - but as a
>>> non-developer, I need help with that.
>>> 
>>> Does the driver already support that?
>> 
>> Well, there is code - but it is not in operation and likely very broken:
>> 
>> https://git.goldelico.com/?p=letux-kernel.git;a=blobdiff;f=sound/soc/ti/omap-abe-twl6040.c;h=18167ae58410accdba6834c1a05805d48ae9cf6d;hp=576215f90ddb4deffa6f65986a780963f7d935ef;hb=5046975492e8cb9d0ba08aa18f4ca68a6e34497e;hpb=6aa328535c43caafa1218b3bef72d72d84293f2c
>> 
>>> If not, is it hard to implement?
>> 
>> Some definitions are also there:
>> 
>> https://git.goldelico.com/?p=letux-kernel.git;a=blob;f=sound/soc/codecs/twl6040.h;h=f4f4b14cc0c4f75463187fa00b7b3e6e33b61608;hb=2f2d34f0d2e2b29e25d45dfc93b7677b10988329
>> 
>> What I am not sure is if this is just code to prepare the aess driver/firmware
>> to write these registers.
>> 
> 
> Well, it should work without the whole AESS / ABE stuff working, so it should be
> possible to be made to work in a simple driver as well.

well, abe is the twl6040 driver (ABE = Auudio Backend = Amplifier).

aess is the signal processor and it should work without.

But what I mean is that the twl6040 driver is only prepared that the aess
drivers can control these registers. But not from user space or e.g. through amixer.

A more simple hack would be to add some amixer controls that set these registers.

> 
> 
>>> Can I set the register directly for testing to find the proper value?
>>> If so, how? (Which command do I need to run to change it?)
>> 
>> Since the chip is connected by i2c you can write registers by i2cset
>> or probably better is through the debugfs which allows to read/write regmaps.
> 
> Okay... no idea how exactly I can do that, but as far as I can see I use i2cset
> to find out the address of the chip on the bus and then send the register
> over...?

i2cdetect to find the device and then i2cdump or i2cget to read.



More information about the Letux-kernel mailing list