diff --git a/components/squeezelite/output_i2s.c b/components/squeezelite/output_i2s.c index 1858f2704..e65cef337 100644 --- a/components/squeezelite/output_i2s.c +++ b/components/squeezelite/output_i2s.c @@ -97,6 +97,7 @@ extern struct outputstate output; extern struct buffer *streambuf; extern struct buffer *outputbuf; extern u8_t *silencebuf; +extern void simple_restart(); const struct adac_s *dac_set[] = { &dac_tas57xx, &dac_tas5713, &dac_ac101, &dac_wm8978, NULL }; const struct adac_s *adac = &dac_external; @@ -143,8 +144,8 @@ static bool handler(u8_t *data, int len){ if (!strncmp((char*) data, "audo", 4)) { struct audo_packet *pkt = (struct audo_packet*) data; - // 0 = headphone (internal speakers off)/jack mutes amp/anaolgue, 1 = sub out/digital, - // 2 = always on (internal speakers on)/no mute/anaologue, 3 = always off + // 0 = headphone (internal speakers off)/jack mutes amp/default set, 1 = sub out/set 2, + // 2 = always on (internal speakers on)/no mute, 3 = always off if (jack_mutes_amp != (pkt->config == 0)) { jack_mutes_amp = pkt->config == 0; @@ -162,8 +163,7 @@ static bool handler(u8_t *data, int len){ sub_output_enabled = pkt->config == 1; config_set_value(NVS_TYPE_STR, "autoexec", sub_output_enabled ? "2" : "1"); - vTaskDelay(750 / portTICK_PERIOD_MS); - esp_restart(); + simple_restart(); } } LOG_INFO("got AUDO %02x", pkt->config); diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild index a7019049e..bdb409524 100644 --- a/main/Kconfig.projbuild +++ b/main/Kconfig.projbuild @@ -465,9 +465,16 @@ menu "Squeezelite-ESP32" channel=<0..7>,scale=,atten=,cells=<1..3> endmenu - config DEFAULT_COMMAND_LINE - string "Default command line to execute" - default "squeezelite -o I2S -b 500:2000 -d all=info -C 30" - help - This is the command to run when starting the device + menu "Command sets" + config DEFAULT_COMMAND_LINE + string "Default command line to execute" + default "squeezelite -o I2S -b 500:2000 -d all=info -C 30" + help + This is the command to run when starting the device + config DEFAULT_COMMAND_2_LINE + string "Alternative command line to execute" + default "squeezelite -o spdif -b 500:2000 -d all=info -C 30" + help + This is the command to run when starting the device in set 2 + endmenu endmenu \ No newline at end of file diff --git a/main/esp_app_main.c b/main/esp_app_main.c index d1d671d38..c5b8daf74 100644 --- a/main/esp_app_main.c +++ b/main/esp_app_main.c @@ -246,6 +246,7 @@ void register_default_nvs(){ register_default_with_mac("ap_ssid", CONFIG_DEFAULT_AP_SSID); register_default_string_val("autoexec","1"); register_default_with_mac("autoexec1",CONFIG_DEFAULT_COMMAND_LINE " -n " DEFAULT_HOST_NAME); + register_default_with_mac("autoexec1_2",CONFIG_DEFAULT_COMMAND_2_LINE " -n " DEFAULT_HOST_NAME); register_default_string_val("release_url", CONFIG_SQUEEZELITE_ESP32_RELEASE_URL); register_default_string_val("ap_ip_address",CONFIG_DEFAULT_AP_IP);