-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
basics: Change sampleFrame to use std::array
#5536
Conversation
This PR does 3 things:
|
02a9842
to
5db461d
Compare
Sorry, I had to do a force-push, it did not compile before. |
🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩
Linux
Windows
macOS🤖{"platform_name_to_artifacts": {"Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://8872-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-714%2Bga5b449a-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8872?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://8873-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-714%2Bga5b449a26-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8873?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://8870-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-714%2Bga5b449a26-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8870?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/k3rp3mucni8h1pfg/artifacts/build/lmms-1.2.2-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/35304503"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/eekmkcfrnr7ij79b/artifacts/build/lmms-1.2.2-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/35304503"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://8869-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-714%2Bga5b449a26-mac10.13.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8869?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "e943f188effac66fe95a2d28b168ff7b7802d387"} |
Ready to review now. @DomClark I added you as reviewer. Of course, feel free to remove yourself if you don't want to review. IMO there are 2 questions:
|
This is a tricky problem, but I think this won't make stuff worse because OOB accesses are problematic when accessing to C objects as well.
However, I don't think that will cause issues, at least for now. @DomClark Can we merge this as-is? |
Sorry for not getting round to this sooner; I've had other stuff on the past few weeks, but it's all done now. I agree that the semantic changes you mentioned aren't likely to be a problem:
One other difference that might be a problem is what happens when passing these as arguments.
I saw this report on Discord from @qnebra
So I want to take a closer look at this. |
@DomClark To add more context for investigation of this bug, I use a lot of VST in projects. Propably completely irrelevant at all, but maybe will help. |
@qnebra The freezing might be related to the embedding method(the default is XEmbed on Linux). If you run LMMS from the build directory, it won't use the default LMMS setting file. Can you test this PR with the "none" embedding method? Please make sure you check the setting before you open your project files. |
Well, I use Windows at this moment, also not touched embedding settings in lmms. I will test this further after fixing broken build system on my PC. |
Export crashes even if only track in project is single 3xOSC, completly default settings. https://drive.google.com/file/d/1caGagpw_IqobJ99E-Nvi9v7_2s4YCBvy/view?usp=sharing |
@DomClark do you still plan to investigate this? |
I investigate the crashes and freezing, and they appear to be unrelated to this PR. I will get on with checking the code for the potential issue I mentioned above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only found one instance which will break with the new pass-by-value behaviour:
lmms/plugins/Delay/StereoDelay.h
Line 48 in 1dab416
void tick( sampleFrame frame ); |
It should be sufficient to change it to a reference.
... in order to make standard containers be able to store it.
52a8b94
to
21ee7f1
Compare
I just cross-checked your analysis ( I also pushed a commit removing the @DomClark should we analyze for any other issues? Do you recommend further testing? Or can this be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I can't think of any other potential issues, although obviously that doesn't mean there aren't any. I did my search in a similar way; the only way something might have been missed is if a sampleFrame
were used under a different name (using
/typedef
/template parameter), but I couldn't find any such cases (I only found two template uses - the vector in the LV2 code, and the ringbuffer, which are both fine). I'm not sure what we can do to test this further, other than to cover every bit of code that handles audio, and I think the best way to do that is to have people actually use this. So I think it can be merged.
Code considerations:
- Should the
typedef
s and C-style float pointer casts be replaced by the more modernusing
andconst_cast
? Maybe out of scope, but since those lines are touched anyway they could be updated. - Are the merge conflict warnings worth keeping? The recording PR already has lots of merge conflicts, including in that same file.
I think there is a plan to split that into several small parts. I'm not sure if we will do that, BTW. |
The cast to non-
Somehow I think they can be removed. I'll do that soon. |
The `data_in` member has been fixed to use `const float*` instead of `float*` in libsamplerate in January 2013, commit 2d64679ffb4bbcff2aa1729797d8c9cbd4219bff . So we don't need this cast anymore.
OK, I just tested, our CI fails without the const cast 👎 So I'm now adding |
... in order to make standard containers be able to store it. Required for LMMS#5532 (LMMS#4899) and the recording PR. This includes: * removing the `LocklessRingBuffer<sampleFrame>` specialization * passing samplerame in `StereoDelay::tick` as a reference Additional cleanups: * removing already unused typedef `sampleFrameA` * add some `const_cast` to make code more readable
... in order to make standard containers be able to store it.