ESP32 as Bluetoothg/Spotify Connect receiver

Fredde2209
Posts: 3
Joined: Tue Aug 21, 2018 11:26 am

ESP32 as Bluetoothg/Spotify Connect receiver

Postby Fredde2209 » Tue Aug 21, 2018 11:43 am

Hi guys,
I am Freddie from Germany! To introduce me: I am 16 years old, interested in electronics and love being outdoors. Might be enough at first. Though another hobby of mine is building speakers and recently I built a portable boombox. This means: I bought loudspeakers, calculated a frequency crossover, designed a layout for an amplifier and ordered 10 of them at jlpcb.com. Then I bought all the components and amplifier chips (TDA7377) and soldered everything together. The enclosure was made out of self cut MDF. After a paint of white, my girlfriend painted a wonderful pattern on it. All in all: a very beautiful speaker with about 30 Watts rms, 15Ah battery and a volume knob. Though it only has Aux (Cinch) as connection which sucks in the time of today. So I found some old things from a Music chair, which is a 16bit DAC which can easily play sound from USB Sticks. So I desoldered the necessary parts and built a 12V to 5V powersupply to power it. Works great, even with controls! Though also USB is not enough. And there the ESP32 should come into play. A bluetooth connection to my mobile phone should play the sound to my speaker. The problem: I am absolutely new to arduino etc. In my internship I played a bit with different sensors and motors to steer a sort of car, but that is not enough by far (as got my first impression during reading). So the actual plan:
ESP32 in Boobox -> plays music digitally from BT or Wifi (Spotify Connect if possible) to USB connection of my DAC -> converts to AUX -> Amp ...
Is that even possible? I ordered two of them yesterday to have one built in and have another one to test things or do other cool stuff. Can anybody give me a hint to start? Or something to read? I'd be happy about any help.

Thank you guys! :)
Greetings from Germany
Freddie


PaulFreund
Posts: 45
Joined: Wed Nov 15, 2017 9:07 pm

Re: ESP32 as Bluetoothg/Spotify Connect receiver

Postby PaulFreund » Tue Aug 21, 2018 5:54 pm

Hi Freddie,

I also looked into making a Spotify Connect receiver and have a few hints for you:
  • First this is not really outdoor friendly because the ESP would need direct internet access for Spotify Connect and therefore you need a mobile access point. This is possible with your mobile but very battery hungry.
  • The Spotify Connect protocol has been implemented in Rust here https://github.com/plietar/librespot. You would need to port this to C/C++ in order to make it work on the ESP and most likely rewrite the audio backend to output to some I2S DAC chip. Rust might be compilable for the ESP in the future if the LLVM backend for the Xtensa architecture gets finished.
  • Depending on the audio quality you are expecting and the work you are willing to do you can use the A2DP sink of the ESP32 and combine it with a I2S sound chip. If you need demo hardware you could use https://www.tindie.com/products/microwa ... esp32-adb/ for example (PM me if you want to go this route, I have one of those boards lying around here in Germany).
  • If you want to go easy on yourself you can use a ready made AptX Bluetooth codec like the CSR64215 with I2S output and pair it with your preferred DAC (Solder on solution: https://ebay.us/LaRAlf, full board with high quality Sabre ES9023 DAC https://ebay.us/k0nxrk and amplifier
There is of course a ton of other options but I hope I could give you some insights.

Best regards,

Paul

Fredde2209
Posts: 3
Joined: Tue Aug 21, 2018 11:26 am

Re: ESP32 as Bluetoothg/Spotify Connect receiver

Postby Fredde2209 » Tue Aug 21, 2018 7:30 pm

Hi,
thank you, that looks amazing! Though you could have answered in German :D
Your 3. point got my special interest: I will try to find some information what that A2DP sink is and how I could use it.
If if occur any problems (understanding or doing it) I will get back.
Thanks so far :)
Freddie

Fredde2209
Posts: 3
Joined: Tue Aug 21, 2018 11:26 am

Re: ESP32 as Bluetoothg/Spotify Connect receiver

Postby Fredde2209 » Sun Aug 26, 2018 10:43 pm

Hi,
its me again :D the two ESP32 chips arrived yesterday and I directly started testing. Programming via IDE is absolutely no problem. Also flashing via Linux and esptool.py works after a lot of testing. So far so good. Though when I try to build the individual projects I sometimes get warnings or even errors. Some still work and I am able to flash them. BUT: Bluetooth device shows up on my Android phone, iMac and Macbook don't see it. No clue why. But connecting to it is not possible. Every other device works just fine, but the ESP32s don't. Names aren't displayed, only IDs (forgot the special name at the moment).
So... flashing works, the individual programs don't. Does anybody have a recommendation for a special program that works with the most recent release (verified)?

Thanks guys :)
Freddie

famlee
Posts: 9
Joined: Mon May 20, 2019 9:40 am

Re: ESP32 as Bluetoothg/Spotify Connect receiver

Postby famlee » Tue May 21, 2019 2:04 pm

Fredde2209 did you manage to overcome your problems and your Bluetooth and Spotify is working?
Please give an update if you can :)

__BrainPain__
Posts: 1
Joined: Tue Jan 21, 2020 6:57 am

Re: ESP32 as Bluetoothg/Spotify Connect receiver

Postby __BrainPain__ » Tue Jan 21, 2020 6:59 am

Hey! Did you get this working? 🤔

felix41382
Posts: 2
Joined: Sat Nov 24, 2018 8:01 am

Re: ESP32 as Bluetoothg/Spotify Connect receiver

Postby felix41382 » Sat Jun 13, 2020 11:44 am

I would also like to know if someone got it working?

philippe_44
Posts: 26
Joined: Thu May 23, 2019 3:05 pm

Re: ESP32 as Bluetoothg/Spotify Connect receiver

Postby philippe_44 » Sun Oct 29, 2023 8:25 am

I did

Manu Van Leirberghe
Posts: 1
Joined: Wed Jan 31, 2024 11:38 am

Re: ESP32 as Bluetoothg/Spotify Connect receiver

Postby Manu Van Leirberghe » Wed Jan 31, 2024 11:43 am

philippe_44 wrote:
Sun Oct 29, 2023 8:25 am
I did



Did you document your working project anywhere or could you explain how you made it work?

Who is online

Users browsing this forum: No registered users and 64 guests