mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-03-21 22:09:28 +00:00
Compare commits
3 Commits
I2S-4MFlas
...
I2S-4MFlas
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d9eaf4109 | ||
|
|
3f0882ead6 | ||
|
|
9717f8288e |
@@ -21,7 +21,6 @@
|
||||
#define USE_IRAM
|
||||
#define PAGE_BLOCK 2048
|
||||
#define ENABLE_WRITE 0x2c
|
||||
//(MADCTL_MX | TFT_RGB_BGR)
|
||||
#define MADCTL_MX 0x40
|
||||
#define TFT_RGB_BGR 0x08
|
||||
|
||||
|
||||
@@ -142,12 +142,12 @@ LMS_CALLBACK(down, ARROW_DOWN, arrow_down)
|
||||
LMS_CALLBACK(left, ARROW_LEFT, arrow_left)
|
||||
LMS_CALLBACK(right, ARROW_RIGHT, arrow_right)
|
||||
|
||||
LMS_CALLBACK(pre1, PRESET_1, preset1.single)
|
||||
LMS_CALLBACK(pre2, PRESET_2, preset2.single)
|
||||
LMS_CALLBACK(pre3, PRESET_3, preset3.single)
|
||||
LMS_CALLBACK(pre4, PRESET_4, preset4.single)
|
||||
LMS_CALLBACK(pre5, PRESET_5, preset5.single)
|
||||
LMS_CALLBACK(pre6, PRESET_6, preset6.single)
|
||||
LMS_CALLBACK(pre1, PRESET_1, preset_1.single)
|
||||
LMS_CALLBACK(pre2, PRESET_2, preset_2.single)
|
||||
LMS_CALLBACK(pre3, PRESET_3, preset_3.single)
|
||||
LMS_CALLBACK(pre4, PRESET_4, preset_4.single)
|
||||
LMS_CALLBACK(pre5, PRESET_5, preset_5.single)
|
||||
LMS_CALLBACK(pre6, PRESET_6, preset_6.single)
|
||||
|
||||
LMS_CALLBACK(knob_left, KNOB_LEFT, knob_left)
|
||||
LMS_CALLBACK(knob_right, KNOB_RIGHT, knob_right)
|
||||
|
||||
@@ -42,7 +42,7 @@ typedef unsigned long long u64_t;
|
||||
#define PLAYER_ID custom_player_id
|
||||
extern u8_t custom_player_id;
|
||||
|
||||
#define BASE_CAP "Model=squeezeesp32,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Firmware=" VERSION
|
||||
#define BASE_CAP "Model=squeezeesp32,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Balance=1,Firmware=" VERSION
|
||||
// to force some special buffer attribute
|
||||
#define EXT_BSS __attribute__((section(".ext_ram.bss")))
|
||||
|
||||
|
||||
@@ -254,8 +254,8 @@ frames_t _output_frames(frames_t avail) {
|
||||
|
||||
out_frames = !silence ? min(size, cont_frames) : size;
|
||||
|
||||
if (output.channels & 0x01) gainR = COPY_MONO;
|
||||
else if (output.channels & 0x02) gainL = COPY_MONO;
|
||||
if (output.channels & 0x01) gainR |= MONO_FLAG;
|
||||
if (output.channels & 0x02) gainL |= MONO_FLAG;
|
||||
|
||||
wrote = output.write_cb(out_frames, silence, gainL, gainR, cross_gain_in, cross_gain_out, &cross_ptr);
|
||||
|
||||
|
||||
@@ -50,6 +50,34 @@ s32_t to_gain(float f) {
|
||||
}
|
||||
|
||||
void _scale_and_pack_frames(void *outputptr, s32_t *inputptr, frames_t cnt, s32_t gainL, s32_t gainR, output_format format) {
|
||||
// in-place copy input samples if mono/combined is used (never happens with DSD active)
|
||||
if ((gainR & MONO_FLAG) && (gainL & MONO_FLAG)) {
|
||||
s32_t *ptr = inputptr;
|
||||
frames_t count = cnt;
|
||||
gainL &= ~MONO_FLAG; gainR &= ~MONO_FLAG;
|
||||
while (count--) {
|
||||
// use 64 bits integer for purists but should really not care
|
||||
*ptr = *(ptr + 1) = ((s64_t) *ptr + (s64_t) *(ptr + 1)) / 2;
|
||||
ptr += 2;
|
||||
}
|
||||
} else if (gainL & MONO_FLAG) {
|
||||
s32_t *ptr = inputptr + 1;
|
||||
frames_t count = cnt;
|
||||
gainL &= ~MONO_FLAG;
|
||||
while (count--) {
|
||||
*(ptr - 1) = *ptr;
|
||||
ptr += 2;
|
||||
}
|
||||
} else if (gainR & MONO_FLAG) {
|
||||
s32_t *ptr = inputptr;
|
||||
frames_t count = cnt;
|
||||
gainR &= ~MONO_FLAG;
|
||||
while (count--) {
|
||||
*(ptr + 1) = *ptr;
|
||||
ptr += 2;
|
||||
}
|
||||
}
|
||||
|
||||
switch(format) {
|
||||
#if DSD
|
||||
case U32_LE:
|
||||
@@ -364,13 +392,21 @@ inline
|
||||
void _apply_gain(struct buffer *outputbuf, frames_t count, s32_t gainL, s32_t gainR) {
|
||||
if (gainL == FIXED_ONE && gainR == FIXED_ONE) {
|
||||
return;
|
||||
} else if (gainL == COPY_MONO) {
|
||||
} if ((gainR & MONO_FLAG) && (gainL & MONO_FLAG)) {
|
||||
ISAMPLE_T *ptrL = (ISAMPLE_T *)(void *)outputbuf->readp;
|
||||
ISAMPLE_T *ptrR = (ISAMPLE_T *)(void *)outputbuf->readp + 1;
|
||||
gainL &= ~MONO_FLAG; gainR &= ~MONO_FLAG;
|
||||
while (count--) {
|
||||
*ptrL = *ptrR = (gain(gainL, *ptrL) + gain(gainR, *ptrR)) / 2;
|
||||
ptrL += 2; ptrR += 2;
|
||||
}
|
||||
} else if (gainL & MONO_FLAG) {
|
||||
ISAMPLE_T *ptr = (ISAMPLE_T *)(void *)outputbuf->readp + 1;
|
||||
while (count--) {
|
||||
*(ptr - 1) = *ptr = gain(gainR, *ptr);
|
||||
ptr += 2;
|
||||
}
|
||||
} else if (gainR == COPY_MONO) {
|
||||
} else if (gainR & MONO_FLAG) {
|
||||
ISAMPLE_T *ptr = (ISAMPLE_T *)(void *)outputbuf->readp;
|
||||
while (count--) {
|
||||
*(ptr + 1) = *ptr = gain(gainL, *ptr);
|
||||
|
||||
@@ -122,7 +122,7 @@ void send_packet(u8_t *packet, size_t len) {
|
||||
|
||||
static void sendHELO(bool reconnect, const char *fixed_cap, const char *var_cap, u8_t mac[6]) {
|
||||
#ifndef BASE_CAP
|
||||
#define BASE_CAP "Model=squeezelite,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Firmware=" VERSION
|
||||
#define BASE_CAP "Model=squeezelite,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Balance=1,Firmware=" VERSION
|
||||
#endif
|
||||
#define SSL_CAP "CanHTTPS=1"
|
||||
const char *base_cap;
|
||||
|
||||
@@ -472,7 +472,7 @@ void _wake_create(event_event*);
|
||||
#define MAX_SILENCE_FRAMES 2048
|
||||
|
||||
#define FIXED_ONE 0x10000
|
||||
#define COPY_MONO (FIXED_ONE + 1)
|
||||
#define MONO_FLAG 0x20000
|
||||
|
||||
#ifndef BYTES_PER_FRAME
|
||||
#define BYTES_PER_FRAME 8
|
||||
|
||||
Reference in New Issue
Block a user