From 7d2064aca9f25aee30662617a4d968baeaf5d661 Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org>
Date: Tue, 4 Jan 2022 17:40:11 +0530
Subject: [PATCH] attempt to start pihpsdr faster with the first discovered
 device

---
 discovery.c | 11 ++++++-----
 protocols.c |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/discovery.c b/discovery.c
index 7fdfaa1..6fcf6e0 100644
--- a/discovery.c
+++ b/discovery.c
@@ -353,10 +353,10 @@ void discovery() {
     old_discovery();
   }
 
-  if(enable_protocol_2) {
-    status_text("Protocol 2 ... Discovering Devices");
-    new_discovery();
-  }
+  /* if(enable_protocol_2) { */
+  /*   status_text("Protocol 2 ... Discovering Devices"); */
+  /*   new_discovery(); */
+  /* } */
 
 #ifdef SOAPYSDR
   if(enable_soapy_protocol) {
@@ -622,7 +622,8 @@ fprintf(stderr,"showing device dialog\n");
     // autostart if one device and autostart enabled
     g_print("%s: devices=%d autostart=%d\n",__FUNCTION__,devices,autostart);
 
-    if(devices==1 && autostart) {
+    // if(devices==1 && autostart) {
+    if(autostart) {
         d=&discovered[0];
 	if(d->status==STATE_AVAILABLE) {
           if(start_cb(NULL,NULL,(gpointer)d)) return;
diff --git a/protocols.c b/protocols.c
index 006ab2d..8334244 100644
--- a/protocols.c
+++ b/protocols.c
@@ -86,7 +86,7 @@ void protocols_restore_state() {
   value=getProperty("enable_stemlab");
   if(value) enable_stemlab=atoi(value);
 #endif
-  autostart=FALSE;
+  autostart=TRUE;
   value=getProperty("autostart");
   if(value) autostart=atoi(value);
 
-- 
2.45.2