H10: Touch-up the audio source switching a bit. Actually fix my earlier errors when enabling recording from Line/FM.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15580 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
31ea780ee0
commit
6e36ac547c
2 changed files with 20 additions and 15 deletions
|
@ -238,6 +238,8 @@ void audiohw_enable_recording(bool source_mic)
|
||||||
codec_set_active(false);
|
codec_set_active(false);
|
||||||
|
|
||||||
wm8731_regs[PDCTRL] &= ~PDCTRL_ADCPD;
|
wm8731_regs[PDCTRL] &= ~PDCTRL_ADCPD;
|
||||||
|
/* NOTE: When switching to digital monitoring we will not want
|
||||||
|
* the DAC disabled. */
|
||||||
wm8731_regs[PDCTRL] |= PDCTRL_DACPD;
|
wm8731_regs[PDCTRL] |= PDCTRL_DACPD;
|
||||||
wm8731_regs[AAPCTRL] &= ~AAPCTRL_DACSEL;
|
wm8731_regs[AAPCTRL] &= ~AAPCTRL_DACSEL;
|
||||||
|
|
||||||
|
@ -247,7 +249,7 @@ void audiohw_enable_recording(bool source_mic)
|
||||||
wm8731_regs[PDCTRL] &= ~PDCTRL_MICPD;
|
wm8731_regs[PDCTRL] &= ~PDCTRL_MICPD;
|
||||||
wm8731_regs[PDCTRL] |= PDCTRL_LINEINPD;
|
wm8731_regs[PDCTRL] |= PDCTRL_LINEINPD;
|
||||||
wm8731_regs[AAPCTRL] |= AAPCTRL_INSEL | AAPCTRL_SIDETONE;
|
wm8731_regs[AAPCTRL] |= AAPCTRL_INSEL | AAPCTRL_SIDETONE;
|
||||||
wm8731_regs[AAPCTRL] &= ~AAPCTRL_MUTEMIC;
|
wm8731_regs[AAPCTRL] &= ~(AAPCTRL_MUTEMIC | AAPCTRL_BYPASS);
|
||||||
} else {
|
} else {
|
||||||
wm8731_regs[PDCTRL] |= PDCTRL_MICPD;
|
wm8731_regs[PDCTRL] |= PDCTRL_MICPD;
|
||||||
wm8731_regs[PDCTRL] &= ~PDCTRL_LINEINPD;
|
wm8731_regs[PDCTRL] &= ~PDCTRL_LINEINPD;
|
||||||
|
@ -259,9 +261,6 @@ void audiohw_enable_recording(bool source_mic)
|
||||||
wm8731_write(AAPCTRL, wm8731_regs[AAPCTRL]);
|
wm8731_write(AAPCTRL, wm8731_regs[AAPCTRL]);
|
||||||
|
|
||||||
if (!source_mic) {
|
if (!source_mic) {
|
||||||
wm8731_regs[AAPCTRL] |= AAPCTRL_INSEL | AAPCTRL_SIDETONE;
|
|
||||||
wm8731_regs[AAPCTRL] &= ~(AAPCTRL_MUTEMIC | AAPCTRL_BYPASS);
|
|
||||||
} else {
|
|
||||||
wm8731_write_and(LINVOL, ~LINVOL_LINMUTE);
|
wm8731_write_and(LINVOL, ~LINVOL_LINMUTE);
|
||||||
wm8731_write_and(RINVOL, ~RINVOL_RINMUTE);
|
wm8731_write_and(RINVOL, ~RINVOL_RINMUTE);
|
||||||
}
|
}
|
||||||
|
@ -321,13 +320,11 @@ void audiohw_set_monitor(int enable)
|
||||||
{
|
{
|
||||||
if(enable)
|
if(enable)
|
||||||
{
|
{
|
||||||
wm8731_regs[AAPCTRL] |= AAPCTRL_BYPASS;
|
wm8731_write_and(PDCTRL, ~PDCTRL_LINEINPD);
|
||||||
wm8731_regs[AAPCTRL] &=~ (AAPCTRL_DACSEL | AAPCTRL_SIDETONE);
|
wm8731_write_or(AAPCTRL, AAPCTRL_BYPASS);
|
||||||
wm8731_write(AAPCTRL, wm8731_regs[AAPCTRL]);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
wm8731_regs[AAPCTRL] &=~ AAPCTRL_BYPASS;
|
wm8731_write_and(AAPCTRL, ~AAPCTRL_BYPASS);
|
||||||
wm8731_regs[AAPCTRL] |= AAPCTRL_DACSEL | AAPCTRL_SIDETONE;
|
wm8731_write_or(PDCTRL, PDCTRL_LINEINPD);
|
||||||
wm8731_write(AAPCTRL, wm8731_regs[AAPCTRL]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,8 @@ void audio_input_mux(int source, unsigned flags)
|
||||||
#ifdef HAVE_RECORDING
|
#ifdef HAVE_RECORDING
|
||||||
if (source != last_source)
|
if (source != last_source)
|
||||||
{
|
{
|
||||||
audiohw_disable_recording();
|
|
||||||
audiohw_set_monitor(false);
|
audiohw_set_monitor(false);
|
||||||
|
audiohw_disable_recording();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -56,8 +56,8 @@ void audio_input_mux(int source, unsigned flags)
|
||||||
case AUDIO_SRC_MIC: /* recording only */
|
case AUDIO_SRC_MIC: /* recording only */
|
||||||
if (source != last_source)
|
if (source != last_source)
|
||||||
{
|
{
|
||||||
audiohw_enable_recording(true); /* source mic */
|
|
||||||
audiohw_set_monitor(false);
|
audiohw_set_monitor(false);
|
||||||
|
audiohw_enable_recording(true); /* source mic */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
@ -69,8 +69,8 @@ void audio_input_mux(int source, unsigned flags)
|
||||||
#endif
|
#endif
|
||||||
if (source != last_source)
|
if (source != last_source)
|
||||||
{
|
{
|
||||||
audiohw_enable_recording(false); /* source line */
|
|
||||||
audiohw_set_monitor(false);
|
audiohw_set_monitor(false);
|
||||||
|
audiohw_enable_recording(false); /* source line */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
@ -88,8 +88,16 @@ void audio_input_mux(int source, unsigned flags)
|
||||||
|
|
||||||
last_recording = recording;
|
last_recording = recording;
|
||||||
|
|
||||||
audiohw_enable_recording(false); /* select line-in source */
|
if (recording)
|
||||||
audiohw_set_monitor(!recording); /* enable bypass mode */
|
{
|
||||||
|
audiohw_set_monitor(false); /* disable bypass mode */
|
||||||
|
audiohw_enable_recording(false); /* select line-in source */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
audiohw_disable_recording();
|
||||||
|
audiohw_set_monitor(true); /* enable bypass mode */
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
} /* end switch */
|
} /* end switch */
|
||||||
|
|
Loading…
Reference in a new issue