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

audio redesign #2407

Closed
wants to merge 13 commits into from
Closed

Conversation

pgScorpio
Copy link
Contributor

@pgScorpio pgScorpio commented Feb 19, 2022

Short description of changes

Redesign of all sound handling for different platforms as discussed here.

The user interface should be the same for all platforms as much as possible.
No sound related platform dependent code in CClient. (Also all interface related settings should eventually be handled in CSound).

Context: Fixes an issue?

Could also fix: #1378, #2344, #2238, #2496, #2519
Also better solution for: #2168, #2215

Does this change need documentation? What needs to be documented and how?

A new sound interface (CSoundBase) should be well documented as this PR evolves.

Status of this Pull Request

Work in progress.
Initial stage (Replacing ASIOSDK2 for Windows) could already be merged after reviewing and testing.
A lot of following steps still to be taken. See the discussion.

What is missing until this pull request can be merged?

Merging should be done in steps, as will be discussed in this PR.

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@hoffie
Copy link
Member

hoffie commented Feb 20, 2022

Continuing from #2400 (reply in thread) regarding ASIO SDK inclusion and modification:

I don't think this should be a problem since it is not really different from including the full ASIOSDDK2.

We currently don't include (as in: distribute) ASIO SDK at all, as far as I can see. It is downloaded during build.

just used the by Steinberg supplied ASIO definition headers (just moved them to the windows folder, and did some minor fixes. AFAIK I did not remove any Copyright notices!). and the other code is a structured replacement of the spaghetti ASIOSDK2 example code and some modified Jamulus specific code.

Hmm, maybe I'm confusing something, but asio.cpp in this PR looks similar (though not identical) to Steinberg's asio.cpp. While the original file contains a Steinberg copyright header, the one in this PR doesn't.

Regarding minor fixes and replacements: I don't think we are allowed to do even that. We should really avoid copying that code into the Jamulus source.

"The Licensee is only allowed to publish an ASIO Driver Compliant Product and/or ASIO Compliant Hardware Products to the public based on a Licensed Software Developer Kit which is not declared as a preview or beta version by Steinberg"

I think this only means that only final releases of the SDK must be used for public software, doesn't it?

@pgScorpio
Copy link
Contributor Author

We currently don't include (as in: distribute) ASIO SDK at all, as far as I can see. It is downloaded during build.

But it's code is included in the build right?
There Is difference between including the SDK or including code based on the SDK in the repo, Since then we don't distribute a SDK.

Hmm, maybe I'm confusing something, but asio.cpp in this PR looks similar (though not identical) to Steinberg's asio.cpp. While the original file contains a Steinberg copyright header, the one in this PR doesn't.

Yes! I forgot about that one! I removed the copyright header there since there where quite some changes to the file (And the License agreement explicitly tells not to refer to Steinberg in modified code.). Maybe I should include a "based on" disclaimer?

Regarding minor fixes and replacements: I don't think we are allowed to do even that. We should really avoid copying that code into the Jamulus source.

The main part of the ASIOSDK2 is "example" code, so at least we should be allowed to change that code.
For the other files: The License agreement explicitly says you can use code "based on" the ADIOSDK.

I think this only means that only final releases of the SDK must be used for public software, doesn't it?

I agree that the License agreement is not quite clear, but as far as I can see the restriction on changes only apply to redistribution of the SDK itself.
To be on the safe side I think we just could include a Disclaimer file containing "Parts of this code are based on ASIOSDK2 by Steinberg Media Technologies GmbH, and so we are bound to the ASIO SDK Licensing Agreement" and include the Steinberg ASIO Licensing Agreement pdf in the windows folder. (So complying to $2.7 of the License Agreement.)

@gilgongo
Copy link
Member

gilgongo commented Feb 20, 2022

@pgScorpio

There Is difference between including the SDK or including code based on the SDK in the repo, Since then we don't distribute a SDK.

Yes, that's my understanding as well.

We currently haven't got a licence from Steinberg (which I'm hoping will be easy enough to get), and we'd need to comply with a couple of minor things in their terms once we do. But right now I don't immediately see a problem. The relevant clauses in their agreement seem to be 3, 4 and 5. BTW I'm also assuming none of this prevents us from distributing Jamulus under the GPL, since ASIO would be a proprietary or GPL-incompatible "library" and thereby covered either by the system library exception or requiring an exception statement to be added. But we can look at that detail later.

@ann0see ann0see marked this pull request as draft February 20, 2022 09:18
@ann0see
Copy link
Member

