summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDana Conrad <dconrad@fastmail.com>2024-11-30 21:48:16 +0000
committerSolomon Peachy <pizza@shaftnet.org>2024-12-07 09:20:40 -0500
commit5ed0db6e9097ec4323622f9634539275bfe73a45 (patch)
tree76975badf14c99cacd74047f3d30c77d5e66f76f
parenta29b570ac4618e5b36fd542cf6abbdfea66b0300 (diff)
downloadrockbox-5ed0db6e90.tar.gz
rockbox-5ed0db6e90.zip
erosqnative: Repurpose stereosw_select setting for output select
Turns out they did not swap the stereo switch lines on us, so this setting isn't really useful. Repurpose it to allow the user to force the device into headphone or line output mode. Note that settings other than "Automatic" will cause jack detection to not work. Default Automatic. Change-Id: If94499fbb8f0d92111811fe51f6107ce213b66ad
-rw-r--r--apps/lang/english.lang98
-rw-r--r--apps/menus/sound_menu.c4
-rw-r--r--apps/settings.h2
-rw-r--r--apps/settings_list.c8
-rw-r--r--firmware/drivers/audio/eros_qn_codec.c8
-rw-r--r--firmware/target/mips/ingenic_x1000/erosqnative/button-erosqnative.c31
-rw-r--r--manual/configure_rockbox/sound_settings.tex29
7 files changed, 98 insertions, 82 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index f88864efcc..00efef667d 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -16358,62 +16358,6 @@
</voice>
</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>
-<phrase>
id: LANG_LEGAL_NOTICES
desc: in system menu
user: core
@@ -16581,3 +16525,45 @@
*: "View Album Art"
</voice>
</phrase>
+<phrase>
+ id: LANG_HP_LO_SELECT
+ desc: Output Select
+ user: core
+ <source>
+ *: "Output Select"
+ </source>
+ <dest>
+ *: "Output Select"
+ </dest>
+ <voice>
+ *: "Output Select"
+ </voice>
+</phrase>
+<phrase>
+ id: LANG_HEADPHONE
+ desc: in settings_menu
+ user: core
+ <source>
+ *: "Headphone"
+ </source>
+ <dest>
+ *: "Headphone"
+ </dest>
+ <voice>
+ *: "Headphone"
+ </voice>
+</phrase>
+<phrase>
+ id: LANG_LINEOUT
+ desc: in settings_menu
+ user: core
+ <source>
+ *: "Lineout"
+ </source>
+ <dest>
+ *: "Lineout"
+ </dest>
+ <voice>
+ *: "Lineout"
+ </voice>
+</phrase> \ No newline at end of file
diff --git a/apps/menus/sound_menu.c b/apps/menus/sound_menu.c
index fcb0dff080..f736c4934f 100644
--- a/apps/menus/sound_menu.c
+++ b/apps/menus/sound_menu.c
@@ -136,7 +136,7 @@ MENUITEM_SETTING(roll_off, &global_settings.roll_off, NULL);
#endif
#ifdef HAVE_EROS_QN_CODEC
-MENUITEM_SETTING(stereosw_mode, &global_settings.stereosw_mode,NULL);
+MENUITEM_SETTING(hp_lo_select, &global_settings.hp_lo_select,NULL);
#endif
#ifdef AUDIOHW_HAVE_POWER_MODE
@@ -258,7 +258,7 @@ MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
,&roll_off
#endif
#ifdef HAVE_EROS_QN_CODEC
- ,&stereosw_mode
+ ,&hp_lo_select
#endif
#ifdef AUDIOHW_HAVE_POWER_MODE
,&power_mode
diff --git a/apps/settings.h b/apps/settings.h
index b04152d508..4f43c4f771 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -909,7 +909,7 @@ struct user_settings
bool clear_settings_on_hold;
#endif
#if defined(HAVE_EROS_QN_CODEC)
- int stereosw_mode; /* indicates normal, reverse, always 0, always 1 operation */
+ int hp_lo_select; /* indicates automatic, headphone-only, or lineout-only operation */
#endif
};
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 1ca9197c5f..c68a7e3114 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -819,7 +819,7 @@ static void volume_limit_set_default(void* setting, void* defaultval)
}
#if defined(HAVE_EROS_QN_CODEC)
-static void stereosw_apply(int arg)
+static void hp_lo_select_apply(int arg)
{
(void)arg;
@@ -2312,9 +2312,9 @@ const struct settings_list settings[] = {
true, "clear settings on hold", NULL),
#endif
#if defined(HAVE_EROS_QN_CODEC)
- CHOICE_SETTING(0, stereosw_mode, LANG_STEREOSW_MODE, 0, "stereo switch mode",
- "normal,reverse,always0,always1", stereosw_apply, 4,
- ID2P(LANG_NORMAL), ID2P(LANG_REVERSE), ID2P(LANG_ALWAYS_ZERO), ID2P(LANG_ALWAYS_ONE)),
+ CHOICE_SETTING(0, hp_lo_select, LANG_HP_LO_SELECT, 0, "headphone lineout select",
+ "auto,headphone,lineout", hp_lo_select_apply, 3,
+ ID2P(LANG_AUTO), ID2P(LANG_HEADPHONE), ID2P(LANG_LINEOUT)),
#endif
};
diff --git a/firmware/drivers/audio/eros_qn_codec.c b/firmware/drivers/audio/eros_qn_codec.c
index c9d01c5ed4..741f3fb24f 100644
--- a/firmware/drivers/audio/eros_qn_codec.c
+++ b/firmware/drivers/audio/eros_qn_codec.c
@@ -58,14 +58,12 @@ int eros_qn_get_volume_limit(void)
void eros_qn_switch_output(int select)
{
- /* 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)
+ /* normal operation 0 */
+ if (select == 0)
{
gpio_set_level(GPIO_STEREOSW_SEL, 0);
}
- /* normal operation 1, reverse operation 0, or always 1 */
+ /* normal operation 1 */
else
{
gpio_set_level(GPIO_STEREOSW_SEL, 1);
diff --git a/firmware/target/mips/ingenic_x1000/erosqnative/button-erosqnative.c b/firmware/target/mips/ingenic_x1000/erosqnative/button-erosqnative.c
index 3fa825fcdc..cc157cccf4 100644
--- a/firmware/target/mips/ingenic_x1000/erosqnative/button-erosqnative.c
+++ b/firmware/target/mips/ingenic_x1000/erosqnative/button-erosqnative.c
@@ -34,6 +34,7 @@
#include "devicedata.h"
#ifndef BOOTLOADER
+# include "settings.h"
# include "lcd.h"
# include "font.h"
#endif
@@ -166,7 +167,20 @@ bool headphones_inserted(void)
eros_qn_set_outputs();
#endif
}
- return hp_detect_reg & 0x10 ? false : true;
+#if !defined(BOOTLOADER)
+ if (global_settings.hp_lo_select == 1) // force headphones
+ {
+ return true;
+ }
+ else if (global_settings.hp_lo_select == 2) // force lineout
+ {
+ return false;
+ }
+ else // automatic
+#endif
+ {
+ return hp_detect_reg & 0x10 ? false : true;
+ }
}
bool lineout_inserted(void)
@@ -182,7 +196,20 @@ bool lineout_inserted(void)
eros_qn_set_outputs();
#endif
}
- return hp_detect_reg & 0x20 ? false : true;
+#if !defined(BOOTLOADER)
+ if (global_settings.hp_lo_select == 1) // force headphones
+ {
+ return false;
+ }
+ else if (global_settings.hp_lo_select == 2) // force lineout
+ {
+ return true;
+ }
+ else // automatic
+#endif
+ {
+ return hp_detect_reg & 0x20 ? false : true;
+ }
}
/* Rockbox interface */
diff --git a/manual/configure_rockbox/sound_settings.tex b/manual/configure_rockbox/sound_settings.tex
index 0aeada59b2..ae2dccf0d3 100644
--- a/manual/configure_rockbox/sound_settings.tex
+++ b/manual/configure_rockbox/sound_settings.tex
@@ -190,19 +190,24 @@ change to customise your listening experience.
stereo field unaltered.
\opt{erosqnative}{
- \section{Stereo Switch Mode}
- The Eros Q and related devices contain a stereo switch in the audio path.
- 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:
+ \section{Output Select}
+ The \dap{} has two output ports: Headphones and Line Out. This setting selects
+ either automatic detection, or forces the player to use Headphone output or
+ Line output.
+ \note{The headphone jack will only detect a pair of headphones or similar devices with low impedance.
+ An amplifier or other high-impedance device will not be detected. The lineout jack
+ will detect a high-impedance device.}
+ \note{Line output volume is fixed to Volume Limit value. Please see \setting{Volume} section.}
\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.
+ \item[Automatic.]
+ Automatically detect which output to use. If both outputs are plugged in,
+ headphones will take precedence. Jack detection is enabled.
+ \item[Headphone.]
+ Force the headphone output to be active. Jack detection is disabled. Automatic
+ play/pause jack detection will not work.
+ \item[Lineout.]
+ Force the line output to be active. Jack detection is disabled. Automatic
+ play/pause jack detection will not work.
\end{description}
\section{DAC filter roll-off}