stack & internal memory optimization

will need to move pthread stack to external memory at some point ...
This commit is contained in:
philippe44
2019-08-20 23:04:41 -07:00
parent f547a52c1e
commit 217dd8e5f0
6 changed files with 14 additions and 10 deletions

View File

@@ -18,6 +18,10 @@
#include "trace.h"
#ifndef CONFIG_AIRPLAY_NAME
#define CONFIG_AIRPLAY_NAME "disabled"
#endif
static const char * TAG = "platform";
extern char current_namespace[];

View File

@@ -19,10 +19,10 @@
#define PTHREAD_STACK_MIN 256
#endif
#define STREAM_THREAD_STACK_SIZE 8 * 1024
#define DECODE_THREAD_STACK_SIZE 20 * 1024
#define OUTPUT_THREAD_STACK_SIZE 8 * 1024
#define IR_THREAD_STACK_SIZE 8 * 1024
#define STREAM_THREAD_STACK_SIZE 6 * 1024
#define DECODE_THREAD_STACK_SIZE 16 * 1024
#define OUTPUT_THREAD_STACK_SIZE 6 * 1024
#define IR_THREAD_STACK_SIZE 6 * 1024
//#define BASE_CAP "Model=squeezelite,AccuratePlayPoints=0,HasDigitalOut=1,HasPolarityInversion=1,Firmware=" VERSION

View File

@@ -139,7 +139,7 @@ static decode_state opus_decompress(void) {
info = OP(u, head, u->of, -1);
LOCK_O;
output.next_sample_rate = 48000;
output.next_sample_rate = decode_newstream(48000, output.supported_rates);
IF_DSD( output.next_fmt = PCM; )
output.track_start = outputbuf->writep;
if (output.fade_mode) _checkfade(true);

View File

@@ -86,7 +86,7 @@ typedef enum { DAC_ON = 0, DAC_OFF, DAC_POWERDOWN, DAC_VOLUME } dac_cmd_e;
// must have an integer ratio with FRAME_BLOCK
#define DMA_BUF_LEN 512
#define DMA_BUF_COUNT 16
#define DMA_BUF_COUNT 12
#define DECLARE_ALL_MIN_MAX \
DECLARE_MIN_MAX(o); \
@@ -307,7 +307,7 @@ void output_init_i2s(log_level level, char *device, unsigned output_buf_size, ch
pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN + OUTPUT_THREAD_STACK_SIZE);
pthread_create_name(&thread, &attr, output_thread_i2s, NULL, "output_i2s");
pthread_attr_destroy(&attr);
// leave stack size to default
pthread_create_name(&stats_thread, NULL, output_thread_i2s_stats, NULL, "output_i2s_sts");
}
@@ -404,7 +404,7 @@ static void *output_thread_i2s() {
// spdif needs 16 bytes per frame : 32 bits/sample, 2 channels, BMC encoded
if (spdif && (sbuf = malloc(FRAME_BLOCK * 16)) == NULL) {
LOG_ERROR("Cannot allocate SPDIF buffer");
}
}
while (running) {