Compare commits

..

6 Commits

Author SHA1 Message Date
Philippe G
c36d663a7f release 2021-10-07 11:23:17 -07:00
Philippe G
13294ddd0c Continue searching for STA in AP mode when SSID has been set 2021-10-05 12:22:46 -07:00
philippe44
449ef32a4e Update README.md 2021-10-02 12:46:52 -07:00
Philippe G
50390dbc61 Fix i2s mode for 32 bits & SPDIF - release 2021-09-24 18:19:50 -07:00
Philippe G
fc5f3f5ac9 remove extra UNLOCK_S in opus - release 2021-09-18 09:30:03 -07:00
Philippe G
6f4ed0679e fix 32 bits sample size L/R swap - release
issue is in esp-idf
2021-09-11 21:40:10 -07:00
6 changed files with 43 additions and 22 deletions

View File

@@ -23,7 +23,7 @@ Other features include
- Full web interface for further configuration/management - Full web interface for further configuration/management
- Firmware over-the-air update - Firmware over-the-air update
To control the equalizer or use the display on LMS, a new player model is required and this is provided through a plugin that can be found [here]( https://raw.githubusercontent.com/sle118/squeezelite-esp32/master/plugin/repo.xml) To control the equalizer or use the display on LMS, a new player model is required and this is provided through a plugin that is part of LMS' 3rd party repositories
## Performances ## Performances
*(opinions presented here so I = @philippe44)* *(opinions presented here so I = @philippe44)*

View File

@@ -928,8 +928,8 @@ static esp_err_t i2s_param_config(i2s_port_t i2s_num, const i2s_config_t *i2s_co
if (i2s_config->mode & I2S_MODE_TX) { if (i2s_config->mode & I2S_MODE_TX) {
// PATCH // PATCH
I2S[i2s_num]->conf.tx_msb_right = 1; I2S[i2s_num]->conf.tx_msb_right = i2s_config->bits_per_sample == 32 ? 0 : 1;
I2S[i2s_num]->conf.tx_right_first = 0; I2S[i2s_num]->conf.tx_right_first = ~I2S[i2s_num]->conf.tx_msb_right;
I2S[i2s_num]->conf.tx_slave_mod = 0; // Master I2S[i2s_num]->conf.tx_slave_mod = 0; // Master
I2S[i2s_num]->fifo_conf.tx_fifo_mod_force_en = 1; I2S[i2s_num]->fifo_conf.tx_fifo_mod_force_en = 1;
@@ -940,8 +940,7 @@ static esp_err_t i2s_param_config(i2s_port_t i2s_num, const i2s_config_t *i2s_co
} }
if (i2s_config->mode & I2S_MODE_RX) { if (i2s_config->mode & I2S_MODE_RX) {
// PATCH I2S[i2s_num]->conf.rx_msb_right = 1;
I2S[i2s_num]->conf.rx_msb_right = 1;
I2S[i2s_num]->conf.rx_right_first = 0; I2S[i2s_num]->conf.rx_right_first = 0;
I2S[i2s_num]->conf.rx_slave_mod = 0; // Master I2S[i2s_num]->conf.rx_slave_mod = 0; // Master
I2S[i2s_num]->fifo_conf.rx_fifo_mod_force_en = 1; I2S[i2s_num]->fifo_conf.rx_fifo_mod_force_en = 1;

View File

@@ -229,7 +229,6 @@ static decode_state opus_decompress(void) {
if (stream.state <= DISCONNECT) { if (stream.state <= DISCONNECT) {
LOG_INFO("partial decode"); LOG_INFO("partial decode");
UNLOCK_O_direct; UNLOCK_O_direct;
UNLOCK_S;
return DECODE_COMPLETE; return DECODE_COMPLETE;
} else { } else {
LOG_INFO("no frame decoded"); LOG_INFO("no frame decoded");

View File

@@ -238,10 +238,7 @@ void output_init_i2s(log_level level, char *device, unsigned output_buf_size, ch
set_i2s_pin(spdif_config, &i2s_spdif_pin); set_i2s_pin(spdif_config, &i2s_spdif_pin);
set_i2s_pin(dac_config, &i2s_dac_pin); set_i2s_pin(dac_config, &i2s_dac_pin);
/* BEWARE: i2s. must be patched to set tx_msb_right/rx_msb_right to 1 /* BEWARE: i2s.c must be patched otherwise L/R are swapped in 32 bits mode */
* or SPDIF will not work. These settings are not accessible from
* userland and I don't know why
*/
// common I2S initialization // common I2S initialization
i2s_config.mode = I2S_MODE_MASTER | I2S_MODE_TX; i2s_config.mode = I2S_MODE_MASTER | I2S_MODE_TX;

View File

@@ -84,7 +84,6 @@ SemaphoreHandle_t wifi_manager_json_mutex = NULL;
SemaphoreHandle_t wifi_manager_sta_ip_mutex = NULL; SemaphoreHandle_t wifi_manager_sta_ip_mutex = NULL;
char *wifi_manager_sta_ip = NULL; char *wifi_manager_sta_ip = NULL;
#define STA_IP_LEN sizeof(char) * IP4ADDR_STRLEN_MAX #define STA_IP_LEN sizeof(char) * IP4ADDR_STRLEN_MAX
bool bHasConnected=false;
uint16_t ap_num = MAX_AP_NUM; uint16_t ap_num = MAX_AP_NUM;
wifi_ap_record_t *accessp_records=NULL; wifi_ap_record_t *accessp_records=NULL;
cJSON * accessp_cjson=NULL; cJSON * accessp_cjson=NULL;
@@ -108,6 +107,9 @@ static const char TAG[] = "wifi_manager";
/* @brief task handle for the main wifi_manager task */ /* @brief task handle for the main wifi_manager task */
static TaskHandle_t task_wifi_manager = NULL; static TaskHandle_t task_wifi_manager = NULL;
#define STA_POLLING_MIN (15*1000)
#define STA_POLLING_MAX (10*60*1000)
/** /**
* The actual WiFi settings in use * The actual WiFi settings in use
*/ */
@@ -266,7 +268,6 @@ void wifi_manager_init_wifi(){
/* event handler and event group for the wifi driver */ /* event handler and event group for the wifi driver */
ESP_LOGD(TAG, "Initializing wifi. Creating event group"); ESP_LOGD(TAG, "Initializing wifi. Creating event group");
wifi_manager_event_group = xEventGroupCreate(); wifi_manager_event_group = xEventGroupCreate();
bHasConnected=false;
// Now Initialize the Wifi Stack // Now Initialize the Wifi Stack
ESP_LOGD(TAG, "Initializing wifi. Initializing tcp_ip adapter"); ESP_LOGD(TAG, "Initializing wifi. Initializing tcp_ip adapter");
tcpip_adapter_init(); tcpip_adapter_init();
@@ -303,6 +304,9 @@ static void connect_notify(in_addr_t ip, u16_t hport, u16_t cport) {
wifi_manager_update_status(); wifi_manager_update_status();
} }
static void polling_STA(void* timer_id) {
wifi_manager_send_message(ORDER_CONNECT_STA, (void*)CONNECTION_REQUEST_AUTO_RECONNECT);
}
void wifi_manager_start(){ void wifi_manager_start(){
@@ -1215,6 +1219,11 @@ void wifi_manager( void * pvParameters ){
EventBits_t uxBits; EventBits_t uxBits;
uint8_t retries = 0; uint8_t retries = 0;
esp_err_t err=ESP_OK; esp_err_t err=ESP_OK;
TimerHandle_t STA_timer;
uint32_t STA_duration = STA_POLLING_MIN;
/* create timer for background STA connection */
STA_timer = xTimerCreate("background STA", pdMS_TO_TICKS(STA_duration), pdFALSE, NULL, polling_STA);
/* start http server */ /* start http server */
http_server_start(); http_server_start();
@@ -1520,23 +1529,38 @@ void wifi_manager( void * pvParameters ){
if(retries < WIFI_MANAGER_MAX_RETRY){ if(retries < WIFI_MANAGER_MAX_RETRY){
ESP_LOGD(TAG, "Issuing ORDER_CONNECT_STA to retry connection."); ESP_LOGD(TAG, "Issuing ORDER_CONNECT_STA to retry connection.");
if(!bHasConnected) retries++; retries++;
wifi_manager_send_message(ORDER_CONNECT_STA, (void*)CONNECTION_REQUEST_AUTO_RECONNECT); wifi_manager_send_message(ORDER_CONNECT_STA, (void*)CONNECTION_REQUEST_AUTO_RECONNECT);
} }
else{ else{
/* In this scenario the connection was lost beyond repair: kick start the AP! */ /* In this scenario the connection was lost beyond repair: kick start the AP! */
retries = 0; retries = 0;
wifi_mode_t mode;
ESP_LOGW(TAG, "All connect retry attempts failed."); ESP_LOGW(TAG, "All connect retry attempts failed.");
/* put us in softAP mode first */
esp_wifi_get_mode(&mode);
/* if it was a restore attempt connection, we clear the bit */ /* if it was a restore attempt connection, we clear the bit */
xEventGroupClearBits(wifi_manager_event_group, WIFI_MANAGER_REQUEST_RESTORE_STA_BIT); xEventGroupClearBits(wifi_manager_event_group, WIFI_MANAGER_REQUEST_RESTORE_STA_BIT);
ESP_LOGD(TAG, "Issuing ORDER_START_AP to trigger AP start."); if(WIFI_MODE_APSTA != mode){
/* start SoftAP */ /* call directly config_ap because we don't want to scan so the message has no benefit */
wifi_manager_send_message(ORDER_START_AP, NULL); ESP_LOGD(TAG, "Starting AP directly.");
wifi_manager_config_ap();
STA_duration = STA_POLLING_MIN;
/* manual callback if needed */
if(cb_ptr_arr[ORDER_START_AP]) (*cb_ptr_arr[ORDER_START_AP])(NULL);
}
else if(STA_duration < STA_POLLING_MAX) {
STA_duration *= 1.25;
}
xTimerChangePeriod(STA_timer, pdMS_TO_TICKS(STA_duration), portMAX_DELAY);
xTimerStart(STA_timer, portMAX_DELAY);
ESP_LOGD(TAG, "STA search slow polling of %d", STA_duration);
} }
} }
/* callback */ /* callback */
if(cb_ptr_arr[msg.code]) (*cb_ptr_arr[msg.code])(NULL); if(cb_ptr_arr[msg.code]) (*cb_ptr_arr[msg.code])(NULL);
} }
@@ -1588,7 +1612,9 @@ void wifi_manager( void * pvParameters ){
/* bring down DNS hijack */ /* bring down DNS hijack */
ESP_LOGD(TAG, "Stopping dns server."); ESP_LOGD(TAG, "Stopping dns server.");
dns_server_stop(); dns_server_stop();
bHasConnected=true;
/* stop AP mode */
esp_wifi_set_mode(WIFI_MODE_STA);
/* callback */ /* callback */
if(cb_ptr_arr[msg.code]) (*cb_ptr_arr[msg.code])(NULL); if(cb_ptr_arr[msg.code]) (*cb_ptr_arr[msg.code])(NULL);

View File

@@ -107,8 +107,8 @@ PLUGIN_SQUEEZEESP32_ARTWORK_Y
EN Y EN Y
PLUGIN_SQUEEZEESP32_EQUALIZER PLUGIN_SQUEEZEESP32_EQUALIZER
DE Parametrischer Equalizer DE Grafischer Equalizer
EN Parametric equalizer EN Graphic equalizer
PLUGIN_SQUEEZEESP32_EQUALIZER_SAVE PLUGIN_SQUEEZEESP32_EQUALIZER_SAVE
DE Bitte speichern Sie die Equalizer Einstellungen, falls das Gerät diese dauerhaft verwenden soll. Ansonsten werden sie beim nächsten Start zurückgesetzt. DE Bitte speichern Sie die Equalizer Einstellungen, falls das Gerät diese dauerhaft verwenden soll. Ansonsten werden sie beim nächsten Start zurückgesetzt.