Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove warning #152

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
41 changes: 35 additions & 6 deletions components/audio_renderer/audio_renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,29 @@
#define LOG_LOCAL_LEVEL ESP_LOG_VERBOSE
#include "esp_log.h"
#include <freertos/task.h>
#include <driver/dac.h>
#include "driver/gpio.h"
#include "driver/dac.h"
#include "gpio.h"
#include "app_main.h"
#include "MerusAudio.h"

/*
#include "audio_player.h"
#include "audio_renderer.h"
#include "ac101.h"
#include "audio_hal.h"
*/

#define TAG "renderer"


static renderer_config_t *renderer_instance = NULL;
static component_status_t renderer_status = UNINITIALIZED;
//static QueueHandle_t i2s_event_queue;
//static audio_board_handle_t a101_handle = 0;

static void init_i2s(renderer_config_t *config)
{
i2s_mode_t mode = I2S_MODE_MASTER | I2S_MODE_TX;
i2s_mode_t mode = I2S_MODE_MASTER | I2S_MODE_TX;
i2s_comm_format_t comm_fmt = I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB;
int use_apll = 0;
esp_chip_info_t out_info;
Expand All @@ -51,6 +55,7 @@ static void init_i2s(renderer_config_t *config)
comm_fmt = I2S_COMM_FORMAT_PCM | I2S_COMM_FORMAT_PCM_SHORT;
}

// if ((config->output_mode == I2S)||(config->output_mode == A1S)||(config->output_mode == I2S_MERUS))
if ((config->output_mode == I2S)||(config->output_mode == I2S_MERUS))
{
/* don't use audio pll on buggy rev0 chips */
Expand All @@ -61,7 +66,21 @@ static void init_i2s(renderer_config_t *config)
} else
ESP_LOGI(TAG, "chip revision %d, cannot enable APLL", out_info.revision);
}
/*
/*
if (config->output_mode == A1S)
{
ESP_LOGI(TAG, "Start a101 codec chip");
a101_handle = a101_board_init();
audio_hal_ctrl_codec(a101_handle->audio_hal, AUDIO_HAL_CODEC_MODE_DECODE, AUDIO_HAL_CTRL_START);

int player_volume;
audio_hal_get_volume(a101_handle->audio_hal, &player_volume);

ESP_LOGI(TAG, "ac101 value: %d",player_volume );

}
*/
/*
* Allocate just enough to decode AAC+, which has huge frame sizes.
*
* Memory consumption formula:
Expand Down Expand Up @@ -100,9 +119,13 @@ static void init_i2s(renderer_config_t *config)
{
i2s_config.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1;
if (i2s_driver_install(config->i2s_num, &i2s_config, 0, NULL) != ESP_OK)
i2s_config.intr_alloc_flags = ESP_INTR_FLAG_LEVEL2;
{
i2s_config.intr_alloc_flags = ESP_INTR_FLAG_LEVEL2;
}
if (i2s_driver_install(config->i2s_num, &i2s_config, 0, NULL) != ESP_OK)
ESP_LOGE(TAG,"i2s Error");
{
ESP_LOGE(TAG,"i2s Error");
}
return;
}
ESP_LOGI(TAG,"i2s intr:%d", i2s_config.intr_alloc_flags);
Expand All @@ -122,6 +145,12 @@ static void init_i2s(renderer_config_t *config)
//KaraDio32
void renderer_volume(uint32_t vol)
{
/* if (mod == 5)
{
audio_hal_set_volume(a101_handle->audio_hal, vol/4);
vol = 254;
}
*/
// log volume (magic)
if (vol == 1) return; // volume 0
// ESP_LOGI(TAG, "Renderer vol: %d %X",vol,vol );
Expand Down
2 changes: 1 addition & 1 deletion components/audio_renderer/include/audio_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "common_component.h"

typedef enum {
I2S, I2S_MERUS, DAC_BUILT_IN, PDM, VS1053, BTOOTH
I2S, I2S_MERUS, DAC_BUILT_IN, PDM, VS1053, A1S
} output_mode_t;


Expand Down
145 changes: 0 additions & 145 deletions components/bt_speaker/bt_app_av.c

This file was deleted.

40 changes: 0 additions & 40 deletions components/bt_speaker/bt_app_av.h

This file was deleted.

Loading