-
Notifications
You must be signed in to change notification settings - Fork 14
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
Own speaker implementation #2
Comments
Or maybe that is a perfect reason to study prebuild. Because it’s annoying to wait for TooTallNate to merge speaker as well as the whole situation with absence of sound in node is a sort of crap - it’s 2016, we’ve sent satellites to Mars. |
speaker also really needs |
I can work on this if you'd like? @dfcreative |
Wow, that would be awesome |
I'm just creating a mirror of the mpg123 svn repo to git, so we can easily keep the library up to date, give credit to those who made it and let people modify it through git. Then we can add it here as a submodule and make the binding. I'm not the best with C++ and C, but we'll put it on a separate branch in case someone else can contribute to it if I can't make it. |
Yeah, that is good to have mpg123 updated automatically. The point as I get it is not C/C++ but node bindings, that takes good knowledge of v8. |
Alright, I will look into prebuild and yeah the bindings will be difficult, but it's worth giving it a shot. For windows building maybe this is a temporary fix https://www.npmjs.com/package/windows-build-tools although I have found it doesn't set the python path very well, although they are working on a fix I believe. It also requires cmd or powershell to run in admin. |
I have got a mirror setup now. I will start working on the binding. https://github.com/connorhartley/mpg123 |
Just some information on what I've done. Basically I have forked mpg123-mirror from my profile to audiojs to make modifications specifically for audio-speaker. Currently binding-implementation compiles on Windows fine. I am going to focus on finishing the binding for Windows then we will worry about porting this to other operating systems and arch types. I will need help with testing this on the other systems afterwards. |
Yeah, I am also on windows, cc @jamen |
Linux Mint here. |
The C++ binding stuff is done, now all we'll need is the JS implementation for this. I'm open to suggestions on implementation. @dfcreative @jamen @ahdinosaur @mmckegg |
@connorhartley Also now it’s a bit tricky to figure out how to install mpg123. That would be nice to add that to readme. Also that is must-have Also I do node-gyp clean;
node-gyp configure;
node-gyp build;
...
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\dmitry\Dropbox\projects\audio-\speaker\build\src\module.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\dmitry\Dropbox\projects\audio-\speaker\build\src\compat.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\dmitry\Dropbox\projects\audio-\speaker\build\src\mpg123.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\dmitry\Dropbox\projects\audio-\speaker\build\src\out123.vcxproj] Not sure what’s up. |
@dfcreative I will add the readme very soon, along with instructions for configuring mpg123 a long with build instructions. What version of Visual Studio are you using? EDIT The error can be caused by multiple reasons, try the following.
Alternatively to save time in the future for building, you can set an environment variable. Variable: If that doesn't work, I would take a look at the other options in this SO answer I found. If that doesn't work, let me know. 😄 |
With vs2015 flag: C:\Users\dmitry\Dropbox\projects\audio-\speaker\src\mpg123\src\libout123\out123_int.h(12): fatal error C1083: Cannot op
en include file: 'config.h': No such file or directory [C:\Users\dmitry\Dropbox\projects\audio-\speaker\build\src\modul
e.vcxproj]
compat.c
compat_str.c
..\..\src\mpg123\src\compat\compat.c(12): fatal error C1083: Cannot open include file: 'config.h': No such file or dire
ctory [C:\Users\dmitry\Dropbox\projects\audio-\speaker\build\src\compat.vcxproj]
c:\users\dmitry\dropbox\projects\audio-\speaker\src\mpg123\src\compat\compat.h(17): fatal error C1083: Cannot open incl
ude file: 'config.h': No such file or directory (compiling source file ..\..\src\mpg123\src\compat\compat_str.c) [C:\Us
ers\dmitry\Dropbox\projects\audio-\speaker\build\src\compat.vcxproj]
parse.c
... Basically |
@dfcreative EDIT The latest commit may fix your problem, as the target arch default was ia32 (maybe your arch type is also ia32) and I hadn't made a configuration for it. If you are running x64 use |
@connorhartley btw considering the latest changes in @audiojs, for own implementation it would be enough to have |
@dfcreative did that error get fixed? |
Naah, still get the same error - config.h not found. I just copied the code of audiojs/mpg123 into |
@dfcreative have you tried setting the e.g If the problem persists please let me know. 😄 |
Thanks for the clarification. I will update with my findings shortly. |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
@dy I would like to get up to speed with this and I thought if somebody could share their build script for npm run build, that would be great. As I understand it the config.h error happens after trying to reconfigure node-gyp. I would like to understand better if anybody else other than @dy has been able to reproduce the config.h. I would like to really understand deeply how each library component works and why you guys need/want it. Not in terms of audio capabilities level (as of yet) but just on a 'build' level for now. Another question I have potentially, does napi allow to switch versions without recompiling/rebuilding just to avoid the nan problem as seen on this issue? Is using napi with mpg123 instead of nan viable? Because if there's a missing win32 identifier problem (as the error states) maybe there's a wrong abi (configured for 64bit) and some value is not being read. I might be talking nonsense but I just want to gauge the surface and learn more. What are your thoughts? One thing is for sure, implementing a new cubeb cross-platform with napi will be somewhat groundbreaking. I think of all those native speed low latency audio streaming possibilities. Or maybe the new features you're after for the speaker output are different. First thing is first though. Once I cover all possibilities that may cause the error as it pertains to the gyp mgpg123 binding and the configure command, I'll move onto other things. |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
I guess there's no abi in nan. |
@Elemino I didn't work much with low-level API, I was mostly concerned with consistent modules interface and optimal js code. That question is better addressed to @jamen or @connorhartley, the guys spend more time on that (thanks for that!) |
I haven't reproduced this error. It might not even be relevant anymore? There is several issues and incomplete parts of the bindings, though.
I'll talk about Mpg123's setup, Cubeb's setup, then our setups. Visit Mpg123's website for a lot of information. Mpg123 is hosted on SVN, so its mangled into git projects. Mpg123 uses automake for its build, but it has to be reworked in node-gyp for our binding. Luckily node-speaker already did this (found in our fork here). If you feel motivated to rework the build of the binding, I'm open to ideas. For example, in Cubeb I've reached a simpler solution without node-gyp. Clone Cubeb's repository and build its docs for information (I don't know any online sources unfortunately). Cubeb uses CMake for its build, so I've used cmake-js in the binding, which makes the entire thing much simpler. Going forward with either one, it should use prebuild eventually, where instead of compiling source code when its installed, you install the compiled binary for your system. Not sure what else to add here.
You should recompile when switching Node versions. I've gotten errors about mismatched ABI versions several times. Not sure if it absolutely necessary, though. The original issue could be related this. But, it would've been a local fix, and there is other issues with the bindings.
It is! We have an incomplete branch for this, which you are welcome to continue, or start your own. I would rank all the options we have like this:
Any of these are acceptable if its more stable/complete than what we have now. Just points to be made about which are better.
Definitely! I want to stress the point: Mpg123 and Cubeb are alternatives to doing the same thing. Cubeb arguably does it better. Mpg123 is already began and undergone testing. But we need to choose one of them to use in audio-speaker. I don't have complete insight in how Web Audio API, Mpg123, and Cubeb stack up against each other with their performance and features, but in my opinion, Web Audio API looks pretty robust as it is, we should use it where we can, and Cubeb where we can't.
If you want to champion both of bindings, keep in mind we can only use one for |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
This clarifies so much @jamen thank you. Will touch base again shortly. |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
10 similar comments
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
Okay, I've been absent for a while. I will submit WIP PR Monday evening to start documenting my progress. I hope this will add some value. Thanks. |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
1 similar comment
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
Okay, I'm almost ready to submit the first WIP PR. I apologize it took so long. I had to learn C++ from scratch and had some family issues along the way. Quick question: Should I start with a new branch or submit a fork? Thank you all for your patience. |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
@Elemino No rush its all good. You can submit a PR from a fork. |
@Elemino Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
Hello there, it's been a while ever since I've posted anything on here. I have some time to put into this project, so I thought I'd let you know. I'll see if I can submit something soon. Please let me know if there are any changes in the ecosystem that you would like me to know about. p.s: If this bounty could be revived, that would be great! It got expired at some point but gitcoin seemingly allows to submit work? Thanks a lot and I hope you all are doing good. |
denoland/deno#2825 Does this qualify as a solution? |
Hm? deno supports sound? |
npm install audio-speaker
givesThis happens only when local version of node-gyp is used. Probably some config needed or something. Because global node-gyp rebuilds speaker just fine.
The text was updated successfully, but these errors were encountered: