summaryrefslogtreecommitdiffstats
path: root/firmware/drivers/audio/xduoolinux_codec.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-12 11:09:55 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-12 15:33:32 +0000
commit078c34e951049741cd6681e0219561eec67e071b (patch)
tree734edf13fae68177e832d9869061777eb424d481 /firmware/drivers/audio/xduoolinux_codec.c
parent01dc81cd943719dc0ba380774b332f6c2ee0d67e (diff)
downloadrockbox-078c34e951049741cd6681e0219561eec67e071b.tar.gz
rockbox-078c34e951049741cd6681e0219561eec67e071b.zip
hosted: More PCM muting work
* Track mute state, only call hw if actual change is needed * Don't unmute in audiohw_postinit() * sample rate tracking fixes * erosq: Don't start up muted Change-Id: I004f787a4b7ea73c16b6ec9818ec29a12c89f46b
Diffstat (limited to 'firmware/drivers/audio/xduoolinux_codec.c')
-rw-r--r--firmware/drivers/audio/xduoolinux_codec.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/firmware/drivers/audio/xduoolinux_codec.c b/firmware/drivers/audio/xduoolinux_codec.c
index 59ef562d0a..f9642812d3 100644
--- a/firmware/drivers/audio/xduoolinux_codec.c
+++ b/firmware/drivers/audio/xduoolinux_codec.c
@@ -41,7 +41,7 @@ static int inited = 0;
static long int vol_l_hw = 255;
static long int vol_r_hw = 255;
-static long int last_ps = 0;
+static long int last_ps = -1;
static void hw_open(void)
{
@@ -61,6 +61,11 @@ void audiohw_mute(int mute)
{
logf("mute %d", mute);
+ if (muted == mute)
+ return;
+
+ muted = mute;
+
if(mute)
{
long int ps0 = 0;
@@ -68,10 +73,8 @@ void audiohw_mute(int mute)
}
else
{
- last_ps = 0;
xduoo_get_outputs();
}
- muted = mute;
}
int xduoo_get_outputs(void){
@@ -124,14 +127,12 @@ void audiohw_preinit(void)
hw_open();
audiohw_mute(true); /* Start muted to avoid the POP */
inited = 1;
+// const char * const codec_pmdown = "/sys/devices/platform/ingenic-x3ii.0/x3ii-ak4490-i2s/pmdown_time"; // in ms, defaults 5000
}
void audiohw_postinit(void)
{
-// const char * const codec_pmdown = "/sys/devices/platform/ingenic-x3ii.0/x3ii-ak4490-i2s/pmdown_time"; // in ms, defaults 5000
-
logf("hw postinit");
- // xduoo_get_outputs(); // Unmute happens upon playback.
}
void audiohw_close(void)