diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-10-03 00:11:20 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-10-03 04:13:13 +0000 |
commit | 1824f8b103ffbc20ddf5487088ed5d7a3682fb09 (patch) | |
tree | 363d4696386b6f99414d28288ab67b0c4c04eff8 | |
parent | 90c30bc7ef52cd447eb92157c53ba6ffc266efae (diff) | |
download | rockbox-1824f8b.tar.gz rockbox-1824f8b.zip |
xduoox3ii/x20: Rework the mute control to actually function properly.
(By switching the output away from the audio jacks)
Change-Id: Ib8511c9d45029bba038dc4d1d187174d56cb3043
-rw-r--r-- | firmware/drivers/audio/xduoolinux_codec.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/firmware/drivers/audio/xduoolinux_codec.c b/firmware/drivers/audio/xduoolinux_codec.c index f8de0bf78d..829b9dd334 100644 --- a/firmware/drivers/audio/xduoolinux_codec.c +++ b/firmware/drivers/audio/xduoolinux_codec.c @@ -21,6 +21,8 @@ * ****************************************************************************/ +//#define LOGF_ENABLE + #include "config.h" #include "audio.h" #include "audiohw.h" @@ -32,6 +34,8 @@ #include "alsa-controls.h" #include "pcm-alsa.h" +#include "logf.h" + static int fd_hw; static int inited = 0; @@ -53,24 +57,19 @@ static void hw_close(void) void audiohw_mute(int mute) { + logf("mute %d", mute); + if(mute) { -#if defined(XDUOO_X3II) - alsa_controls_set_bool("AK4490 Soft Mute", true); -#endif -#if defined(XDUOO_X20) - long int ps0 = (last_ps > 1) ? 1 : 2; + long int ps0 = 0; alsa_controls_set_ints("Output Port Switch", 1, &ps0); -#endif } else { -#if defined(XDUOO_X3II) - alsa_controls_set_bool("AK4490 Soft Mute", false); -#endif -#if defined(XDUOO_X20) - alsa_controls_set_ints("Output Port Switch", 1, &last_ps); -#endif + long int ps0 = last_ps; + last_ps = 0; + xduoo_get_outputs(); +// xduoo_set_output(ps); } } @@ -109,6 +108,7 @@ void xduoo_set_output(int ps) if (last_ps != ps) { + logf("set out %d/%d", ps, last_ps); /* Output port switch */ last_ps = ps; alsa_controls_set_ints("Output Port Switch", 1, &last_ps); @@ -118,18 +118,23 @@ void xduoo_set_output(int ps) void audiohw_preinit(void) { + logf("hw preinit"); alsa_controls_init(); hw_open(); + audiohw_mute(true); /* Start muted */ inited = 1; } void audiohw_postinit(void) { + logf("hw postinit"); + audiohw_mute(true); /* Stay muted */ xduoo_set_output(xduoo_get_outputs()); } void audiohw_close(void) { + logf("hw close"); inited = 0; hw_close(); alsa_controls_close(); @@ -142,6 +147,8 @@ void audiohw_set_frequency(int fsel) void audiohw_set_volume(int vol_l, int vol_r) { + logf("hw vol %d %d", vol_l, vol_r); + long l,r; vol_l_hw = vol_l; @@ -163,6 +170,8 @@ void audiohw_set_lineout_volume(int vol_l, int vol_r) { long l,r; + logf("lo vol %d %d", vol_l, vol_r); + (void)vol_l; (void)vol_r; @@ -180,6 +189,7 @@ void audiohw_set_lineout_volume(int vol_l, int vol_r) void audiohw_set_filter_roll_off(int value) { + logf("rolloff %d", value); /* 0 = Sharp; 1 = Slow; 2 = Short Sharp |