Hello,
I try to increase the volume on the headphone output manage by the SGTL5000.
This chip use two differents volume stage to output sound on the headphone.
The first CHIP_DAC_VOL 0x0010 and the second CHIP_ANA_HP_CTRL 0x0022.
These two registers has default value(at reset of the chip) which correspond to 0dB (0x3C3C to DAC_VOL and 0x1818 to HP_CTRL).
But when the drivers initialize this chip is write these value to -24dB (0x6C6C) to DAC_VOL and -20dB (0x4040) to HP_CTRL.
Is there a way to change these values from user space without using I2C_SLAVE_FORCE ?
I have written a software which changes these values but it use I2C_SLAVE_FORCE which is not very clean.
Solved! Go to Solution.
Finally I have found amixer command in userspace.
amixer -c 0 set Headphone 103 // set CHIP_ANA_HP_CTRL 0x0022 to 0dB (0x1818)
value can be 0-127 (-51.5dB to 12dB)
amixer -c 0 set PCM 192 // set CHIP_DAC_VOL 0x0010 to 0dB (0x3C3C)
value can be 0 - 192 (0-12 => -90dB; 13 => -89.5dB; 192 => 0dB)
I check the result by reading the register with i2-c bus and it works.
Hi francoisrey
one can look at unit test (imx-test package), ../mxc_sound_test
example check_volume.c
sources can be found for example on :
Index of /buildsources/i/imx-test/imx-test-3.14.28-1.0.0
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Finally I have found amixer command in userspace.
amixer -c 0 set Headphone 103 // set CHIP_ANA_HP_CTRL 0x0022 to 0dB (0x1818)
value can be 0-127 (-51.5dB to 12dB)
amixer -c 0 set PCM 192 // set CHIP_DAC_VOL 0x0010 to 0dB (0x3C3C)
value can be 0 - 192 (0-12 => -90dB; 13 => -89.5dB; 192 => 0dB)
I check the result by reading the register with i2-c bus and it works.