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

feat(playout): add master_me audio preprocessing and compression library #2919

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

caveman99
Copy link
Contributor

Description

Similar to non-free Stereotool this is a free broadcast compressor that is supported as a standard linux plugin to liquidsoap. Initial support adds 5 original presets (Easy mode) and a LUFS slider to the GUI/Legacy streaming presets. Disabled (default) skips the plugin completely.

Warning: this adds a considerable amount of software processing (e.g. CPU and Memory Usage). Also the current PR assumes X86_64 system and will not work on Raspberry PI systems.

Are there documentation changes required as a result of these changes? See
https://github.com/libretime/libretime/wiki/Documentation-Requirements

Yes, Documentation is still missing.

Testing Notes

Change compressor settings and reload libretime-liquidsoap. After playback resumes notice increased CPU and memory usage, and non-linear sound.

@caveman99 caveman99 changed the title feat(playout) add master_me audio preprocessing and compression library feat(playout): add master_me audio preprocessing and compression library Jan 26, 2024
Copy link

codecov bot commented Jan 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.51%. Comparing base (2b119ad) to head (790bdae).
Report is 54 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2919      +/-   ##
==========================================
+ Coverage   70.36%   70.51%   +0.14%     
==========================================
  Files         149      149              
  Lines        4033     4043      +10     
==========================================
+ Hits         2838     2851      +13     
+ Misses       1195     1192       -3     
Flag Coverage Δ
api 93.75% <100.00%> (+0.02%) ⬆️
playout 47.78% <100.00%> (+0.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caveman99 caveman99 marked this pull request as ready for review January 27, 2024 22:14
@caveman99
Copy link
Contributor Author

I know, this is a complex PR and it introduces a 3rd party dependency (optional on the installer, included in the docker build), but can i get a general opinion on how to proceed with this? The external SO will likely never hit a debian or ubuntu package since it's a really specialized software, however, liquidsoap 1.0 and newer had a very broad support for this typ of plugin, so at least we don't have to differentiate between the liquidsoap versions.

@jooola
Copy link
Contributor

jooola commented Feb 2, 2024

I think the proposed addition is sensible, but I prefer to keep this outside of LibreTime. Every radio station has different needs and if we merge this, we would open ourselves to adding a looot of 3rd party tools.

That said, I do acknowledge that LibreTime currenlty does not provide an easy way to customize liquidsoap. (#229)

What we can work on is to provide an interface to power users so they can plug any tools into liquidsoap: My idea was to provide a list of filepath configuration field that can refer to liquidsoap scripts that will be hooked at different moment of the liquidsoap run script. e.g.

stream:
  hooks:
    before_output: # naming can be improved I think
      - path/to/my/custom/liquidsoap.script.liq
      - path/to/another/custom/liquidsoap.script.liq
    output: []

This way you can plug master_me without custom code.

The only downside is that we do not have an UI to tweak some hooks settings, but maybe we find a way to handle this. I think power users don't necessarily need the UI, but maybe you have a usecase?

I also think that its sad to implement only the "easy" mode for master_me, I would definitly want to play around with more settings at some point.

@caveman99
Copy link
Contributor Author

This way you can plug master_me without custom code.

The downside to this approach, which i considered alternatively is the lack of plugins in the docker module. This can be alleviated by a possibility to spin your own liquidsoap container (possibly also with a different version of liquidsoap itself) and replace the stock one in the docker compose file. I wanted to give people the possibility to use this without digging into docker too deeply.

The only downside is that we do not have an UI to tweak some hooks settings, but maybe we find a way to handle this. I think power users don't necessarily need the UI, but maybe you have a usecase?

I also think that its sad to implement only the "easy" mode for master_me, I would definitly want to play around with more settings at some point.

These tie in to each other. My reasoning was to put the easy mode in the GUI as a first step to see if the PR gets accepted, and afterwards create an 'advanced' preset where a power user could tweak every value not by GUI elements but by editing an advanced.jq2 file.

@jooola
Copy link
Contributor

jooola commented Feb 2, 2024

The downside to this approach, which i considered alternatively is the lack of plugins in the docker module. This can be alleviated by a possibility to spin your own liquidsoap container (possibly also with a different version of liquidsoap itself) and replace the stock one in the docker compose file. I wanted to give people the possibility to use this without digging into docker too deeply.

What do you think about having a volume binding from the host to the liquidsoap container, that contains both the binary/.so/younameit and the related liquidsoap script?

Should be easy enough for users, and could also be configured by default, users would only have to drop their files in the folder?

@caveman99
Copy link
Contributor Author

The downside to this approach, which i considered alternatively is the lack of plugins in the docker module. This can be alleviated by a possibility to spin your own liquidsoap container (possibly also with a different version of liquidsoap itself) and replace the stock one in the docker compose file. I wanted to give people the possibility to use this without digging into docker too deeply.

What do you think about having a volume binding from the host to the liquidsoap container, that contains both the binary/.so/younameit and the related liquidsoap script?

Should be easy enough for users, and could also be configured by default, users would only have to drop their files in the folder?

Thats a great idea... This should be not too difficult to add. Suggestion: we can keep the easy mode GUI but hide it if the plugin is not loaded. This way people can experiment with the features wihtout too much scripting.

@jooola
Copy link
Contributor

jooola commented Feb 2, 2024

Thats a great idea... This should be not too difficult to add. Suggestion: we can keep the easy mode GUI but hide it if the plugin is not loaded. This way people can experiment with the features wihtout too much scripting.

Hmm, not sure if I want to ship the GUI at all, maybe also as plugin (using a .php file) ? Maybe some really good documentation could do the trick for most users?

@caveman99
Copy link
Contributor Author

Yes, sure, if somebody really wants this one can do everything in a text file. Documentation is key. I can understand if you don't want to ship a plugin GUI, especially since we want to get rid of the zend stuff anyway,,,

@caveman99 caveman99 closed this Feb 2, 2024
@caveman99 caveman99 reopened this Feb 2, 2024
@caveman99 caveman99 marked this pull request as draft February 9, 2024 11:31
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.

None yet

2 participants