Skip to content
New issue

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

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

Already on GitHub? # to your account

RP2040 PlatformIO lacks PWMAudio dependency #269

Closed
kinoshita-lab opened this issue Aug 7, 2024 · 6 comments
Closed

RP2040 PlatformIO lacks PWMAudio dependency #269

kinoshita-lab opened this issue Aug 7, 2024 · 6 comments
Labels
infrastructure Issues concerning github workflows, hosting issues, etc.

Comments

@kinoshita-lab
Copy link
Contributor

Environment:

  • Windows 11 23H2
  • PlatformIO Core, version 6.1.15
  • Mozzi 2.0.1
  • Board: RP2040

Steps to reproduce

  1. Create new project with Board:RP2040 (Generic) and Framework: Arduino
  2. Tested with minimum code below for main.cpp:
#include <Arduino.h>
#include <Mozzi.h>

void setup() {}

void loop() {}
  1. execute "PlatformIO: Build"

Current Behavior

Resulting to following error:

In file included from .pio\libdeps\generic\Mozzi/internal/MozziGuts.hpp:59,
                 from .pio\libdeps\generic\Mozzi/MozziGuts.h:205,
                 from .pio\libdeps\generic\Mozzi/Mozzi.h:33,
                 from src\main.cpp:2:
.pio\libdeps\generic\Mozzi/internal/MozziGuts_impl_RP2040.hpp:162:9: fatal error: PWMAudio.h: No such file or directory

Workaround

Add PWMAudio to the project's platformio.ini, for example it looks like below:

lib_deps = 
    sensorium/Mozzi@^2.0.1
    PWMAudio

Comments

Mozzi for PlatformIO already has dependency with I2S and AudioBufferManager, but it lacks PWMAudio.
This issue would be solved by modifing library.json, but I didn't find it so far.

@tomcombriat
Copy link
Collaborator

Hi,
Thanks for reporting this! As far as I know, no-one in the development team is using PlatformIO with Mozzi, even though some users have reported using it.

If I am correct, there is no library.json for Mozzi. Actually, it was proposed some time ago (#15) but was not pursued…

One thing I wonder (but maybe you can enlighten us on that) is, as Mozzi supports a quite large set of different architectures, all with different includes, is it possible to make this library.json specific enough to have different dependencies per arch? Interestingly, PlatformIO knew that I2S and AudioBufferManager were needed…

@tomcombriat tomcombriat added the infrastructure Issues concerning github workflows, hosting issues, etc. label Aug 7, 2024
@tfry-git
Copy link
Collaborator

tfry-git commented Aug 7, 2024

I'd have to check the timing, but AFAIR, PWMAudio was added to the RP2040 core about a year or two ago (https://github.com/earlephilhower/arduino-pico/tree/master/libraries/PWMAudio). So this looks like a problem of PlatformIO not having the latest version.

I have no real idea just how cores and libraries are registered with PlatformIO, but the problem will be found, there.

@kinoshita-lab
Copy link
Contributor Author

kinoshita-lab commented Aug 8, 2024

Hello, thank you for responding.

I have no real idea just how cores and libraries are registered with PlatformIO, but the problem will be found, there.

I think so too, this issue can be solved by correcting PlatformIO library registration info about Mozzi.

According to the registry website, it shows authors of the library. Is it NOT the actual submitter who have registered Mozzi library over there?

https://registry.platformio.org/libraries/sensorium/Mozzi/insights/authors

@tfry-git
Copy link
Collaborator

tfry-git commented Aug 8, 2024

I don't think we have registered that, ourselves, but the info looks correct.

However, I could not find the core we are assuming (https://github.com/earlephilhower/arduino-pico) in that registry. Rather it seems to contain a totally different, mbed-based core (https://github.com/platformio/platform-raspberrypi).

No idea how you would go about installing the former with PlatformIO (or about registering it in the database), but I think that's what you'll need to do.

@tomcombriat
Copy link
Collaborator

I don't think we have registered that, ourselves, but the info looks correct.

I don't think either. Also note the FixMath is also correctly registered even though I am sure of not doing it.

@kinoshita-lab
Copy link
Contributor Author

I added Mozzi manually by copying Mozzi files into src directory.
The problem still happens.
It seems the root cause of the problem is PlatformIO's automatic dependency detection.
I think here is not suitable place to report issue, while the workaround is still effective..

So, I close this issue now.
Thank you for all of your cooperation!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
infrastructure Issues concerning github workflows, hosting issues, etc.
Projects
None yet
Development

No branches or pull requests

3 participants