xduoo codec cleanups

Change-Id: I6c3437bde2d9f781a02ffc6b3a83148b9a7af872
This commit is contained in:
Solomon Peachy 2020-10-03 09:08:22 -04:00
parent 1824f8b103
commit d18157608d

View file

@ -66,15 +66,13 @@ void audiohw_mute(int mute)
} }
else else
{ {
long int ps0 = last_ps;
last_ps = 0; last_ps = 0;
xduoo_get_outputs(); xduoo_get_outputs();
// xduoo_set_output(ps);
} }
} }
int xduoo_get_outputs(void){ int xduoo_get_outputs(void){
long int ps = 2; // headset long int ps = 0; // Muted, if nothing is plugged in!
int status = 0; int status = 0;
@ -121,15 +119,16 @@ void audiohw_preinit(void)
logf("hw preinit"); logf("hw preinit");
alsa_controls_init(); alsa_controls_init();
hw_open(); hw_open();
audiohw_mute(true); /* Start muted */ audiohw_mute(true); /* Start muted to avoid the POP */
inited = 1; inited = 1;
} }
void audiohw_postinit(void) 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"); logf("hw postinit");
audiohw_mute(true); /* Stay muted */ xduoo_set_output(xduoo_get_outputs()); /* Unmute */
xduoo_set_output(xduoo_get_outputs());
} }
void audiohw_close(void) void audiohw_close(void)