summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/agptek
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-09-30 22:12:35 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-01 11:56:57 -0400
commite43726df2cd1cb8275234d60b818d417cfe730b5 (patch)
tree6f1fb0659dccaafd47394c7de860d4dc3e46b0a4 /firmware/target/hosted/agptek
parent6459fa0765745e951a6731974164bbcdc9551dfe (diff)
downloadrockbox-e43726df2cd1cb8275234d60b818d417cfe730b5.tar.gz
rockbox-e43726df2cd1cb8275234d60b818d417cfe730b5.tar.bz2
rockbox-e43726df2cd1cb8275234d60b818d417cfe730b5.zip
hosted pcm-alsa improvements
* xduoo x3ii/x20: Better line out support * less granular volume settings (too many steps before) * Better handling of swiching sample rates * Log actual sample rate in debug menu Most credit goes to Roman Stolyarov Additional integration [re]work by myself Change-Id: I63af3740678cf2ed3170f61534e1029c81826bb6
Diffstat (limited to 'firmware/target/hosted/agptek')
-rw-r--r--firmware/target/hosted/agptek/debug-agptek.c52
1 files changed, 49 insertions, 3 deletions
diff --git a/firmware/target/hosted/agptek/debug-agptek.c b/firmware/target/hosted/agptek/debug-agptek.c
index 33f3ac4b97..b4fcb4246b 100644
--- a/firmware/target/hosted/agptek/debug-agptek.c
+++ b/firmware/target/hosted/agptek/debug-agptek.c
@@ -1,6 +1,52 @@
-#include <stdbool.h>
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ *
+ * Copyright (C) 2020 by Solomon Peachy
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
-bool debug_hw_info(void)
+#include "config.h"
+#include "font.h"
+#include "lcd.h"
+#include "kernel.h"
+#include "button.h"
+
+#ifndef BOOTLOADER
+
+#include "pcm-alsa.h"
+
+static int line = 0;
+
+bool dbg_hw_info(void)
{
- return false;
+ int btn = 0;
+
+ lcd_setfont(FONT_SYSFIXED);
+
+ while(btn ^ BUTTON_POWER) {
+ lcd_clear_display();
+ line = 0;
+
+ lcd_putsf(0, line++, "pcm srate: %d", pcm_alsa_get_rate());
+ btn = button_read_device();
+
+ lcd_update();
+ sleep(HZ/16);
+ }
+ return true;
}
+
+#endif /* !BOOTLOADER */