changeset 287:3dee79757ae4

UI fw: load handheld audio mode on boot We have now reached the point where use of audio mode config files should be considered mandatory. In ACI usage we can tell users that they need to perform an AT@AUL of some appropriate audio mode, but in UI-enabled fw we really need to have the firmware load audio modes on its own, so that correct audio config gets established when the handset or development board runs on its own, without a connected host computer. Once have FC Venus with both main and headset audio channels and headset plug insertion detection, our fw will need to automatically load the handheld mode or the headset mode depending on the plug insertion state. For now we load only the handheld mode, which has been tuned for FC-HDS4 on FC Luna.
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 13 Nov 2021 03:20:57 +0000
parents ee16d57b32b2
children 25d3ee009d19
files src/ui/mfw/mfw_mme.c
diffstat 1 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui/mfw/mfw_mme.c	Tue Nov 09 02:16:59 2021 +0000
+++ b/src/ui/mfw/mfw_mme.c	Sat Nov 13 03:20:57 2021 +0000
@@ -110,6 +110,7 @@
 #define ENTITY_MFW
 
 #include <stdio.h>
+#include <string.h>
 
 #if defined (NEW_FRAME)
 
@@ -143,6 +144,10 @@
 #include "mfw_mme.h"
 #include "mfw_win.h"
 #include "mfw_ffs.h"
+
+/* FreeCalypso additions */
+#include "rv/rv_general.h"
+#include "audio/audio_api.h"
 #include "fchg/fchg_api.h"
 
 #define hCommPL _ENTITY_PREFIXED(hCommPL)
@@ -225,6 +230,24 @@
 
 
 /*
+ * The following function is a FreeCalypso addition, most likely temporary
+ * until we develop proper infrastructure for switching between different
+ * audio modes - for now we simply load the handheld mode on boot.
+ */
+static void
+load_handheld_audio_mode(void)
+{
+	extern void audio_riv_audio_cb (void*);
+	static T_RV_RETURN_PATH const riv_audio_rp = {
+		0, audio_riv_audio_cb
+	};
+	T_AUDIO_MODE_LOAD load_param;
+
+	strcpy(load_param.audio_mode_filename, "handheld");
+	audio_mode_load(&load_param, riv_audio_rp);
+}
+
+/*
 +--------------------------------------------------------------------+
 | PROJECT : MMI-Framework (8417)        MODULE  : MFW_MME            |
 | STATE   : code                        ROUTINE : mmeInit            |
@@ -272,6 +295,7 @@
 #else
     audio_Init(hdsCb); //audio driver
 #endif
+    load_handheld_audio_mode();
 
     /* a hack to get the initial battery state on boot */
     pwrCb(FCHG_EVENT_DISCHARGE);