Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

running syntacts on linux background #4

Open
zkarach1 opened this issue Jul 14, 2021 · 29 comments
Open

running syntacts on linux background #4

zkarach1 opened this issue Jul 14, 2021 · 29 comments

Comments

@zkarach1
Copy link

Hi
I am having some trouble running syntacts in ubuntu with a linux background. I follow the steps in this link https://www.syntacts.org/tutorials/building/ and am able to run all the commands except for the final one :
sudo cmake --build . --target install

I get the follow error when I run the above command:
Screenshot from 2021-07-14 16-04-54

@zkarach1
Copy link
Author

Im trying to generate the library i need for linux to run scripts like the example.py but cannot until i have the library for linux.

Thank you!

@gadzooks00
Copy link
Member

@zkarach1, thank you for your question. Your error is being caused by your choice of C++ compiler. The std filesystem library is not implemented by all compilers. While we haven't done extensive testing of Syntacts on Linux systems, Clang and GNU C++ compilers should work. Please reference our tutorial page here:
https://www.syntacts.org/tutorials/building/

@epezent
Copy link
Member

epezent commented Jul 23, 2021

@gadzooks00 , this may require some changes to Syntacts in Library.cpp. Some compilers still implement the feature in <experimental/filesystem>. A simple macro wrapper would probably do the trick:

https://stackoverflow.com/questions/53365538/how-to-determine-whether-to-use-filesystem-or-experimental-filesystem

@epezent
Copy link
Member

epezent commented Jul 23, 2021

@zkarach1 , the more information you share about your compiler, OS, and build environment, the better we can assist you.

@zkarach1
Copy link
Author

@zkarach1 , the more information you share about your compiler, OS, and build environment, the better we can assist you.

hi so these r the compiler available on my computer
Screenshot from 2021-07-29 18-49-46

OS 👍 Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial

@zkarach1
Copy link
Author

zkarach1 commented Aug 2, 2021

Hi so

@zkarach1, thank you for your question. Your error is being caused by your choice of C++ compiler. The std filesystem library is not implemented by all compilers. While we haven't done extensive testing of Syntacts on Linux systems, Clang and GNU C++ compilers should work. Please reference our tutorial page here:
https://www.syntacts.org/tutorials/building/

hi so I am running with clang and I adjusted the Library.cpp file to have #include <experimental/filesystem> and namespace fs = std::experimental::filesystem;
so that file runs now but now I am getting this error within the session.cpp file i tried to make the changed in the error comments but its still not working there are more errors
Screenshot from 2021-08-02 15-57-54

@gadzooks00
Copy link
Member

@zkarach1
I have just merged an updated wrapper for filesystem to the Syntacts main branch. Please sync and attempt a fresh build.

@zkarach1
Copy link
Author

zkarach1 commented Aug 2, 2021

@zkarach1
I have just merged an updated wrapper for filesystem to the Syntacts main branch. Please sync and attempt a fresh build.

hi thanks so much! the Libary.cpp file works but now I still get the error in the Session.cpp file as shown above
Screenshot from 2021-08-02 16-25-39

@epezent
Copy link
Member

epezent commented Aug 3, 2021

Enable C++17 features on your compiler for if constexpr

@gadzooks00
Copy link
Member

@zkarach1 Has that resolved your issue?

@zkarach1
Copy link
Author

@zkarach1 Has that resolved your issue?

Hi so right now I was able to build in Linux after updating everything. I had to update my Ubuntu to a newer version. However now even though I can run the scripts I am not getting any outputs. For example I run the example.devices.py file but get no outputs. So I went into the Syntact.py file and looked in the Session class and the n variable is always being assigned to 0, which I am guessing is because the python script is not able to find any devices? I try running other files like example_basic.py and though they run there is no output. Like there are no errors but a signal is not outputted.

I tried running this on windows and everything works so I am guessing there is something I need to change for windows?

Please let me know!

@zkarach1
Copy link
Author

zkarach1 commented Aug 19, 2021 via email

@zkarach1
Copy link
Author

Here is what happens when I try to run example_devices.py. I have attached a picture of the code, how I am compiling it in the terminal and the output (which is nothing)
Screenshot from 2021-08-23 14-28-49
Screenshot from 2021-08-23 14-28-59

