summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-demo/recipes-connectivity/bluez5/bluez5_%.bbappend
diff options
context:
space:
mode:
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>2018-05-15 14:46:21 +0200
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>2018-05-31 18:16:00 +0200
commitb43165328658087277b667152fdbc04fe07cba08 (patch)
treed1540adb65af28e41e9ebdfdbfe8b08470cb6887 /meta-agl-profile-demo/recipes-connectivity/bluez5/bluez5_%.bbappend
parentc40ee88f6aa0b379787a9ea3c853a806892e0dd1 (diff)
3rd part of the layer/profile rework [1/2]
This is the last larger commit in this series and deals with the graphical part. We introduce the graphical profiles: - meta-agl-profile-graphical -- meta-agl-profile-graphical-html5 -- meta-agl-profile-graphical-qt5 Notable changes: - weston-ini-conf moved to the meta-agl-bsp layer. Most BSPs have bbappends, so we need to have the recipes present (but unused) even in the console images. - new image: agl-image-boot = terminal-only + network + package-manaager. Ready for using package-feeds - new image/sdk: agl-image-minimal-crosssdk - agl-service-mediaplayer has a dependency on weston, thus it cannot be in the 'core'. Moved it to profile-graphical. - The wayland-ivi-extension moved to the agl-demo-platform. - The app-framework layer included and pulled 'web-runtime' as dependency. This broke console-only images. This has been moved to be in meta-agl-demo only for now. - added and massaged the agl-features. - found and added a useful script 'oe-depends-dot' that helps to work with the dot files (produced with bitbake -g) Todo: - we'll need another pass through the packagegroups. The dependencies for the layers/profiles are now sorted-out but we might have to add/shuffle a few packages. For further details, see meta-agl/docs/profiles.md. v2: fix meta-agl/meta-security/conf/layer.conf - the immediate expansion previously used in there caused some recipes not being added to BBFILES. v3: fix packagegroup renaming (packagegroup-agl-devel -> packagegroup-agl-core-devel) v4: fix missing packagegroup inclusion (tnx Jose, Scott, Stephane) v5: fix missing packagegroup inclusion v6: explicitely put profile-graphical-qt5 on-top of profile-graphical v7: re-add 'procps' when agl-devel feature is on Bug-AGL: SPEC-145 Change-Id: I24cdcd1118932758d0c55d333338238f2a770877 Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'meta-agl-profile-demo/recipes-connectivity/bluez5/bluez5_%.bbappend')
-rw-r--r--meta-agl-profile-demo/recipes-connectivity/bluez5/bluez5_%.bbappend13
1 files changed, 0 insertions, 13 deletions
diff --git a/meta-agl-profile-demo/recipes-connectivity/bluez5/bluez5_%.bbappend b/meta-agl-profile-demo/recipes-connectivity/bluez5/bluez5_%.bbappend
deleted file mode 100644
index c5afa875f..000000000
--- a/meta-agl-profile-demo/recipes-connectivity/bluez5/bluez5_%.bbappend
+++ /dev/null
@@ -1,13 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
-SRC_URI_append = " file://bluetooth.conf"
-
-APPLY_v522 = "${@str('no' if '${PV}' != '5.22' else 'yes')}"
-
-SRC_URI_append = "\
- file://0001_fix_compile_issue_when_using_in_c++.patch;apply=${APPLY_v522} \
-"
-
-
-do_install_append() {
- install -m 0644 ${WORKDIR}/bluetooth.conf ${D}${sysconfdir}/dbus-1/system.d/bluetooth.conf
-}
ame.Constant */ .highlight .nd { color: #a6e22e } /* Name.Decorator */ .highlight .ni { color: #f8f8f2 } /* Name.Entity */ .highlight .ne { color: #a6e22e } /* Name.Exception */ .highlight .nf { color: #a6e22e } /* Name.Function */ .highlight .nl { color: #f8f8f2 } /* Name.Label */ .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ .highlight .nx { color: #a6e22e } /* Name.Other */ .highlight .py { color: #f8f8f2 } /* Name.Property */ .highlight .nt { color: #f92672 } /* Name.Tag */ .highlight .nv { color: #f8f8f2 } /* Name.Variable */ .highlight .ow { color: #f92672 } /* Operator.Word */ .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */ .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ .highlight .sa { color: #e6db74 } /* Literal.String.Affix */ .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ .highlight .sc { color: #e6db74 } /* Literal.String.Char */ .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */ .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
FM configuration improvements

Changes include:
- Add command-line option for selecting FM band plan.  The default
  band plan is US / Canada.
- Add command-line options for setting FM scanning valid SNR and RSSI
  thresholds to allow tweaking sensitivity in poor radio environments.
- Increased seeking scan timeout to 3 seconds, which seems to improve
  behavior in poor radio environments where powerful stations may be
  far apart.
- Removed explicit setting of FM_SOFTMUTE_SNR_LIMITS, as it seemed
  like it might be resulting in odd muting behavior when scanning.
- Changed initial FM frequency if not specified to the minimum of the
  band plan.

Signed-off-by: Scott Murray <scott.murray@konsulko.com>

diff --git a/si46xx.h b/si46xx.h
index 172ea8b..c32fca4 100644
--- a/si46xx.h
+++ b/si46xx.h
@@ -83,6 +83,7 @@
 #define SI46XX_PIN_CONFIG_ENABLE 0x0800
 #define SI46XX_FM_SEEK_BAND_BOTTOM 0x3100
 #define SI46XX_FM_SEEK_BAND_TOP 0x3101
+#define SI46XX_FM_SEEK_FREQUENCY_SPACING 0x3102
 #define SI46XX_FM_VALID_MAX_TUNE_ERROR 0x3200
 #define SI46XX_FM_VALID_RSSI_TIME 0x3201
 #define SI46XX_FM_VALID_RSSI_THRESHOLD 0x3202
@@ -150,7 +151,7 @@
 #define MAX_SERVICES 32
 #define MAX_COMPONENTS 15
 
-#define TIMEOUT_SEEK	2000	/* mS = 2S */
+#define TIMEOUT_SEEK	3000	/* mS = 3S */
 #define TIMEOUT_TUNE	500	/* mS = .5S */
 
 struct dab_service_t{
diff --git a/si_ctl.c b/si_ctl.c
index 59dfaf2..f168218 100644
--- a/si_ctl.c
+++ b/si_ctl.c
@@ -101,6 +101,26 @@ uint32_t frequency_list_ch[] = {	CHAN_12A,
 					CHAN_9D,
 					CHAN_8B};
 
+// Structure to describe FM band plans, all values in Hz.
+typedef struct {
+	char *name;
+	uint32_t min;
+	uint32_t max;
+	uint32_t step;
+} fm_band_plan_t;
+
+static fm_band_plan_t known_fm_band_plans[5] = {
+	{ .name = "US", .min = 87900000, .max = 107900000, .step = 200000 },
+	{ .name = "JP", .min = 76000000, .max = 95000000, .step = 100000 },
+	{ .name = "EU", .min = 87500000, .max = 108000000, .step = 50000 },
+	{ .name = "ITU-1", .min = 87500000, .max = 108000000, .step = 50000 },
+	{ .name = "ITU-2", .min = 87900000, .max = 107900000, .step = 50000 }
+};
+
+static unsigned int fm_band_plan;
+static int fm_snr_threshold = 128;
+static int fm_rssi_threshold = 128;
+
 int init_am(int offset)
 {
 	int ret;
@@ -160,12 +180,32 @@ int init_fm(int offset)
 	 * enable I2S output
 	 */
 	si46xx_set_property(SI46XX_PIN_CONFIG_ENABLE, 0x0003);
-	//si46xx_set_property(SI46XX_FM_VALID_RSSI_THRESHOLD,0x0000);
-	//si46xx_set_property(SI46XX_FM_VALID_SNR_THRESHOLD,0x0000);
-	si46xx_set_property(SI46XX_FM_SOFTMUTE_SNR_LIMITS, 0x0000); // set the SNR limits for soft mute attenuation
+	//si46xx_set_property(SI46XX_FM_SOFTMUTE_SNR_LIMITS, 0x0000); // set the SNR limits for soft mute attenuation
 	si46xx_set_property(SI46XX_FM_TUNE_FE_CFG, 0x0000); // front end switch open
-	si46xx_set_property(SI46XX_FM_SEEK_BAND_BOTTOM, 88000 / 10);
-	si46xx_set_property(SI46XX_FM_SEEK_BAND_TOP, 108000 / 10);
+
+	//si46xx_set_property(SI46XX_FM_SEEK_BAND_BOTTOM, 88000 / 10);
+	//si46xx_set_property(SI46XX_FM_SEEK_BAND_TOP, 108000 / 10);
+	if (verbose)
+		fprintf(stderr, "Using FM Bandplan: %s\n", known_fm_band_plans[fm_band_plan].name);
+	si46xx_set_property(SI46XX_FM_SEEK_BAND_BOTTOM, known_fm_band_plans[fm_band_plan].min / 10000);
+	si46xx_set_property(SI46XX_FM_SEEK_BAND_TOP, known_fm_band_plans[fm_band_plan].max / 10000);
+	if (verbose)
+		fprintf(stderr, "Using FM band: %d - %d, %d spacing\n",
+			known_fm_band_plans[fm_band_plan].min / 10000,
+			known_fm_band_plans[fm_band_plan].max / 10000,
+			known_fm_band_plans[fm_band_plan].step / 10000);
+	si46xx_set_property(SI46XX_FM_SEEK_FREQUENCY_SPACING, known_fm_band_plans[fm_band_plan].step / 10000);
+	if (fm_snr_threshold != 128) {
+		if (verbose)
+			fprintf(stderr, "Setting FM valid SNR threshold to %d dB\n", fm_snr_threshold);
+		si46xx_set_property(SI46XX_FM_VALID_SNR_THRESHOLD, fm_snr_threshold);
+	}
+	if (fm_rssi_threshold != 128) {
+		if (verbose)
+			fprintf(stderr, "Setting FM valid RSSI threshold to %d dB\n", fm_rssi_threshold);
+		si46xx_set_property(SI46XX_FM_VALID_RSSI_THRESHOLD, fm_rssi_threshold);
+	}
+
 	/*
 	 * rate
 	 */
@@ -190,6 +230,7 @@ int init_fm(int offset)
 
 	return 0;
 }
+
 int init_dab(int offset)
 {
 	int ret;
@@ -245,6 +286,10 @@ int output_help(char *prog_name)
 	printf("  -l up|down     FM/AM seek next station\n");
 	printf("  -d             FM/AM RSQ status\n");
 	printf("  -m             FM rds status\n");
+	printf("Common FM:\n");
+	printf("  -p bandplan    FM bandplan (us, jp, eu, itu-1, itu-2\n");
+	printf("  -t SNR         FM scan valid SNR threshold (-127 to 127 dB)\n");
+	printf("  -u RSSI        FM scan valid RSSI threshold (-127 to 127 dBuV)\n");
 	printf("DAB only:\n");
 	printf("  -e             dab status\n");
 	printf("  -f service     start service of dab service list\n");
@@ -354,6 +399,7 @@ int main(int argc, char **argv)
 	int offset = - 1;
 	int mode;
 	int tmp;
+	unsigned int i;
 	struct dab_digrad_status_t dab_digrad_status;
 	bool init = false;
 	bool seek_up = false;
@@ -374,7 +420,7 @@ int main(int argc, char **argv)
 
 	optind = 0;
 	while (optind < argc) {
-		if ((c = getopt(argc, argv, "a:b:c:def:ghi:j:k:l:mnosv")) != -1) {
+		if ((c = getopt(argc, argv, "a:b:c:def:ghi:j:k:l:mnop:st:u:v")) != -1) {
 			switch(c){
 			/* init */
 			case 'a':
@@ -422,6 +468,31 @@ int main(int argc, char **argv)
 			case 'c':
 				frequency = atoi(optarg);
 				break;
+			/* FM */
+			case 'p':
+				for(i = 0;
+				    i < sizeof(known_fm_band_plans) / sizeof(fm_band_plan_t);
+				    i++) {
+					if(!strcasecmp(optarg, known_fm_band_plans[i].name)) {
+						fm_band_plan = i;
+						break;
+					}
+				}
+				if(i >= (sizeof(known_fm_band_plans) / sizeof(fm_band_plan_t))) {
+					printf("Invalid mode: %s\n", optarg);
+					return -EINVAL;
+				}
+				break;
+			case 't':
+				fm_snr_threshold = atoi(optarg);
+				if(fm_snr_threshold < -128 || fm_snr_threshold > 127)
+					fm_snr_threshold = 128; // use firmware default
+				break;
+			case 'u':
+				fm_rssi_threshold = atoi(optarg);
+				if(fm_rssi_threshold < -128 || fm_rssi_threshold > 127)
+					fm_rssi_threshold = 128; // use firmware default
+				break;
 			/* DAB stuff. TODO: rework */
 			case 'e':
 				si46xx_dab_digrad_status(&dab_digrad_status);
@@ -473,7 +544,7 @@ int main(int argc, char **argv)
 			case SI46XX_MODE_FM:
 				ret = init_fm(offset);
 				if (frequency < 0)
-					frequency = 105500;
+					frequency = known_fm_band_plans[fm_band_plan].min / 1000;
 			break;
 			case SI46XX_MODE_AM:
 				ret = init_am(offset);