mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
Hosted PCM: Rework auto-muting code a bit
* If AUDIOHW_MUTE_ON_PAUSE, no meaningful change
* Unconditionally unmute on playback start
* xduoox3ii: Mute on sample rate change
* rocker/xduoo: Stay muted after startup
This avoids the nasty "pop" on startup, without doing
the full mute-on-pause stuff that causes unacceptable
dropouts on the X3ii.
Change-Id: I2e3ee0bb8094e288f37a0acada86a80016ce5cac
This commit is contained in:
parent
9ad30869b8
commit
141e91ef1f
5 changed files with 44 additions and 22 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue