How to change volume on SGTL5000

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to change volume on SGTL5000

Jump to solution
1,784 Views
francoisrey
Contributor III

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.

Labels (3)
0 Kudos
1 Solution
1,297 Views
francoisrey
Contributor III

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.

View solution in original post

0 Kudos
2 Replies
1,297 Views
igorpadykov
NXP Employee
NXP Employee

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!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,298 Views
francoisrey
Contributor III

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.

0 Kudos