Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ CIRCUITPY_USB_DEVICE_INSTANCE = FULL_SPEED_INSTANCE
CIRCUITPY_AUDIOFILEWRITER = 1
CIRCUITPY_USB_HOST = 1
CIRCUITPY_USB_HOST_AUDIO = 1
CIRCUITPY_AUDIOTAP = 1
CIRCUITPY_ESP_HOSTED = 1

CIRCUITPY_ESP_FLASH_SIZE = 16MB
Expand Down
3 changes: 3 additions & 0 deletions ports/espressif/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ else ifeq ($(IDF_TARGET),esp32p4)

# No DAC
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_AUDIOFILTERS ?= 1
CIRCUITPY_AUDIOTAP ?= 1
CIRCUITPY_USB_HOST_AUDIO ?= $(CIRCUITPY_USB_HOST)

# MII is available on these targets with EMAC hardware.
CIRCUITPY_MII ?= 1
Expand Down
8 changes: 8 additions & 0 deletions shared-module/audiofilters/Distortion.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ audioio_get_buffer_result_t audiofilters_distortion_get_buffer(audiofilters_dist
self->last_buf_idx = !self->last_buf_idx;

// If we are using 16 bit samples we need a 16 bit pointer, 8 bit needs an 8 bit pointer
// buffer[] was allocated on the heap, so it is aligned for 16-bit access.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
int16_t *word_buffer = (int16_t *)self->buffer[self->last_buf_idx];
#pragma GCC diagnostic pop
int8_t *hword_buffer = self->buffer[self->last_buf_idx];
uint32_t length = self->buffer_len / (self->base.bits_per_sample / 8);

Expand Down Expand Up @@ -231,7 +235,11 @@ audioio_get_buffer_result_t audiofilters_distortion_get_buffer(audiofilters_dist
// Determine how many bytes we can process to our buffer, the less of the sample we have left and our buffer remaining
uint32_t n = MIN(MIN(self->sample_buffer_length, length), SYNTHIO_MAX_DUR * self->base.channel_count);

// The source's buffer is aligned, and it is only advanced in whole samples.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
int16_t *sample_src = (int16_t *)self->sample_remaining_buffer; // for 16-bit samples
#pragma GCC diagnostic pop
int8_t *sample_hsrc = (int8_t *)self->sample_remaining_buffer; // for 8-bit samples

// get the effect values we need from the BlockInput. These may change at run time so you need to do bounds checking if required
Expand Down
8 changes: 8 additions & 0 deletions shared-module/audiofilters/Filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ audioio_get_buffer_result_t audiofilters_filter_get_buffer(audiofilters_filter_o
self->last_buf_idx = !self->last_buf_idx;

// If we are using 16 bit samples we need a 16 bit pointer, 8 bit needs an 8 bit pointer
// buffer[] was allocated on the heap, so it is aligned for 16-bit access.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
int16_t *word_buffer = (int16_t *)self->buffer[self->last_buf_idx];
#pragma GCC diagnostic pop
int8_t *hword_buffer = self->buffer[self->last_buf_idx];
uint32_t length = self->buffer_len / (self->base.bits_per_sample / 8);

Expand Down Expand Up @@ -188,7 +192,11 @@ audioio_get_buffer_result_t audiofilters_filter_get_buffer(audiofilters_filter_o
// Determine how many bytes we can process to our buffer, the less of the sample we have left and our buffer remaining
uint32_t n = MIN(MIN(self->sample_buffer_length, length), SYNTHIO_MAX_DUR * self->base.channel_count);

// The source's buffer is aligned, and it is only advanced in whole samples.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
int16_t *sample_src = (int16_t *)self->sample_remaining_buffer; // for 16-bit samples
#pragma GCC diagnostic pop
int8_t *sample_hsrc = (int8_t *)self->sample_remaining_buffer; // for 8-bit samples

// get the effect values we need from the BlockInput. These may change at run time so you need to do bounds checking if required
Expand Down
8 changes: 8 additions & 0 deletions shared-module/audiofilters/Phaser.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ audioio_get_buffer_result_t audiofilters_phaser_get_buffer(audiofilters_phaser_o
self->last_buf_idx = !self->last_buf_idx;

// If we are using 16 bit samples we need a 16 bit pointer, 8 bit needs an 8 bit pointer
// buffer[] was allocated on the heap, so it is aligned for 16-bit access.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
int16_t *word_buffer = (int16_t *)self->buffer[self->last_buf_idx];
#pragma GCC diagnostic pop
int8_t *hword_buffer = self->buffer[self->last_buf_idx];
uint32_t length = self->buffer_len / (self->base.bits_per_sample / 8);

Expand Down Expand Up @@ -221,7 +225,11 @@ audioio_get_buffer_result_t audiofilters_phaser_get_buffer(audiofilters_phaser_o
// Determine how many bytes we can process to our buffer, the less of the sample we have left and our buffer remaining
uint32_t n = MIN(MIN(self->sample_buffer_length, length), SYNTHIO_MAX_DUR * self->base.channel_count);

// The source's buffer is aligned, and it is only advanced in whole samples.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
int16_t *sample_src = (int16_t *)self->sample_remaining_buffer; // for 16-bit samples
#pragma GCC diagnostic pop
int8_t *sample_hsrc = (int8_t *)self->sample_remaining_buffer; // for 8-bit samples

// get the effect values we need from the BlockInput. These may change at run time so you need to do bounds checking if required
Expand Down
Loading