noisetorch / NoiseTorch

Real-time microphone noise suppression on Linux.
Other
9.12k stars 228 forks source link

Cleanroom Code to Return to GPL3 #359

Open TheDukeofErl opened 1 year ago

TheDukeofErl commented 1 year ago

IMPORTANT

If you'd like to help with this effort, please only read headings marked with "(Safe)". I'll also mark sections that should not be read as "(Dangerous)". "Dangerous" parts of this could "taint" anybody who would like to help: that is to say, once the code that has the modified GPL3 has been viewed or studied, a person is "tainted" for a time, until they don't have a recollection of the code in question any more. This is a cleanroom operation and therefore a bit of a pain in the rear...

Preface (Safe)

This ticket is an offshoot of #328, in which the previous maintainer made a demand that the software's name be changed due to their modification of GPL3. It's not the greatest situation in the world by any means but it's arguably the simplest path forwards in terms of returning to a stock GPL3 license as well as being able to use the name "NoiseTorch" once again. With this history in mind, this is not the place to discuss any opinions on the former maintainer or their choices. I understand that there are strong opinions on this matter, however, I would like this to be a constructive path forwards.

Code in Question (Safe)

The code in question is that which was written by lawl after the license change which occurred on February 24th, 2021 in commit 8b054c20a909c9cc459e87ee8b56226c0428201b. A new branch has been created, which currently has the non-Pipewire related code which lawl wrote gutted out: https://github.com/noisetorch/NoiseTorch/tree/reimplementation. Note that, in general, this branch's commits should not be looked at. The code that must be rewritten is marked with TODOs. These should be used instead. If one desires, the commit which contains the added TODOs (but not the removal of the old code) can be viewed: https://github.com/noisetorch/NoiseTorch/commit/8443079eaff4f27fc3486ce35e42b0f58de1f803.

Note (Safe)

Currently, the modified GPL3 code for Pipewire is present in the branch. To my understanding, this code also cannot be referenced when writing the new code.

Currently Ready to Re-write Code (Safe)

The current code which is ready to rewrite relates primarily to the CLI, the loading of the module, setting binary capabilities, and UI elements. The UI is made with nucular An understanding of this will probably be helpful with the reimplementation of the code.

Code Which is Still Present (Dangerous)

Please do not view if you'd like to help rewrite code. If you'd like to help by removing old code and adding TODOs, this is the section for you. The code from commit https://github.com/noisetorch/NoiseTorch/commit/fad3e1d4f4e76a74c6e32cf11f892b6ba3022c69 contains the Pipewire code that lawl added to the repository which will need to be clean roomed. The simple version of what has to be done to get this code ready should be staged in two commits - Remove the old code - Only code written by lawl that they hold copyright over must be removed - Add TODOs with a description of what the code did A good reference for how this needs to be done can be seen in the reimplementation branch, by looking at commits https://github.com/noisetorch/NoiseTorch/commit/e92032eb33400330176f094583f991f0a18d07f7 (removal) and https://github.com/noisetorch/NoiseTorch/commit/8443079eaff4f27fc3486ce35e42b0f58de1f803 (descriptions). Remember, doing this will *absolutely* disqualify you from writing any new code to replace the code you removed for quite a while.

Conclusion (Safe)

I think this probably covers most of the content here. I'll ask the others who are cognizant to let me know what needs to be edited (or to do the edits themselves :)). I'm also relatively sure that my explanation as to what needs to be done is as clear as fog. Feel free to post in the issue with questions but do NOT include anything that could potentially taint others from being able to write code. We need to treat this as relatively hard line in the sand.

If you need to include anything that could be considered "dangerous", please clearly mark the section and use HTML to hide the content from others:

<details>
<summary>A nice little dropdown goes here, nothing "dangerous" is allowed in this section</summary>
This is where dangerous things should go!
</details>

For those not familiar with HTML, this will result in the following:

A nice little dropdown goes here, nothing "dangerous" is allowed in this section This is where dangerous things should go!

I appreciate everyone's understanding in this matter and the relative sensitivity of maintaining this approach, even if it does seem a bit extreme.

kdkasad commented 1 year ago

I'll try to help with this. I don't actually know Go and I don't know too much about PulseAudio's and PipeWire's APIs, so I might not be able to do much.

I'll push to the reimplementation branch of my fork for now, then I'll make a PR when done.

Edit: to clarify, am I allowed to look at the code that existed before the license change in 8b054c2?

TheDukeofErl commented 1 year ago

Thanks @kdkasad!

Edit: to clarify, am I allowed to look at the code that existed before the license change in https://github.com/noisetorch/NoiseTorch/commit/8b054c20a909c9cc459e87ee8b56226c0428201b?

Nope, it has to be written from scratch without looking at the old code. Code not after the license change should be safe to look at though, though the affected sections wouldn't have existed at all. Anything written by anyone other than lawl should also be fine but it's probably best not to look around for that specifically.

Sorry, ignore what I just said. Yes, you should be fine looking at code that existed prior to that commit, as that's the commit that the license was originally changed in :)

TheDukeofErl commented 1 year ago

360 has been merged, dealing with the non-PipeWire code. A huge thanks out to @kdkasad for doing this!

Karlinator commented 1 year ago

I am untainted and want to help. To my understanding it is PipeWire-related code that remains, but has not been removed yet? If someone already "tainted" can remove and mark the appropriate sections I can dig into the PipeWire stuff!

TheDukeofErl commented 1 year ago

Thanks for reaching out! Once the code is removed we'll add a comment here to let you know :)

TheDukeofErl commented 1 year ago

Exciting news! Thanks to @AXDOOMER the removal of the old pipewire-related code is done and the comments have been added.

a459bc5910a7f2c907de66f1c1976600b95bcdfc is the commit with the code removed and the comments added. As with last time, a branch should be made off https://github.com/noisetorch/NoiseTorch/tree/reimplementation. I'm not going to post the other commit hash, as it would be considered dangerous. Once again, please do not view the other commits in the branch or study the removed code.

@navarro967 and @Karlinator, both of you have expressed interest in updating this code. I know it's been a bit of time since then, please drop a message in here! Hopefully soon we'll be back to GPL3 :)

Karlinator commented 1 year ago

@TheDukeofErl I have returned from my slumber. I'm gonna try digging into this this week, finally.

syphoxy commented 1 year ago

I'd like to lend a hand if I am able to. I haven't read any of the dangerous sections nor have I seen any of related tainted code. I reviewed the TODOs commit and it does seem like something I can help with. it's unclear how work is being coordinated right now though. are we tracking who is working on what somewhere?

ZyanKLee commented 1 year ago

There is no tracking about who does what at the moment. Perhaps you can coordinate with @Karlinator and @Navarro967 about who finds time and/or wants to look at what? You can do so here for example. Aside from that, there is a Noisetorch organization at Matrix we can invite you to, if you would prefer a more direct communication.

syphoxy commented 1 year ago

that sounds good to me. I just created an account, @syphoxy:matrix.org.

RiemaruKarurosu commented 1 year ago

Is there anything I could help with?

AXDOOMER commented 9 months ago

tl;dr the purpose of this issue is to rewrite the lines of code that were removed then described here https://github.com/noisetorch/NoiseTorch/commit/a459bc5910a7f2c907de66f1c1976600b95bcdfc so that the software's license can safely be restored to a pure GPL3 license.