summaryrefslogtreecommitdiff
path: root/firmware/drivers/audio/erosqlinux_codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/audio/erosqlinux_codec.c')
-rw-r--r--firmware/drivers/audio/erosqlinux_codec.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/firmware/drivers/audio/erosqlinux_codec.c b/firmware/drivers/audio/erosqlinux_codec.c
index 9336083d58..d56e32c6ff 100644
--- a/firmware/drivers/audio/erosqlinux_codec.c
+++ b/firmware/drivers/audio/erosqlinux_codec.c
@@ -42,7 +42,7 @@ static int inited = 0;
42 42
43static long int vol_l_hw = 255; 43static long int vol_l_hw = 255;
44static long int vol_r_hw = 255; 44static long int vol_r_hw = 255;
45static long int last_ps = 0; 45static long int last_ps = -1;
46 46
47static void hw_open(void) 47static void hw_open(void)
48{ 48{
@@ -62,6 +62,11 @@ void audiohw_mute(int mute)
62{ 62{
63 logf("mute %d", mute); 63 logf("mute %d", mute);
64 64
65 if (muted == mute)
66 return;
67
68 muted = mute;
69
65 if(mute) 70 if(mute)
66 { 71 {
67 long int ps0 = 0; 72 long int ps0 = 0;
@@ -69,10 +74,8 @@ void audiohw_mute(int mute)
69 } 74 }
70 else 75 else
71 { 76 {
72 last_ps = 0;
73 erosq_get_outputs(); 77 erosq_get_outputs();
74 } 78 }
75 muted = mute;
76} 79}
77 80
78int erosq_get_outputs(void) { 81int erosq_get_outputs(void) {
@@ -115,14 +118,14 @@ void audiohw_preinit(void)
115 logf("hw preinit"); 118 logf("hw preinit");
116 alsa_controls_init(); 119 alsa_controls_init();
117 hw_open(); 120 hw_open();
118 audiohw_mute(true); /* Start muted to avoid the POP */ 121// audiohw_mute(true); /* Start muted to avoid the POP */
122 audiohw_mute(false);
119 inited = 1; 123 inited = 1;
120} 124}
121 125
122void audiohw_postinit(void) 126void audiohw_postinit(void)
123{ 127{
124 logf("hw postinit"); 128 logf("hw postinit");
125 erosq_get_outputs(); // Unmutes
126} 129}
127 130
128void audiohw_close(void) 131void audiohw_close(void)