muvox-io / euphonium

Tiny audio platform
GNU Affero General Public License v3.0
96 stars 15 forks source link

CSpot issues + questions about building #71

Open kuba2k2 opened 1 year ago

kuba2k2 commented 1 year ago

Hi

I've been testing Euphonium (master branch, 3e70f598d55f137aaeaf42e023980990d8230eaa) on ESP32 for a bit. I built it on Ubuntu to have the somewhat-latest version (but IIRC the experience was the same in the released 0.3.0 build). There are some issues with CSpot that make the thing pretty hard to use:

I know some of these issues are very minor, but I'm wondering if they have been (or are planned to be) fixed, on some other branch.

About that... I wasn't able to build the develop branch, since it's Nix based, and I have no idea how to run that, nor haven't found any docs that would guide me to do it. Any help would be appreciated :smile:

I also don't fully understand the choice of using Nix, since IMHO it's quite complicated (especially for new users) and different from all build systems I've seen so far - after trying various commands (including some opt-in "experimental" ones), it did even download ESP-IDF but the build never actually happened. Apart from that, it sadly doesn't support Windows /without WSL/, which makes it pretty much impossible for a developer like me to work with it.

I don't mean to be trying to convince you guys to other build systems, but I honestly think that something like PlatformIO (without Arduino, of course) would be a much better fit - it's especially meant for embedded systems (but can target host-native as well), it's very easy to integrate into a project/library, and it's simple to understand and build with it.

philippe44 commented 1 year ago

If I may, as a dev who is using cspot, the core of euphonium, Platform.io locks you in a system that I'm not sure is capable of building complex things like euphonium. It's more a tinkering platform and I would personally never even try. Now, to your question, I've made a set of PR from which most of them have been accepted by @feelfreelinux to make cspot compile and run under Windows, so if you install the espressif environment for Win and VisualStudio, it is likely to work for the whole euphonium (although I'm using it myself only for cspot). In addition no, esp-idf does not need WSL, I'm using it daily and I don't have WSL on my build machine. For cspot standalone, if you use the dev/cdn branch of cspot and thus the develop branch of Bell, add my PRs, it is rock solid now. Now I don't have experience with Nix, I do my own cross-build systems and use raw cmake, but I have cspot under Linux (x86, arm and aarch64, mips, sparc), MacOS (x86 and arm), Solaris, FreeBSD and Windows

kuba2k2 commented 1 year ago

I think you misunderstood me a little bit. I know that esp-idf doesn't need WSL - I was perfectly able to compile CSpot and more in CLion using Cygwin - before your Windows support PR, after that it sadly stopped working. I know I could probably install Visual Studio, but I dislike the IDE very much and don't have enough space for all the C++ SDKs and workloads.

I was saying that Nix needs WSL on Windows - last time I checked, there was no native binaries for Win32. PlatformIO itself has pretty much nothing to do with Arduino, if you don't include the Arduino frameworks. It's simply a package manager and build system, which handles installation of esp-idf, toolchains, libraries, etc. I can agree that Arduino IDE is a tinkering platform, but those are totally different things.

After all, both Euphonium and CSpot (and bell) are just collections of header and source files, which is not such a complex thing to build. I guess that if you just grabbed all .cpp and .h files, put them in one directory, you'd be able to compile it all with little modifications.

Anyway, I'm mostly asking about the runtime issues and some guidance on how to compile the develop branch - I don't need any other build systems at present. When the time comes to embed CSpot in my project, I'll probably port it to platformio anyway.

philippe44 commented 1 year ago

Indeed I misunderstood you. EhY did the Windows PR break? Is it still the case with the latest PR in the dev/cdn branch?

kuba2k2 commented 1 year ago

I don't remeber exactly, but it was something related to OpenSSL I think. Also, you've added PortAudio as a precompiled library, which is incompatible with Cygwin and works with Visual Studio only.

Normally, in Cygwin, I was installing OpenSSL and PortAudio using Cygwin's package manager, and CMake was able to find them and compile everything; after the PR that stopped working.

philippe44 commented 1 year ago

OpenSSL is probably a different item as I did not touch it, @feelfreelinux moved to only mbedtls if I remember. Now, I added support for it in Win32. For portaudio, there is a Findportaudio.cmake that can be changed. Do you still need that port and shall I have a look at this or this is not the case anymore? Ultimately, what platform do you plan using?

philippe44 commented 1 year ago

What I also mean is that in some of the cmake or related files, I might have used win32 and msvc flags interchangeably which is not correct obviously. Or it could be something related to the fact that cmake has stopped at some point to define win32 in Cygwin (which is the right thing to go). I'm not a Cygwin user, so I'm not sure but all this can be easily fixed.

kuba2k2 commented 1 year ago

I'm not currently planning to be developing using bell or Euphonium, but when the time comes I'll still be developing on Windows, in CLion or VSCode, targeting ESP32 and testing on Win32. Again, you don't have to worry about these issues as I'll port this to PIO for myself. I only wanted to build the develop branch to have fixes for some usability issues, but it's not CMake based and I don't know how to build it.

philippe44 commented 1 year ago

ok then - btw, when you mean it's not cmake based, which part are you referring to exactly?

kuba2k2 commented 1 year ago

The develop branch of Euphonium is using Nix for building instead of CMake (see #59).

philippe44 commented 1 year ago

oh, I missed that entirely as I only use cspot/bell for my own projects and rely on raw cmake