Compare commits

...

8 Commits

Author SHA1 Message Date
Philippe G
96a05d8a6b fix opus error -136 (increase pseudo-stack) - release 2021-10-24 11:12:28 -07:00
philippe44
7a9f3e0781 Update README.md 2021-10-24 00:00:43 -07:00
Philippe G
3575245324 extra callback in preset caused NULL call - release 2021-10-20 21:24:36 -07:00
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
7 changed files with 42 additions and 18 deletions

View File

@@ -23,7 +23,7 @@ Other features include
- Full web interface for further configuration/management
- 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
*(opinions presented here so I = @philippe44)*
@@ -479,7 +479,7 @@ If you have already cloned the repository and you are getting compile errors on
- per mad & few others, edit configure and change $ac_link to add -c (faking link)
- change ac_files to remove ''
- add DEPS_CFLAGS and DEPS_LIBS to avoid pkg-config to be required
- stack consumption can be very high with some codec variants, so set NONTHREADSAFE_PSEUDOSTACK and GLOBAL_STACK_SIZE=32000 and unset VAR_ARRAYS in config.h
- stack consumption can be very high with some codec variants, so set NONTHREADSAFE_PSEUDOSTACK and GLOBAL_STACK_SIZE=40000 and unset VAR_ARRAYS in config.h
- libmad has been patched to avoid using a lot of stack and is not provided here. There is an issue with sync detection in 1.15.1b from where the original stack patch was done but since a few fixes have been made wrt sync detection. This 1.15.1b-10 found on debian fixes the issue where mad thinks it has reached sync but has not and so returns a wrong sample rate. It comes at the expense of 8KB (!) of code where a simple check in squeezelite/mad.c that next_frame[0] is 0xff and next_frame[1] & 0xf0 is 0xf0 does the trick ...
# Footnotes

Binary file not shown.

Binary file not shown.

View File

@@ -88,7 +88,7 @@ const static actrls_t controls = {
NULL, NULL, // rew, fwd
raop_prev, raop_next, // prev, next
NULL, NULL, NULL, NULL, // left, right, up, down
NULL, NULL, NULL, NULL, NULL, NULL, NULL, // pre1-6
NULL, NULL, NULL, NULL, NULL, NULL, // pre1-6
raop_volume_down, raop_volume_up, raop_toggle// knob left, knob_right, knob push
};

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) {
// PATCH
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_msb_right = i2s_config->bits_per_sample == 32 ? 0 : 1;
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]->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) {
// PATCH
I2S[i2s_num]->conf.rx_msb_right = i2s_config->bits_per_sample == 32 ? 0 : 1;
I2S[i2s_num]->conf.rx_msb_right = 1;
I2S[i2s_num]->conf.rx_right_first = 0;
I2S[i2s_num]->conf.rx_slave_mod = 0; // Master
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) {
LOG_INFO("partial decode");
UNLOCK_O_direct;
UNLOCK_S;
return DECODE_COMPLETE;
} else {
LOG_INFO("no frame decoded");

View File

@@ -84,7 +84,6 @@ SemaphoreHandle_t wifi_manager_json_mutex = NULL;
SemaphoreHandle_t wifi_manager_sta_ip_mutex = NULL;
char *wifi_manager_sta_ip = NULL;
#define STA_IP_LEN sizeof(char) * IP4ADDR_STRLEN_MAX
bool bHasConnected=false;
uint16_t ap_num = MAX_AP_NUM;
wifi_ap_record_t *accessp_records=NULL;
cJSON * accessp_cjson=NULL;
@@ -108,6 +107,9 @@ static const char TAG[] = "wifi_manager";
/* @brief task handle for the main wifi_manager task */
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
*/
@@ -266,7 +268,6 @@ void wifi_manager_init_wifi(){
/* event handler and event group for the wifi driver */
ESP_LOGD(TAG, "Initializing wifi. Creating event group");
wifi_manager_event_group = xEventGroupCreate();
bHasConnected=false;
// Now Initialize the Wifi Stack
ESP_LOGD(TAG, "Initializing wifi. Initializing tcp_ip adapter");
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();
}
static void polling_STA(void* timer_id) {
wifi_manager_send_message(ORDER_CONNECT_STA, (void*)CONNECTION_REQUEST_AUTO_RECONNECT);
}
void wifi_manager_start(){
@@ -1215,6 +1219,11 @@ void wifi_manager( void * pvParameters ){
EventBits_t uxBits;
uint8_t retries = 0;
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 */
http_server_start();
@@ -1520,23 +1529,38 @@ void wifi_manager( void * pvParameters ){
if(retries < WIFI_MANAGER_MAX_RETRY){
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);
}
else{
/* In this scenario the connection was lost beyond repair: kick start the AP! */
retries = 0;
wifi_mode_t mode;
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 */
xEventGroupClearBits(wifi_manager_event_group, WIFI_MANAGER_REQUEST_RESTORE_STA_BIT);
ESP_LOGD(TAG, "Issuing ORDER_START_AP to trigger AP start.");
/* start SoftAP */
wifi_manager_send_message(ORDER_START_AP, NULL);
if(WIFI_MODE_APSTA != mode){
/* call directly config_ap because we don't want to scan so the message has no benefit */
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 */
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 */
ESP_LOGD(TAG, "Stopping dns server.");
dns_server_stop();
bHasConnected=true;
/* stop AP mode */
esp_wifi_set_mode(WIFI_MODE_STA);
/* callback */
if(cb_ptr_arr[msg.code]) (*cb_ptr_arr[msg.code])(NULL);