ESP32 Webradio
-
- Posts: 263
- Joined: Sun Jun 19, 2016 12:00 am
Re: ESP32 Webradio
Just a quick update: I just added .pls playlist support. You can now switch between different stations.
@rudi: I'm curious how the end result looks like...
@rudi: I'm curious how the end result looks like...
Re: ESP32 Webradio
Hi,
I download the newest solution and want to taste it. I build it with one error:
ESP32_MP3_Decoder/components/playlist/./playlist.c:19:17: fatal error: ini.h: No such file or directory
I checked all the folders, there is no ini.h file. Did one contributor forget to check in for one file? Please have a look and thanks for help.
regards,
Roger
I download the newest solution and want to taste it. I build it with one error:
ESP32_MP3_Decoder/components/playlist/./playlist.c:19:17: fatal error: ini.h: No such file or directory
I checked all the folders, there is no ini.h file. Did one contributor forget to check in for one file? Please have a look and thanks for help.
regards,
Roger
-
- Posts: 263
- Joined: Sun Jun 19, 2016 12:00 am
Re: ESP32 Webradio
First you've got to run . I have updated the docs.
Code: Select all
git submodule init && git submodule update
Re: ESP32 Webradio
I can't seem to get mine to do anything other than crackle on either DAC or PDM. It crackles on either bluetooth or wifi mode, any ideas?
Re: ESP32 Webradio
Hi there,
I am impressed and very happy with the implementation of this Web Radio application.
Even using the built-in DAC with a speaker sounds quite good.
What is missing is the possibility to change the volume. Every station is always "full power".
I had a look at the code, especially at audio_renderer.c in /esp-idf-2.0/components/audio_renderer/ directory
where the samples are prepared
and hoped that I can only divide the values "left" and "right" by some value before doing the signed unsigned shift.
But it does not work.
Any idea to add some possibility to change the volume of the samples?
Thanks in advance for your answer.
I am impressed and very happy with the implementation of this Web Radio application.
Even using the built-in DAC with a speaker sounds quite good.
What is missing is the possibility to change the volume. Every station is always "full power".
I had a look at the code, especially at audio_renderer.c in /esp-idf-2.0/components/audio_renderer/ directory
where the samples are prepared
Code: Select all
if(renderer_instance->output_mode == DAC_BUILT_IN)
{
// assume 16 bit src bit_depth
short left = *(short *) ptr_l;
short right = *(short *) ptr_r;
left = left / 64;
right =right / 64;
// The built-in DAC wants unsigned samples, so we shift the range
// from -32768-32767 to 0-65535.
left = left + 0x8000;
right = right + 0x8000;
uint32_t sample = (uint16_t) left;
sample = (sample << 16 & 0xffff0000) | ((uint16_t) right);
bytes_pushed = i2s_push_sample(renderer_instance->i2s_num, (const char*) &sample, max_wait);
}
But it does not work.
Any idea to add some possibility to change the volume of the samples?
Thanks in advance for your answer.
Last edited by Bletru on Wed Jun 28, 2017 5:14 pm, edited 1 time in total.
-
- Posts: 263
- Joined: Sun Jun 19, 2016 12:00 am
Re: ESP32 Webradio
Some DSP stuff (bi-quad filter) is planned by Jorgen. I looked into volume control, multiplying the final sample by some float should do the trick. In general volume control can be complex (the ESP32 has no hardware support for saturating arithmetic), and some amplifiers have I2C volume control, but a basic version should be simple.Any idea to add some possibility to change the volume of the samples?
I'm accepting pull requests, a separate volume_control component would be welcome.
-
- Posts: 263
- Joined: Sun Jun 19, 2016 12:00 am
Re: ESP32 Webradio
Thats not enough information to help. You can open an issue on Github to keep the signal/noise ratio on the forum down.joeybab3 wrote:I can't seem to get mine to do anything other than crackle on either DAC or PDM. It crackles on either bluetooth or wifi mode, any ideas?
Be sure to include your hardware schematics and log output, basically everything that could be relevant.
Re: ESP32 Webradio
I thought about opening an issue but I've found people to be kind of harsh sometimes if you open an issue when there's a forum available so I figured I'd post here. I'll go ahead and open an issue on github though.
Re: ESP32 Webradio
Hi,BuddyCasino wrote:Ah, you mean bluetooth. Didn't test that a lot, ESP-IDF does most of the work anyway so I'm not sure I can fix that. The "xBtuQueue Failed" is triggered in btu_task.c, which is Broadcom code. Its possible that we don't consume the PCM buffer fast enough, but I have no idea really.
i tried to fix this problem, where audio stop working after a while, or is continuously interrupted while playing, with BT Audio.
I finally found a workarround by adding a delay in the bt task in esp-idf. It's not the most beautiful patch i have ever written, but it does the job, at least in my tests.
Code: Select all
diff --git a/components/bt/bluedroid/btc/profile/std/a2dp/btc_media_task.c b/components/bt/bluedroid/btc/profile/std/a2dp/btc_media_task.c
index 8610ef8..d8dd600 100644
--- a/components/bt/bluedroid/btc/profile/std/a2dp/btc_media_task.c
+++ b/components/bt/bluedroid/btc/profile/std/a2dp/btc_media_task.c
@@ -264,6 +264,7 @@ static void btc_media_task_handler(void *arg)
btc_media_ctrl_handler(e);
osi_free(e);
}
+ vTaskDelay(1);
}
}
It may help others people.
Regards,
Nicolas
-
- Posts: 1
- Joined: Mon Jul 17, 2017 10:32 pm
Re: ESP32 Webradio
@BuddyCasino
I actually have a question regarding how you use `nghttp2` to do multipart HTTP/2 POST request. Do you simply use `nghttp2_submit_request` to send your request? How do you combine the Json and Audio into one request?
Thanks
Randy
I actually have a question regarding how you use `nghttp2` to do multipart HTTP/2 POST request. Do you simply use `nghttp2_submit_request` to send your request? How do you combine the Json and Audio into one request?
Thanks
Randy
BuddyCasino wrote:Since last evening I can actually post a pre-recorded audio file to Alexa, get an HTTP2 multipart MP3 answer back, decode it via MAD and play it via I2S amplifier.dotthree wrote:What kind of instability problems are you having?
There are some issues left that I really need to resolve before publishing the code:There is still much work to be done after that, but I'll publish it as soon as it does the bare minimum task. Pinky promise!
- getting audio input via I2S input to work
- resolve SSL connection issues that sometimes cause very long connect times (minutes)
- handle authentication better
Who is online
Users browsing this forum: No registered users and 13 guests