Eros Q Native: Add Stereo SW behavior setting

Hopefully this should cover our bases so we can change
the behavior of the stereo switch to keep line out working
when they change the hardware on us!

Change-Id: Ic36bcb3778d5681a5f3f158c689df9c1420c1d7e
This commit is contained in:
Dana Conrad 2024-04-29 20:33:26 -05:00 committed by Aidan MacDonald
parent d0758c5330
commit 5f377c2613
6 changed files with 94 additions and 1 deletions

View file

@ -16935,3 +16935,59 @@
*: "Expert" *: "Expert"
</voice> </voice>
</phrase> </phrase>
<phrase>
id: LANG_STEREOSW_MODE
desc: Stereo Switch Mode
user: core
<source>
*: "Stereo Switch Mode"
</source>
<dest>
*: "Stereo Switch Mode"
</dest>
<voice>
*: "Stereo Switch Mode"
</voice>
</phrase>
<phrase>
id: LANG_REVERSE
desc: in settings_menu
user: core
<source>
*: "Reverse"
</source>
<dest>
*: "Reverse"
</dest>
<voice>
*: "Reverse"
</voice>
</phrase>
<phrase>
id: LANG_ALWAYS_ZERO
desc: in settings_menu
user: core
<source>
*: "Always 0"
</source>
<dest>
*: "Always 0"
</dest>
<voice>
*: "Always 0"
</voice>
</phrase>
<phrase>
id: LANG_ALWAYS_ONE
desc: in settings_menu
user: core
<source>
*: "Always 1"
</source>
<dest>
*: "Always 1"
</dest>
<voice>
*: "Always 1"
</voice>
</phrase>

View file

@ -135,6 +135,10 @@ MENUITEM_SETTING(depth_3d, &global_settings.depth_3d, NULL);
MENUITEM_SETTING(roll_off, &global_settings.roll_off, NULL); MENUITEM_SETTING(roll_off, &global_settings.roll_off, NULL);
#endif #endif
#ifdef HAVE_EROS_QN_CODEC
MENUITEM_SETTING(stereosw_mode, &global_settings.stereosw_mode,NULL);
#endif
#ifdef AUDIOHW_HAVE_POWER_MODE #ifdef AUDIOHW_HAVE_POWER_MODE
MENUITEM_SETTING(power_mode, &global_settings.power_mode, NULL); MENUITEM_SETTING(power_mode, &global_settings.power_mode, NULL);
#endif #endif
@ -253,6 +257,9 @@ MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
#ifdef AUDIOHW_HAVE_FILTER_ROLL_OFF #ifdef AUDIOHW_HAVE_FILTER_ROLL_OFF
,&roll_off ,&roll_off
#endif #endif
#ifdef HAVE_EROS_QN_CODEC
,&stereosw_mode
#endif
#ifdef AUDIOHW_HAVE_POWER_MODE #ifdef AUDIOHW_HAVE_POWER_MODE
,&power_mode ,&power_mode
#endif #endif

View file

@ -899,6 +899,9 @@ struct user_settings
(CONFIG_KEYPAD == IRIVER_H10_PAD) (CONFIG_KEYPAD == IRIVER_H10_PAD)
bool clear_settings_on_hold; bool clear_settings_on_hold;
#endif #endif
#if defined(HAVE_EROS_QN_CODEC)
int stereosw_mode; /* indicates normal, reverse, always 0, always 1 operation */
#endif
}; };
/** global variables **/ /** global variables **/

View file

@ -2295,6 +2295,11 @@ const struct settings_list settings[] = {
OFFON_SETTING(0, clear_settings_on_hold, LANG_CLEAR_SETTINGS_ON_HOLD, OFFON_SETTING(0, clear_settings_on_hold, LANG_CLEAR_SETTINGS_ON_HOLD,
true, "clear settings on hold", NULL), true, "clear settings on hold", NULL),
#endif #endif
#if defined(HAVE_EROS_QN_CODEC)
CHOICE_SETTING(0, stereosw_mode, LANG_STEREOSW_MODE, 0, "stereo switch mode",
"normal,reverse,always0,always1", sound_settings_apply, 4,
ID2P(LANG_NORMAL), ID2P(LANG_REVERSE), ID2P(LANG_ALWAYS_ZERO), ID2P(LANG_ALWAYS_ONE)),
#endif
}; };
const int nb_settings = sizeof(settings)/sizeof(*settings); const int nb_settings = sizeof(settings)/sizeof(*settings);

View file

@ -51,10 +51,14 @@ int eros_qn_get_volume_limit(void)
void eros_qn_switch_output(int select) void eros_qn_switch_output(int select)
{ {
if (select == 0) /* normal operation 0, reverse operation 1, or always 0 */
if ((select == 0 && global_settings.stereosw_mode == 0) \
|| (select == 1 && global_settings.stereosw_mode == 1) \
|| global_settings.stereosw_mode == 2)
{ {
gpio_set_level(GPIO_STEREOSW_SEL, 0); gpio_set_level(GPIO_STEREOSW_SEL, 0);
} }
/* normal operation 1, reverse operation 0, or always 1 */
else else
{ {
gpio_set_level(GPIO_STEREOSW_SEL, 1); gpio_set_level(GPIO_STEREOSW_SEL, 1);

View file

@ -193,6 +193,24 @@ change to customise your listening experience.
the effect of widening the stereo field. A value of 100\% will leave the the effect of widening the stereo field. A value of 100\% will leave the
stereo field unaltered. stereo field unaltered.
\opt{erosqnative}{
\section{Stereo Switch Mode}
The Eros Q and related devices contain a stereo switch in the audio path.
This may be connected differently depending on the hardware revision. This
setting allows the behavior of the stereo switch to be changed if one of
the two outputs (Headphones or Line Out) is not working. There are four modes:
\begin{description}
\item[Normal.]
Headphones output uses a value of 0, and Line Out uses a value of 1.
\item[Reverse.]
Headphones output uses a value of 1, and Line Out uses a value of 0.
\item[Always 0.]
Both outputs use a value of 0.
\item[Always 1.]
Both outputs use a value of 1.
\end{description}
}
\opt{dac_power_mode}{ \opt{dac_power_mode}{
\opt{fiiom3k}{ \opt{fiiom3k}{
\section{DAC Power Mode} \section{DAC Power Mode}