summaryrefslogtreecommitdiffstats
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/audio/erosqlinux_codec.c7
-rw-r--r--firmware/drivers/audio/rocker_codec.c2
-rw-r--r--firmware/drivers/audio/xduoolinux_codec.c7
3 files changed, 11 insertions, 5 deletions
diff --git a/firmware/drivers/audio/erosqlinux_codec.c b/firmware/drivers/audio/erosqlinux_codec.c
index deb3bb4b87..9336083d58 100644
--- a/firmware/drivers/audio/erosqlinux_codec.c
+++ b/firmware/drivers/audio/erosqlinux_codec.c
@@ -56,6 +56,8 @@ static void hw_close(void)
close(fd_hw);
}
+static int muted = -1;
+
void audiohw_mute(int mute)
{
logf("mute %d", mute);
@@ -70,6 +72,7 @@ void audiohw_mute(int mute)
last_ps = 0;
erosq_get_outputs();
}
+ muted = mute;
}
int erosq_get_outputs(void) {
@@ -95,7 +98,7 @@ int erosq_get_outputs(void) {
void erosq_set_output(int ps)
{
- if (!inited) return;
+ if (!inited || muted) return;
if (last_ps != ps)
{
@@ -119,7 +122,7 @@ void audiohw_preinit(void)
void audiohw_postinit(void)
{
logf("hw postinit");
- erosq_set_output(erosq_get_outputs()); /* Unmute */
+ erosq_get_outputs(); // Unmutes
}
void audiohw_close(void)
diff --git a/firmware/drivers/audio/rocker_codec.c b/firmware/drivers/audio/rocker_codec.c
index 525507494b..e5573df843 100644
--- a/firmware/drivers/audio/rocker_codec.c
+++ b/firmware/drivers/audio/rocker_codec.c
@@ -70,7 +70,7 @@ void audiohw_postinit(void)
long int hp = 2;
/* Output port switch set to Headphones */
- alsa_controls_set_ints("Output Port Switch", 1, &hp); /* Unmutes */
+ //alsa_controls_set_ints("Output Port Switch", 1, &hp); // Unmute happens on PCM start
}
void audiohw_close(void)
diff --git a/firmware/drivers/audio/xduoolinux_codec.c b/firmware/drivers/audio/xduoolinux_codec.c
index b114b1bbc9..59ef562d0a 100644
--- a/firmware/drivers/audio/xduoolinux_codec.c
+++ b/firmware/drivers/audio/xduoolinux_codec.c
@@ -55,6 +55,8 @@ static void hw_close(void)
close(fd_hw);
}
+static int muted = -1;
+
void audiohw_mute(int mute)
{
logf("mute %d", mute);
@@ -69,6 +71,7 @@ void audiohw_mute(int mute)
last_ps = 0;
xduoo_get_outputs();
}
+ muted = mute;
}
int xduoo_get_outputs(void){
@@ -102,7 +105,7 @@ int xduoo_get_outputs(void){
void xduoo_set_output(int ps)
{
- if (!inited) return;
+ if (!inited || muted) return;
if (last_ps != ps)
{
@@ -128,7 +131,7 @@ 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_set_output(xduoo_get_outputs()); /* Unmute */
+ // xduoo_get_outputs(); // Unmute happens upon playback.
}
void audiohw_close(void)