I also tried example_basic.py and tried connecting the output device using session.open(api=API.ALSA) and session.open()I have attached my code. But I am not getting any ouptut. The code runs but there is no output sound.
Screenshot from 2021-08-23 14-33-49
Screenshot from 2021-08-23 14-34-02
Screenshot from 2021-08-23 14-34-09

I think my problem is connecting to an output device. I used python -m sounddevice to check what devices I have and this is the output. So I think i need to use the ALSA api but that didnt work (as shown above)
Screenshot from 2021-08-23 14-37-17

Please let me know if you have any suggestions!!

@gadzooks00
Copy link
Member

gadzooks00 commented Aug 25, 2021

@zkarach1 Are you able to run any of the C++ examples or examples with any of the other APIs besides python on the Linux system? It would help us narrow down if the issue is from a linux import or on from a python implementation in linux.

@zkarach1
Copy link
Author

@zkarach1 Are you able to run any of the C++ examples or examples with any of the other APIs besides python on the Linux system?

I have not tried that as there were only python examples in the file and in the video. Do you have a c++ file to test? Or I can try writing one but im more confident in python haha

@gadzooks00
Copy link
Member

If you have not already, please try following the instructions here to build Syntacts on your system:
https://www.syntacts.org/tutorials/building/

After that please try following these instructions to use the C++ api:
https://www.syntacts.org/tutorials/cpp/

If you can get through the session subsection of the later tutorial set and then screenshot the output, that would help clarify where the sound device identification problem is occurring.

@gadzooks00
Copy link
Member

@zkarach1 In addition to the above step. Could you please try to build Portaudio alone using the following repository and then run the "pa_devs.c" example:
https://github.com/PortAudio/portaudio

That will similarly help us narrow down the issue.

@zkarach1
Copy link
Author

zkarach1 commented Aug 26, 2021

hi so here are some results from trying to run c++ scripts

  1. I first tried making the CMakeList.txt with syntacts installed and here are my results:
    Screenshot from 2021-08-26 13-53-52

and here is the code
Screenshot from 2021-08-26 13-54-11

I think the error occured because in this line:
find_package(syntacts REQUIRED)
syntacts is lower cased so I changed it at here are the results:

here is the code changed:
Screenshot from 2021-08-26 13-58-31

and here are the results it worked!:
Screenshot from 2021-08-26 13-58-18

Now I run the myApp using the following commands:
Screenshot from 2021-08-26 14-00-42

and I got an output on the speakers with the syntacts amplifyer but i also have these errors coming up:
Screenshot from 2021-08-26 14-01-34
Screenshot from 2021-08-26 14-01-54

Im now trying to do a session and will update soon! Thank you

@zkarach1
Copy link
Author

So I created an example_device.cpp file as seen below:
Screenshot from 2021-08-26 14-11-13

Perhaps I am running it in the wrong directory but I just run it in the Syntacts folder like this:
Screenshot from 2021-08-26 14-13-33

and get a lot of errors:
Screenshot from 2021-08-26 14-14-19

@zkarach1
Copy link
Author

@zkarach1 In addition to the above step. Could you please try to build Portaudio alone using the following repository and then run the "pa_devs.c" example:
https://github.com/PortAudio/portaudio

That will similarly help us narrow down the issue.

hi so i git cloned the repository and then ran the file like this and here is the output:
Screenshot from 2021-08-26 14-19-29

@gadzooks00
Copy link
Member

@zkarach1 Could you please clarify what you mean when you say:

and I got an output on the speakers with the syntacts amplifyer but i also have these errors coming up:

For your next comments it looks like you are trying to use gcc in a similar way as python. Gcc only compiles the source code. The actual example will be built as an executable in the specified destination. When I refer to running the Syntacts example, I mean to build and install Syntacts as per the instruction here https://www.syntacts.org/tutorials/building/, then to navigate to its installation location, and find the executable for the relevant example and run it. The instructions provided here https://www.syntacts.org/tutorials/cpp/ are to create a standalone program using the Syntacts API and as such should be stored in a separate directory from Syntacts and simply link to the Syntacts installation or fetch it from GitHub. Please confirm that Syntacts is properly built and installed on your system and run the included example_devices program in your relevant build folder.

For PortAudio, you will similarly need to compile the code using Gcc with example and then run the relevant program. More instruction are provided by PortAudio here: http://portaudio.com/docs/v19-doxydocs/compile_linux.html

