Maker Pro
Maker Pro

nrf52840 MP3 Decoding

BlueObsecurit

Mar 24, 2021
36
Joined
Mar 24, 2021
Messages
36
I've had a long running project to make my own mp3 player, some of which I have posted about here.

I've made two prototypes and I'd like to take the next step by reducing the number of components and therefore size. (And getting rid of DFPlayer module, which I suspect I am one of a limited number of people with great expertise of its... "eccentricities")

I've gotten ahold of a new uC to try: https://www.seeedstudio.com/Seeed-XIAO-BLE-Sense-nRF52840-p-5253.html

I've also got a uSD breakout.

I have tried to get two different arduino libraries to compile:
https://github.com/pschatzmann/arduino-audio-tools
And
https://github.com/earlephilhower/ESP8266Audio

I made some progress with the esp8266 library by bringing over .h files from the esp8266 core, but ultimately ended up at what felt like a dead end. I could not find the next missing .h file anywhere.

For the other library I hit a dead end where I was unable to define the SPI CS pin. It seemed like the library was pointed to something that was not defined for the uC I was trying to compile it for.

I'm self taught, I'm not a brilliant coder. I realise I need to put work in, but am I even looking in the right place? Does this have a chance of working? Are there better things to try?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
What exactly are you trying to do? Not clear to me from the short description above. Software decoding of MP3 files from SD card and output as audio stream?
Have you tried the discord channel mentioned on the website yur linked to for the µC?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Check out this site. Heaps of information on using the nrf52840 in the Arduno environment including examples.
I think you should be able to build somethong from this information and the Schatzmann audio tools library.
 

BlueObsecurit

Mar 24, 2021
36
Joined
Mar 24, 2021
Messages
36
should be able to
Should being the operative word :)
I'm not so keen on using adafruits core with this board, especially considering there is a core provided, luckily.

At the moment I cannot get the examples to compile. No matter the core or example I cannot use AnalogAudioStream from the player-sd-analog example from Schatzmann's library. It says does not name a type. My only addition to the example is #define PIN_CS 6. (Which will also throw an error if not present)

Am I missing something crucial?
I've tried reinstalling the core, library and dependencies and restarting my PC several times
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Can you get some code compiled at all? For example the "hello world" of microcontrollers, the blinking user LED?
 

BlueObsecurit

Mar 24, 2021
36
Joined
Mar 24, 2021
Messages
36
So you can read a file from SD card?
I can compile an example meant as a diagnostic tool. Gives some info on the card attached. And it works.

Possibly a collision between same pins used by different libraries?
I would have expected a different error, but not impossible. It seems to me that the compiler doesn't add the .h file specified by the top level "AudioTools.h" but it also doesn't matter if I specify to add the missing file in my sketch. (Essentially including it twice) I've browsed the files meant to be included, the missing type is there so I don't understand much.

Maybe my processor architecture is excluded somewhere, but then the example I am trying to compile states it is compatible with multiple architectures, so I am a little lost
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
How do you specify the include files? In C (C++, Arduino sketch) you have two ways: using <include.h> or "include.h". The difference is where the preprocessor looks for the files, see the explanation e.g. here.
 

BlueObsecurit

Mar 24, 2021
36
Joined
Mar 24, 2021
Messages
36
<include.h> or "include.h".
Both. I've also just now experimented with adding the whole path. I got some different arrors and it seemed like progress to me, but after having to add the full file path to another part of the library I now just get the same error. So instead of "no such file or directory" which would be expected if the compiler could not find the file, I still just get the same "AnalogAudioStream does not name a type" even though it is named in "AudioAnalog/AnalogAudioArduino.h" which the compiler seems to find since it does not throw an error saying it can't find it.
 
Top