ann0see commented Feb 20, 2022

Not related to the licensing:

@pgScorpio

The CI fails.
In order to fix that:

  • could you please install clang format on your machine and run it to comply with the style guide (clang-format -i windows/*.cpp and clang-format -i windows/*.h) should do the trick?
  • Could you please check what needs to be changed in the PowerShell scripts to allow automated Binary compilation on GitHub?

…ADME.MD) and Replaced ASIOSDK2 by own vesion in the windows folder (Copied generic ASIO headers from ASIOSDK2, created new asiodrivers.cpp/h and modified sound.cpp/h and jamulus.pro file accordingly).
@pgScorpio
Copy link
Contributor Author

@ann0see

In order to fix that:

  • could you please install clang format on your machine and run it to comply with the style guide (clang-format -i windows/*.cpp and clang-format -i windows/*.h) should do the trick?

Done.

  • Could you please check what needs to be changed in the PowerShell scripts to allow automated Binary compilation on GitHub?

Please clarify. What Powershell scripts for which automated Binary compilation?

The JamulusWin files are just added for building in Visual studio during development. The normal autobuild scripts should still work too...

@ann0see
Copy link
Member

ann0see commented Feb 20, 2022

Not sure: the style check has failed again. https://github.com/jamulussoftware/jamulus/runs/5264558226?check_suite_focus=true

Let‘s wait until the autobuild scripts are run. You‘ll be able to check what failed if you click on the Checks tab in your PR 😀

@ann0see
Copy link
Member

ann0see commented Feb 20, 2022

It seems to me as if these changes weren’t enough (but I have the feeling that there was an improvement: https://github.com/jamulussoftware/jamulus/runs/5264767533?check_suite_focus=true)

@hoffie
Copy link
Member

hoffie commented Feb 20, 2022

@pgScorpio I started drafting a reply to your points, but realized that we might get lost in the details. I agree with some of your interpretations of the licensing situation, yet it will leave uncertainty. Therefore I want to go back one step again: Why do we have to change the way we include ASIO SDK? Does it fix an actual bug or issue, if so, which part of the change?

@pgScorpio
Copy link
Contributor Author

Not sure: the style check has failed again. https://github.com/jamulussoftware/jamulus/runs/5264558226?check_suite_focus=true

Strange indeed... Somehow "clang-format -i windows/*.h" missed something, since a clang-format with the Visual Studio LLVM
clang plugin did some changes again...

Even stranger... The remote check seems to do strange things with pointer parameters:

-    virtual ASIOError getBufferSize ( long* minSize, long* maxSize, long* preferredSize, long* granularity )                     = 0;
-    virtual ASIOError canSampleRate ( ASIOSampleRate sampleRate )                                                                = 0;
-    virtual ASIOError getSampleRate ( ASIOSampleRate* sampleRate )                                                               = 0;
-    virtual ASIOError setSampleRate ( ASIOSampleRate sampleRate )                                                                = 0;
-    virtual ASIOError getClockSources ( ASIOClockSource* clocks, long* numSources )                                              = 0;
-    virtual ASIOError setClockSource ( long reference )                                                                          = 0;
-    virtual ASIOError getSamplePosition ( ASIOSamples* sPos, ASIOTimeStamp* tStamp )                                             = 0;
-    virtual ASIOError getChannelInfo ( ASIOChannelInfo* info )                                                                   = 0;
-    virtual ASIOError createBuffers ( ASIOBufferInfo* bufferInfos, long numChannels, long bufferSize, ASIOCallbacks* callbacks ) = 0;

changed to:

+    virtual ASIOError getBufferSize ( long* minSize, long* maxSize, long* preferredSize, long* granularity )                      = 0;
+    virtual ASIOError canSampleRate ( ASIOSampleRate sampleRate )                                                                 = 0;
+    virtual ASIOError getSampleRate ( ASIOSampleRate * sampleRate )                                                               = 0;
+    virtual ASIOError setSampleRate ( ASIOSampleRate sampleRate )                                                                 = 0;
+    virtual ASIOError getClockSources ( ASIOClockSource * clocks, long* numSources )                                              = 0;
+    virtual ASIOError setClockSource ( long reference )                                                                           = 0;
+    virtual ASIOError getSamplePosition ( ASIOSamples * sPos, ASIOTimeStamp * tStamp )                                            = 0;
+    virtual ASIOError getChannelInfo ( ASIOChannelInfo * info )                                                                   = 0;
+    virtual ASIOError createBuffers ( ASIOBufferInfo * bufferInfos, long numChannels, long bufferSize, ASIOCallbacks* callbacks ) = 0;

So sometimes changing 'type* name' to 'type * name' but not consistant!
Also the check seems to use a different ColumnLimit.
In .clang-format ColumnLimit is specified as150, But the check breaks a line of 149 characters long. (asiodrivers.cpp)

-const pIASIO NO_ASIO_DRIVER = ( (pIASIO) ( &NoAsioDriver ) ); // All pIASIO pointers NOT referencing an opened driver should point to NO_ASIO_DRIVER!
+const pIASIO NO_ASIO_DRIVER =
+    ( ( pIASIO ) ( &NoAsioDriver ) ); // All pIASIO pointers NOT referencing an opened driver should point to NO_ASIO_DRIVER!

So how to overcome these differences in remote and local checks?

@pgScorpio
Copy link
Contributor Author

@hoffie

Therefore I want to go back one step again: Why do we have to change the way we include ASIO SDK? Does it fix an actual bug or issue, if so, which part of the change?

As a whole: (Without getting lost in details again.)
1: It fixes unnecessarily opening and closing of the drivers at startup.
2: The new code is well structured.
3: The new code is somewhat faster.
4: The new code reduces the chance on future bugs.
5: It simplifies the next step in the redesign.

And finally. This is the whole idea of my PR! Getting the whole sound handling throughout the software implemented in a well structured manner, so maintenance becomes a lot easier and less error prone.

@ann0see
Copy link
Member

ann0see commented Feb 20, 2022

It fixes unnecessarily opening and closing of the drivers at startup.

Is this done in code based on the example from steinberg?
We should really avoid touching the SDK since updating will be difficult (= more maintenance; exactly what you wanted to avoid with this PR). We should use the SDK as plug in (as is at the moment).

Copy link
Member

@ann0see ann0see left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comments. We should really avoid modifying any file in the SDK. If steinberg provides code - and it is not effective - steinberg should fix it.

Comment on lines +1 to +25
JamulusWin.* files for builing the windows version using visual studio 2019 (by pgScorpio)

#==================================================================================================
# WARNING:
# The vcx project files in this folder are heavily modified to make them movable.
# DO NOT REGENERATE VCX FILES FROM Qt!
# When the Jamulus pro file is changed, the vcx files need (often manual) editing too!
#
# In Visual Studio NEVER use ABSOLUTE PATHS but always use the appropriate variables.
# In Visual Studio NEVER use PERSONAL PATHS but always use appropriate environment variables.
#
# Do NOT directly open the JamulusWin.vcxproj or JamulusWin.sln files by double-clicking !
# ALWAYS start Visual studio using this script from Powershell using./JamulusWin.ps1 --startvs
#==================================================================================================


JamulusWin.ps1 is a PowerShell script to setup the environment needed for builing with Visual Studio.
JamulusWin.ps1 also handles all Custom Build Steps during building of the project. (Modify when needed.)

Run ./JamulusWin.ps1 without parameters for command options info.

You should check the variables defined in JamulusWin.ps1 to reflect your Qt installation

You can modify the 'User Defined functions' in JamulusWin.ps1 if needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go into COMPILING.md if we merge the vs files.

# Visual Studio Tool Script by pgScorpio
#==================================================================================================
Add-Type -AssemblyName 'PresentationFramework'
#==================================================================================================
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you write a script which gets the files from qmake and modifies them?
Why should we include vs files directly in the repo? They should be EASILY generated by qmake - or a script using qmake. If there are manual steps, they should be documented in COMPILING.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ann0see

Could you write a script which gets the files from qmake and modifies them? Why should we include vs files directly in the repo? They should be EASILY generated by qmake - or a script using qmake. If there are manual steps, they should be documented in COMPILING.md

Of coarse anything is possible, but it would not be easy. Don't forget these files are in my repo because I use them for development and I want them under version control too. They don't need to be included when merging to master.

windows/asio.cpp Outdated
asio.cpp

asio functions entries which translate the
asio interface to the asiodrvr class methods
Copy link
Member

@ann0see ann0see Feb 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned by @hoffie
How can we avoid including code based on Steinberg's work? Could you at least show clearly what you changed (and why). We should still require the Steinberg code to be downloaded (this ensures we're compatible with Debian for example)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ann0see

As mentioned by @hoffie How can we avoid including code based on Steinberg's work? Could you at least show clearly what you changed (and why). We should still require the Steinberg code to be downloaded (this ensures we're compatible with Debian for example)

I already changed the code to include the ASIOSDK2 as before, but just using two headers from the common folder. Also I rearanged some of my code and changed the filenames so they don't match SDK filenames to avoid confusion.

windows/asio.h Outdated
//---------------------------------------------------------------------------------------------------

/*
Steinberg Audio Stream I/O API
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above. This is COPYRIGHTED by Steinberg.

}
}

bool CAsioDrivers::loadDriver ( long index )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that jamulus's code here?

@ann0see
Copy link
Member

ann0see commented Feb 20, 2022

We should solve some generic questions around this before continuing...

@pgScorpio
Copy link
Contributor Author

We should solve some generic questions around this before continuing...

I totally agree on that !!

As said before my time to spend on this is limited, and at the moment I've got the feeling I'm spending more time on these discussions than on coding.

Also I notice it are basically the same questions that are asked again an again. Do we really understand the ASIO code and the Licence agreement?

There are only 2 header files in the ASIOSDK that specify the ASIO version:

iasiodrv.h that specifies the iASIO interface to the driver dll (function definitions).
and
asio.h that specifies the types and values used by the iASIO functions.

Updating to a new ASIO version would just mean replacing these two headers, and maybe some code change to our own code if we want to use any new functionality, but notice that the iASIO interface has never changed (at least not since 2008), just support for 64 bit systems and stream synchronization was added later (AFAIK by just adding things like enum values and struct definitions for 64bit values.) and all these years the ASIO interface always stayed backwards compatible.

These two header files are almost unchanged, and can be fully reverted if necessary (Though the licence nowhere says you are not allowed to modify the files, as long as you don't state they are from Steinberg, but "based on ASIOSDK2")

All other files are "selecting the current driver" (opening a dll and set a pointer to it's interface) and glue between the application and IASIO. Until now we literally used the sample code in the SDK (But you are not restricted to using the SDK examples at all, )

Filename similarities in the windows folder and the SDK are just because the way I did the redesign, so these files can easily be renamed if we want. They have nothing to do with the SDK, nor with the ASIO specification, since they just, transparently, pass the iASIO interface.

So please make some decisions first, then I will decide if I will continue with this PR or not.

…from the SDK's common folder)

Shuffled some code around and renamed files to avoid confusion with ASIOSDK files.
Excluded ASIOSDK from clang.
Excluded macOS build files from git.
@ann0see
Copy link
Member

ann0see commented Feb 25, 2022

I think the general consensus was that the current ASIO implementation is not optimal. changing the ASIO interface would be good. However your changes look dangerous (license wise) and probably do not fulfill some unwritten Jamulus standards (You changed the Build process for developing locally via VS, but probably this should not be pushed directly to master. Better document it somewhere such that further contributors can do it on their own).
Performance improvements or similar are probably best made as far away as possible from the Steinberg ASIO code. To sum it up, I think one should focus on improving the current code and probably the maintainers don’t think the current direction of this PR is good —> close the PR and use a different approach.

@jamulussoftware/maindevelopers could you please comment on any decision how to handle these changes?

@pgScorpio
Copy link
Contributor Author

I think the general consensus was that the current ASIO implementation is not optimal. changing the ASIO interface would be good. However your changes look dangerous (license wise) and probably do not fulfill some unwritten Jamulus standards

Not only the ASIO implementation.... (macOS would need quite some redesign too.) But concerning ASIO I still don't understand what the real problem with ASIO is. Are we obliged to use ALL the (example) code in the SDK?? Did anybody ask Steinberg if it is OK to only use the necessary dll interface header files from the SDK?
And please clarify these unwritten Jamulus standards. How can we follow standards that are not known to the (new) contributers?

(You changed the Build process for developing locally via VS, but probably this should not be pushed directly to master. Better document it somewhere such that further contributors can do it on their own).

The modified VS project files where just added to my personal repo for personal use, they where never intended to merge to master...

Performance improvements or similar are probably best made as far away as possible from the Steinberg ASIO code.

The idea was to get a more uniform implementation of all sound code to prevent platform specific bug/impossibilities (As there seems to be a lot.), but this is very hard if we have to stick with the current implementation for ASIO. Again I don't see why we have to use a 'spaghetti' example code... Almost every SDK contains additional example code, but it is hardly ever used as-is. Normally you only use the library headers, and this is exactly what I do with the ASIO SDK.

To sum it up, I think one should focus on improving the current code and probably the maintainers don’t think the current direction of this PR is good —> close the PR and use a different approach.

'improving the current code' is exactly what I intended to do, but this is very hard if a lot of people are reluctant to change any code at all (and there should be BIG changes!). So perhaps indeed I better close the PR?

@jamulussoftware/maindevelopers could you please comment on any decision how to handle these changes?

Yes any advise is welcome. I have a lot of ideas (Based on over 30 year experience), but do you still want me to contribute?

@ann0see ann0see marked this pull request as ready for review March 20, 2022 21:09
@ann0see ann0see marked this pull request as draft March 20, 2022 21:10
@pgScorpio
Copy link
Contributor Author

pgScorpio commented Mar 21, 2022

@hoffie @ann0see

If you prefix your (test) branch with "autobuild" (e.g. autobuild-sound-redesign), our Github Actions will automatically kick in on your branch and will build artifacts for all platforms, so you don't have to build/upload yourself (in fact, that would be preferable as this is the exact pipeline which runs for official releases).

That would be nice !
Is there any documentation on these procedures ? That would be very welcome...
I tried to get the autobuild scripts to work locally, without succes....
I now changed my branch name, hopefully in the correct way.

I'm noticing that the list of issues which this PR apparently fixes is growing. That's great and sounds very valuable! When do you think would be a good point to start merging the first parts of it?

At this moment the only CSound implementation that is not yet tested at all is iOS. Though I did adapt the iOS files to match the new structure as much as possible, but I have no clue on how to compile them, so debugging is also impossible, and so I didn't commit my last changes yet.
Is there anybody familiar with the iOS build ?
And is iOS still alive at all ??
And would it be save to commit untested iOS code ? (If I did someone else maybe could finish the work on those too.)

As far as all the other OS'es concerns we maybe could already merge them (At least they are already working, but may need the finishing touch on error messages and other gui texts).
Only I still have a gui scaling problem on Android! (Slider buttons and Leds are too small and dialogs are vertically compressed while there is enough space. Anybody any idea why???)

I'm asking for two reasons:

  • First, I notice that the combined diff as part of this PR is getting larger and larger. I fear that it will be hard to review and merge.

Yes, I agree, but please test the result and do not try to check every changed line, since too much has changed, it's a re-design!

Therefore, the earlier we can start with the first chunks of it, the better.

My idea too ;=)
Perhaps others can already start testing and reviewing my branch ? (Especially when autobuild really kicks in now.)

  • Second, if we want to get some/most/all of this into 3.9.0 we should start some time soon as well. We don't have an exact schedule for 3.9.0 yet and there's still lots of stuff planned. At the same time, I think we are talking about weeks and not months until we'll start finalizing 3.9.0.

I think this redesign is not yet ready for 3.9.0 and since it is a major redesign. I want it thoroughly tested first, and I think it would be logical if it becomes a 4.0.0 than.
Also I would like to see a better solution for the inifile handling first, so that would also become more efficient and platform independent, I know this is already work in progress, but I have no clue on what is going on (never saw commits on that branch, and now I even don't see that branch anymore ?), but I have some great idea's and suggestions on that issue too (Whoever is working on it please contact me!).

If you feel ready, I suggest closing this PR (you can keep using your branch, of course) and submitting the individual, buildable parts based on current master as separate PRs (probably excluding the MSVC project stuff).

As mentioned before, this is a major change in the framework that affects CSoundbase, CSound of all OS'es and also CClient and it's dialogs. So I'am afraid there is no way to submitting individual buildable parts. Concerning the sound redesign it's all or nothing I'm afraid (at least the first step).
Of coarse I could try to make a new branch that only contains all the sound framework changes, but not the, already implemented, solutions on the other issues, also there are some new additions (like messageboxes and commandline parameter parsing) that could be implemented before the redesign, but that would be extra work for me of which I'm not sure it would pay off. Also several other issues are actually solved by the new implementation itself, so I have no ready solution for them without the redesign.

@ann0see
Copy link
Member

ann0see commented Mar 21, 2022

Is there any documentation on these procedures ?

Concerning the autobuild scripts: they aren‘t designed to run locally. In order to run them on GitHub, you must push to a branch named like this: autobuild/sound-redesign

And is iOS still alive at all

Yes sure. It’s fully alive and people use it with success. You can however rely on others testing it or the simulator.

Only I still have a gui scaling problem on Android!

I‘m afraid that this means your test device isn’t suitable for testing the current Android version (do you have a tablet? VM?). The mobile GUI isn’t well adapted, but that’s another issue.

do not try to check every changed line

Before merging at least one person of the maintenance team MUST fully understand the changes. We need to ensure new code is understood such that it can be changed/explained to other contributors if necessary.

Concerning the split out:

Usually the probability of merging small PRs is a lot higher than big ones (see JSON-RPC which took about half a year although it was 99% finished). Some even don’t get merged. So I think it’s worth splitting it in mergable, independent parts (maybe you can find some)?

Moreover I suggest you to quickly read a bit about git rebase, how to handle conflicts and how to use branches if you don’t feel comfortable with git yet.

@hoffie
Copy link
Member

hoffie commented Mar 21, 2022

I now changed my branch name, hopefully in the correct way.

It seems like you've changed your fork's repository name. That's not necessary and might be rather confusing. The important part is changing the branch name (i.e. sound-redesign -> autobuild-sound-redesign; @ann0see suggested autobuild/sound-redesign, that would work as well).

Yes, I agree, but please test the result and do not try to check every changed line, since too much has changed, it's a re-design!

I completely understand that sentiment (I've been through larger refactorings/redesigns both in Jamulus and outside of Jamulus). At the same time, the Jamulus code base has grown with bugfixes of several years. Testing is surely important, but even before that we should also be very certain which part is changed for which reason in order to avoid removing existing bugfixes/workarounds with no replacement.

I agree that splitting refactorings/redesigns into parts is a hard, maybe near-impossible task. At the very least we should try to split the actual refactoring from intended changes (bug fixes, new features or even GUI re-designs; that's probably what you've meant by "at least the first step"). If that's not sanely possible in some parts, that'll likely be OK, but it still needs a detailed description what has been done for what reason in the commit messages.
Changes inevitable have a chance to cause new bugs, no matter the quality. If too few people understand the code, there'll be no way to fix those bugs and the only option would be to revert all of the changes. Neither would be a good solution, that's why I'm campaigning for understanding. :)

I think this redesign is not yet ready for 3.9.0 and since it is a major redesign.

That's good to now. At the same time my fear that Jamulus development and sound-rebase development may diverge further, making it even harder to review/diff/avoid losing other fixes. Github already shows 10 file conflicts at the current stage, so as @ann0see suggested, it's essential for you to rebase to current master regularly.

I could try to make a new branch that only contains all the sound framework changes, but not the, already implemented, solutions on the other issues, also there are some new additions (like messageboxes and commandline parameter parsing) that could be implemented before the redesign, but that would be extra work for me of which I'm not sure it would pay off.

I understand that it's more work on the author side of things, but I fear there's no way around that.

Also several other issues are actually solved by the new implementation itself, so I have no ready solution for them without the redesign.

If fixes depend on the redesign, that's fine, then maybe this could be a way forward:

  1. Submit any fixes/improvements which can be done independent of the redesign
  2. When merged, rebase and submit the redesign (this will be the largest part and hard to split, so it should be as close to the current implementation as possible)
  3. When merged, rebase and submit the fixes/improvements which are only possible with the redesigned code.

(Purely anecdotal, feel free to skip: I've recently started adding support for armhf Debian builds. While doing so, I quickly noticed that the autobuild logic had grown to a point where it was hard to reason about. I immediately felt the urge to improve that, to refactor it, simplify it, rename it, etc. So I went ahead and did that. I did all of that in a single evening. I suspect that's how you've got started with the sound redesign as well. Then I realized that a diff of thounds of lines would not be acceptable for a PR which essentialy only adds another build target. Therefore, I went ahead and split those changes into individual PRs. First, I submitted fixes for the existing behavior, e.g. build parallelization and error checking. Then, I found a way to convert each platform individually and submited one PR per platform [this may not be possible in your case, though]. With this almost finished, I can now submit another PR to do further cleanups which haven't been possible earlier. This process has been taking several weeks now, but I'm more than confident that this was essential to get all of this accepted. The individual reviews also lead to discussions and improvements for parts which I didn't think about it. Would we have accepted this as a single huge diff ("because it works"), we would have missed all of this.)


I'm writing such a detailed answer because I highly appreciate the work you do and because it would be a pity if it took too long to merge that so it everyone can profit from it.

@pgScorpio pgScorpio closed this Mar 21, 2022
@pgScorpio pgScorpio deleted the sound-redesign branch March 21, 2022 12:28
@pgScorpio
Copy link
Contributor Author

It seems like you've changed your fork's repository name. That's not necessary and might be rather confusing. The important part is changing the branch name (i.e. sound-redesign -> autobuild-sound-redesign; @ann0see suggested autobuild/sound-redesign, that would work as well).

OK, I see. I reverted the repository name and, hopefully, now changed branch name to autobuild/sound-redesign correctly.

@pgScorpio
Copy link
Contributor Author

pgScorpio commented Mar 21, 2022

I understand that it's more work on the author side of things, but I fear there's no way around that.

I'm surely willing to give it a try, but I could use some more advise (and maybe some help too.).
Like what would be the best approach ? Should I create another branch for "step-by step" merging ? Or should I create issues and PR's for every step ?

I know there are some changes/additions that can be merged without problem, but I'm afraid to get a lot of comments and questions why since they would hardly have any effect at that moment, but they would be just preparations for future steps and I don't wanna spend a lot of time explaining every step, since merging step by step would already take me a lot of extra time I don't really have,

Also I have a lot of professional experience that taking small steps often leads to more bugs, because several steps would need workarounds that need to be removed again later, both giving extra chance on bugs.
So I can also give some examples from my professional life. i.e. one where it took 3 engineers 2 years to do a step by step framework redesign, which was never released because of some fatal bugs that could not be found/fixed. Than I did a completely new "one-step" redesign in just about 3 months, It then took one month of excessive testing to find just a handful of bugs that where fixed in no time and the new software was released in less than 5 months...
It's just like with buildings... It's hard to repair/improve the foundation when the building is already standing.... Starting all over again is often the better, cheaper and faster choice.

@pgScorpio
Copy link
Contributor Author

@ann0see

Moreover I suggest you to quickly read a bit about git rebase, how to handle conflicts and how to use branches if you don’t feel comfortable with git yet.

I can use some help with this one too.
I tried to rebase after each commit, but git keeps saying "Current branch master is up to date." while I know it isn't, so I'm doing something wrong I guess but the git help page didn't help me any further either.
Could someone tell me exactly what git comand(s) to use ?

@softins
Copy link
Member

softins commented Mar 21, 2022

@pgScorpio The git parts of docs/TRANSLATING.md are also applicable to code development. They are quite detailed, so have a read through them and let us know what questions remain.

@hoffie
Copy link
Member

hoffie commented Mar 21, 2022

OK, I see. I reverted the repository name and, hopefully, now changed branch name to autobuild/sound-redesign correctly.

I don't see an Action run on your repo yet. Maybe you have to enable actions manually once?
https://github.com/pgScorpio/sound-redesign/settings/actions

Should I create another branch for "step-by step" merging ?

Yes, you'd need one branch per PR.

Or should I create issues and PR's for every step ?

Personally, I think individual Issues make sense for two reasons:

  • To announce a specific plan ("There's problem X and I'm going to solve it that way") for transparency so that people can chime in. @pljones reminded me that this is especially important for UI/UX-related work.
  • To track work which isn't PR-ready yet (TODO-style)

For work where code has already been written, a PR with a proper description is sufficient in my opinion.

@ann0see
Copy link
Member

ann0see commented Mar 21, 2022

@pgScorpio I might be able to help you a bit with git via a video conferencing tool (preferably in the evenings if time permits). However, my git experience is mostly based on what I learnt from contributing to this project, so it's not perfect at all.

@pgScorpio
Copy link
Contributor Author

Help !!!

I don't know what went wrong, renaming branch/repo issues or trying to rebase issues, but I completely lost all my local changes (my local folder completely reverted to master). Also, though I just renamed my branch, I now see 2 branches listed, one as sound-redesign and one as autobuild/sound-redesign, where sound-redesign seems to contain the latest changes that I committed today (after the rename!),

Now I only can get my last committed files back by downloading the "sound-redesign" zip, but even cloning my own repo again (with github desktop) gets the master files again, not my own sound-redesign repo, and so I also I can't push any changes to my own sound-design repo again.

So I'm completely lost now, not knowing what to do to get things working again...

@pgScorpio
Copy link
Contributor Author

@ann0see

@pgScorpio I might be able to help you a bit with git via a video conferencing tool (preferably in the evenings if time permits). However, my git experience is mostly based on what I learnt from contributing to this project, so it's not perfect at all.

Any help is welcome !
I'm a complete newbie at github, and I'm even having a hard time understanding the github help pages, so you will know more than I do on that subject...
Time may be an issue though, since I don't know your location... (I'm from the Netherlands, so CET, or GMT+1)

@ann0see
Copy link
Member

ann0see commented Mar 21, 2022

I'm from the same time zone ;-).

@ann0see
Copy link
Member

ann0see commented Mar 21, 2022

BTW: I've just back-upped the branch of this PR to my repo: https://github.com/ann0see/jamulus/tree/backup/pg/sound-redesign

@pgScorpio
Copy link
Contributor Author

@hoffie

I don't see an Action run on your repo yet. Maybe you have to enable actions manually once? https://github.com/pgScorpio/sound-redesign/settings/actions

image

So I guess that should be alright?

@ann0see
Copy link
Member

ann0see commented Mar 21, 2022

I think you'll need to do do a little clean-up in your repo:

  1. Back up your master branch: git checkout master; git checkout -b backup/master-2022-03-21 Do the same for all other branches needing backup
  2. Force update the master branch to upstream.
    2.1 add the jamulussoftware repo as remote "upstream": git remote add upstream [email protected]:jamulussoftware/jamulus
    2.2 git fetch upstream && git checkout upstream/master
    2.3 force push the main repo to your master branch (this will make it even to jamulussoftware's master: (git push --force origin HEAD:master). Do this with care. Since you've backupped, all should be fine. Also I have your changes saved.

Now. And only now. rebase your working branch. I'd suggest to delete the autobuild/sound-redesign branch via GitHub UI first. (do this by clicking on branches and then there should be a delete button). Afterwards do the following:

git checkout sound-redesign to get your code from this PR.
git checkout -b autobuild/soundRedesignDev or git checkout -b autobuild-soundRedesignDev (this allows it to be a development branch with the build scripts running by default) to change into the branch you want to rebase

Now follows the difficult part (the actual rebasing process):

git rebase -i upstream/master
Select all commits and fix the conflicts. Once they are fixed for one commit, continue with the next one by executing git rebase --continue until you're finished.

@pgScorpio
Copy link
Contributor Author

I think you'll need to do do a little clean-up in your repo:

Aaaaarghhh !!!
Just got it working again by
git clone --branch autobuild/sound-redesign https://github.com/pgScorpio/jamulus.git ./jamulus-sound-redesign
updated from my backup of sound-redesign, and committed these changes to autobuild/sound-redesign too.

Then followed your instructions by the letter.
But got a:
[email protected]: Permission denied (publickey).
from git fetch upstream
fatal: Could not read from remote repository.

And again all changes lost !!

I'll try again tomorrow....

@ann0see
Copy link
Member

ann0see commented Mar 22, 2022

Ok. So you didn’t Set up your ash key on GitHub. Replace [email protected]:user[…] by https://github.com/user[…]

@jujudusud
Copy link
Member

Ok. So you didn’t Set up your ash key on GitHub. Replace [email protected]:user[…] by https://github.com/user[…]

Or better set up you ash key on GitHub... ;-)

@pgScorpio
Copy link
Contributor Author

Or better set up you ash key on GitHub

Aha! Good point. I once did, but in the mean time I have a new PC and didn't think about the ssh keys, so I had to add a new key on github :=((

@pgScorpio
Copy link
Contributor Author

pgScorpio commented Mar 22, 2022

Got further now, but now I get:

$ git push --force origin HEAD:master
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/pgScorpio/jamulus.git
 ! [remote rejected]   HEAD -> master (refusing to allow an OAuth App to create or update workflow `.github/workflows/autobuild.yml` without `workflow` scope)
error: failed to push some refs to 'https://github.com/pgScorpio/jamulus.git'

EDIT: @ann0see Could this be because the PR is closed ? Maybe that also explains why autobuild does not kick in ??

@ann0see
Copy link
Member

ann0see commented Mar 22, 2022

No. I doubt it. also this PR isn’t from your master branch. I think you need to push via SSH to have full access.

@pgScorpio
Copy link
Contributor Author

I think you need to push via SSH to have full access.

?? I just used the commands you gave me. Aren't they all using SSH then ?
git fetch upstream only worked after I updated my SSH key on github, so at least that one seems to use SSH.

@ann0see
Copy link
Member

ann0see commented Mar 22, 2022

It seems as if it’s not the case for origin:

To https://github.com/pgScorpio/jamulus.git

Conveys that you’re using https (maybe only for origin not for the upstream remote. You‘ll need to update the origin remote: https://pandammonium.org/how-to-change-a-git-repository-from-https-to-ssh/)

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

Successfully merging this pull request may close these issues.

6 participants