@zkarach1
Copy link
Author

RUNNING THE MYAPP:

Hi so for the first thing I did is get syntacts from github and I did that and have the folder on my computer.
The second thing I tried to do was follow the c++ tutorial to set up the c++ API. From my understanding I need to do this outside of the Syntacts folder I have ? My current set up is that in my home directory I have the Syntacts folder and another folder (not inside the Syntacts folder but made in my home directory) to build the c++ API in (I have named this c_test for reference). So inside of my new folder c_test I follow the c++ API tutorial instructions in order to generate the myApp executable.
I do the following commands inside the c_test folder which contains both my CMakeList.txt and my main.cpp file:
mkdir build
cd build
cmake ..
cmake --build . --config Release

and then to run the myApp I just do the command ./myApp

And I have a vibration output on my speakers that are connected to the mahi amplifier but I also have this error:

Screenshot from 2021-08-30 15-04-26
Screenshot from 2021-08-30 15-04-39
Screenshot from 2021-08-30 15-04-48

@zkarach1
Copy link
Author

zkarach1 commented Aug 30, 2021

RUNNING A C++ FILE:

So from my understanding if I am trying to run a c++ file I need to run it in the c++ API build folder that I generated above ^
so I want to run the example_devices.cpp file I had shown above. So What I did was I added that file to the c_test folder which is where I built the c++ API and then just added it to the CMakelist.txt file like this:

Screenshot from 2021-08-30 15-14-51

which worked! and I get device names, but I also have warnings I have attached the output below
Screenshot from 2021-08-30 15-59-06
Screenshot from 2021-08-30 15-59-15
Screenshot from 2021-08-30 15-59-23

@zkarach1
Copy link
Author

@zkarach1 Could you please clarify what you mean when you say:

and I got an output on the speakers with the syntacts amplifyer but i also have these errors coming up:

For your next comments it looks like you are trying to use gcc in a similar way as python. Gcc only compiles the source code. The actual example will be built as an executable in the specified destination. When I refer to running the Syntacts example, I mean to build and install Syntacts as per the instruction here https://www.syntacts.org/tutorials/building/, then to navigate to its installation location, and find the executable for the relevant example and run it. The instructions provided here https://www.syntacts.org/tutorials/cpp/ are to create a standalone program using the Syntacts API and as such should be stored in a separate directory from Syntacts and simply link to the Syntacts installation or fetch it from GitHub. Please confirm that Syntacts is properly built and installed on your system and run the included example_devices program in your relevant build folder.

For PortAudio, you will similarly need to compile the code using Gcc with example and then run the relevant program. More instruction are provided by PortAudio here: http://portaudio.com/docs/v19-doxydocs/compile_linux.html

Hi I am a little confused on how to run portaudio pa_dev.c?

@zkarach1
Copy link
Author

OPENING SPECIFIC INDEX:

Hi so since my example_devices worked I am trying to specifically open index one which is the what we have connected the amplifier to.
here is the code I wrote:
Screenshot from 2021-08-30 16-15-08

And there is no sound output but it does full run because it outputs the "done" statement I added. Here are the warnings I get, I think perhaps there is a soundcard problem? :

Screenshot from 2021-08-30 16-16-24

Screenshot from 2021-08-30 16-16-29

@zkarach1
Copy link
Author

zkarach1 commented Sep 1, 2021

Here is my output from the pa_devs:
Screenshot from 2021-08-31 20-44-11

@zkarach1
Copy link
Author

hey @gadzooks00 just wanted to check in if you were able to see my messages above! thank you

@gadzooks00
Copy link
Member

@zkarach1 Yes, thank you for the screenshots and information. I am looking into this.

@gadzooks00
Copy link
Member

@zkarach1 After testing out a couple of items on the syntacts side and reviewing the information you have provided, the issue seems to be on either the driver for your sound device or the sound device itself. While the system is able to identify that there is a sound device for ASLA, as per your screenshot from pa-devs, the same pa_linux_alsa.c error is being thrown. Since this is an issue upstream from Syntacts, there is not a software fix that we can include from our end. I would recommend checking to make sure the most updated stable audio drivers are being used on your system or to switch to another audio platform that your system is not having any connectivity issues with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants