summaryrefslogtreecommitdiff
path: root/firmware/drivers/audio
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/audio')
-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)
56 close(fd_hw); 56 close(fd_hw);
57} 57}
58 58
59static int muted = -1;
60
59void audiohw_mute(int mute) 61void audiohw_mute(int mute)
60{ 62{
61 logf("mute %d", mute); 63 logf("mute %d", mute);
@@ -70,6 +72,7 @@ void audiohw_mute(int mute)
70 last_ps = 0; 72 last_ps = 0;
71 erosq_get_outputs(); 73 erosq_get_outputs();
72 } 74 }
75 muted = mute;
73} 76}
74 77
75int erosq_get_outputs(void) { 78int erosq_get_outputs(void) {
@@ -95,7 +98,7 @@ int erosq_get_outputs(void) {
95 98
96void erosq_set_output(int ps) 99void erosq_set_output(int ps)
97{ 100{
98 if (!inited) return; 101 if (!inited || muted) return;
99 102
100 if (last_ps != ps) 103 if (last_ps != ps)
101 { 104 {
@@ -119,7 +122,7 @@ void audiohw_preinit(void)
119void audiohw_postinit(void) 122void audiohw_postinit(void)
120{ 123{
121 logf("hw postinit"); 124 logf("hw postinit");
122 erosq_set_output(erosq_get_outputs()); /* Unmute */ 125 erosq_get_outputs(); // Unmutes
123} 126}
124 127
125void audiohw_close(void) 128void 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)
70 long int hp = 2; 70 long int hp = 2;
71 71
72 /* Output port switch set to Headphones */ 72 /* Output port switch set to Headphones */
73 alsa_controls_set_ints("Output Port Switch", 1, &hp); /* Unmutes */ 73 //alsa_controls_set_ints("Output Port Switch", 1, &hp); // Unmute happens on PCM start
74} 74}
75 75
76void audiohw_close(void) 76void 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)
55 close(fd_hw); 55 close(fd_hw);
56} 56}
57 57
58static int muted = -1;
59
58void audiohw_mute(int mute) 60void audiohw_mute(int mute)
59{ 61{
60 logf("mute %d", mute); 62 logf("mute %d", mute);
@@ -69,6 +71,7 @@ void audiohw_mute(int mute)
69 last_ps = 0; 71 last_ps = 0;
70 xduoo_get_outputs(); 72 xduoo_get_outputs();
71 } 73 }
74 muted = mute;
72} 75}
73 76
74int xduoo_get_outputs(void){ 77int xduoo_get_outputs(void){
@@ -102,7 +105,7 @@ int xduoo_get_outputs(void){
102 105
103void xduoo_set_output(int ps) 106void xduoo_set_output(int ps)
104{ 107{
105 if (!inited) return; 108 if (!inited || muted) return;
106 109
107 if (last_ps != ps) 110 if (last_ps != ps)
108 { 111 {
@@ -128,7 +131,7 @@ void audiohw_postinit(void)
128// const char * const codec_pmdown = "/sys/devices/platform/ingenic-x3ii.0/x3ii-ak4490-i2s/pmdown_time"; // in ms, defaults 5000 131// const char * const codec_pmdown = "/sys/devices/platform/ingenic-x3ii.0/x3ii-ak4490-i2s/pmdown_time"; // in ms, defaults 5000
129 132
130 logf("hw postinit"); 133 logf("hw postinit");
131 xduoo_set_output(xduoo_get_outputs()); /* Unmute */ 134 // xduoo_get_outputs(); // Unmute happens upon playback.
132} 135}
133 136
134void audiohw_close(void) 137void audiohw_close(void)