fix(audio): CS43198 音量寄存器=衰减量(0最响255静音),四路(launcher/audio.c+audiod+watchdog+SDK vol)统一反转映射 dac=255-pct*255/100 — 修「0档炸50档最低」。真机 audiod 热修版实测 L/R 值方向正确
This commit is contained in:
1 parent
84fd0a87aa
commit
109d48747f
11 files changed
+7
-7
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -467,7 +467,7 @@ static int amixer_get(int numid, int card)
|
||||
|
||||
static void dac_vol_set(int pct)
|
||||
{
|
||||
int dac = pct * 255 / 100;
|
||||
int dac = 255 - pct * 255 / 100; /* CS43198 寄存器=衰减量(0=最响 255=静音),用户 pct 越大越响 → 反转映射 */
|
||||
if (dac < 0) dac = 0;
|
||||
if (dac > 255) dac = 255;
|
||||
amixer_set(1, dac, 1);
|
||||
|
||||
@@ -102,7 +102,7 @@ int settings_cache_registered = 0; /* M2.24:监听只注册一次 */
|
||||
* settings_volume(写入 DAC 的映射值)为权威跟踪值。 */
|
||||
void meow_dac_vol_write(int pct)
|
||||
{
|
||||
int dac = pct * 255 / 100;
|
||||
int dac = 255 - pct * 255 / 100; /* CS43198 寄存器=衰减量(0=最响 255=静音),用户 pct 越大越响 → 反转映射 */
|
||||
if (dac < 0) dac = 0;
|
||||
if (dac > 255) dac = 255;
|
||||
char cmd[160];
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -356,7 +356,7 @@ static void wd_vol_load(void)
|
||||
/* 写真实 DAC(CS43198, numid 1/2, 0-255),与 launcher meow_dac_vol_write 同路径。 */
|
||||
static void wd_vol_write(int pct)
|
||||
{
|
||||
int dac = pct * 255 / 100;
|
||||
int dac = 255 - pct * 255 / 100; /* CS43198 寄存器=衰减量(0=最响 255=静音),用户 pct 越大越响 → 反转映射 */
|
||||
if (dac < 0) dac = 0;
|
||||
if (dac > 255) dac = 255;
|
||||
char cmd[160];
|
||||
|
||||
Binary file not shown.
@@ -110,7 +110,7 @@ int meow_ui_vol_step(const char *path, int dir)
|
||||
* 与 launcher meow_dac_vol_write / watchdog wd_vol_write 完全同路径(语义同源)。 */
|
||||
void meow_ui_vol_dac_write(int pct)
|
||||
{
|
||||
int dac = pct * 255 / 100;
|
||||
int dac = 255 - pct * 255 / 100; /* CS43198 寄存器=衰减量(0=最响 255=静音),用户 pct 越大越响 → 反转映射 */
|
||||
if (dac < 0) dac = 0;
|
||||
if (dac > 255) dac = 255;
|
||||
char cmd[160];
|
||||
|
||||
Reference in new issue
Block a user