sample:a2dp_sink built-in DAC noise fix
Posted: Fri Aug 31, 2018 9:01 am
furthermore, dithering is an option?
void bt_app_a2d_data_cb(const uint8_t *data, uint32_t len)
{
size_t bytes_written;
#ifdef CONFIG_A2DP_SINK_OUTPUT_INTERNAL_DAC
uint16_t * pu16 = (uint16_t *)(data);
uint32_t cnt = len / sizeof(uint16_t);
while (cnt--)
{
*pu16 = 0x8000u ^ *pu16;
pu16++;
}
#endif
i2s_write(0, data, len, &bytes_written, portMAX_DELAY);
if (++m_pkt_cnt % 100 == 0) {
ESP_LOGI(BT_AV_TAG, "Audio packet count %u", m_pkt_cnt);
}
}
void bt_app_a2d_data_cb(const uint8_t *data, uint32_t len)
{
size_t bytes_written;
#ifdef CONFIG_A2DP_SINK_OUTPUT_INTERNAL_DAC
uint16_t * pu16 = (uint16_t *)(data);
uint32_t cnt = len / sizeof(uint16_t);
while (cnt--)
{
*pu16 = 0x8000u ^ *pu16;
pu16++;
}
#endif
i2s_write(0, data, len, &bytes_written, portMAX_DELAY);
if (++m_pkt_cnt % 100 == 0) {
ESP_LOGI(BT_AV_TAG, "Audio packet count %u", m_pkt_cnt);
}
}