GithubHelp home page GithubHelp logo

marcoc1712 / c-3po Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 3.0 8.31 MB

Squeezebox server plugin that handles server side file type conversion and resampling. Replace custom-convert.conf.

Perl 88.01% HTML 11.94% Batchfile 0.05%

c-3po's People

Contributors

marcoc1712 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

c-3po's Issues

"No dither" option is broken

If the user selects the No Dither option, "-D" option is added at the end of the command line, in place of dithering .

That's wrong, -D should adde as last option BEFORE effects.

i.e.

[flac] -dcs --totally-silent $START$ $END$ -- $FILE$ | [sox] -q -t wav - -t wav -b 16 --buffer 32768 --multi-threaded - gain -h -6 remix -m 1v0.95 2 rate -v -L -b 99 48000 dither -f improved-e-weighted

should become:

[flac] -dcs --totally-silent $START$ $END$ -- $FILE$ | [sox] -q -t wav - -t wav -b 16 --buffer 32768 --multi-threaded - -D gain -h -6 remix -m 1v0.95 2 rate -v -L -b 99 48000

Issue posted by dehi in Squeezebox forum: http://forums.slimdevices.com/showthread.php?105309-C-3PO-plugin-a-trnscoding-helper&p=909627&viewfull=1#post909627

Ultima vers. stabile: non funziona! :-(

Ouch! :-(

[17-03-31 18:33:41.7222] Slim::Utils::Misc::msg (1244) Warning: [18:33:41.7219] Subroutine preferences redefined at /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/C3PO/PreferencesHelper.pm line 53.

[17-03-31 18:33:41.7288] Slim::bootstrap::tryModuleLoad (286) Warning: Module [Plugins::C3PO::Plugin] failed to load:
Experimental keys on scalar is now forbidden at /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/C3PO/LMSTranscodingHelper.pm line 117.

Compilation failed in require at /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/C3PO/Plugin.pm line 77.
BEGIN failed--compilation aborted at /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/C3PO/Plugin.pm line 77.

Compilation failed in require at (eval 926) line 1.
BEGIN failed--compilation aborted at (eval 926) line 1.

...qualcosa è andato storto! :o :-(

Ho provato sia con il repo "stabile" che con quello "beta", stesso risultato. Per sicurezza avevo provato anche a cancellare la cache...

Dipende dalla nuova versione di LMS??

ogg output format

Hi

i am massively using LMS for my day to day music (quality) listening.
However, since i am also sometime travelling i often connect through vpn to my server, but due to bandwitdh reasons i need to listen in the mp3 format, which is not that great.
It would be nice to have the possibilty to convert to ogg output format, which is way better than mp3, (at least to my ears) even at lower rate., especially since the LMS software players are able to play ogg natively!

Joël

ordine filtri

Nella sezione dei filtri passa-basso ci sono i menù a tendina per la selezione dell'ordine, ma l'unico valore selezionabile è 2: non consente di selezionare filtri del primo ordine...

Ripristinare il Target sample rate (per default = al massimo) anche per DSD.

Da pm67:

In alcuni casi può avere senso: se ad es. avessi un DAC che supporta fino a 384K (o più) ma ha uno "sweet spot" (suona leggermente meglio) ad un certo s/r più basso, ad es. 96 o 192, probabilmente sarebbe vantaggioso ricampionare proprio a quella frequenza tutto il materiale con s/r inferiori. Però, se ho del materiale nativo a s/r più alto, è possibile per non dire probabile che non mi convenga "downsamplarlo": facile che quello che guadagnerei per via dello "sweet spot" del DAC lo perderei con gli interessi a causa del downsampling.

La cosa poi è particolarmente importante con il DSD. Prendi il mio caso (che non è poi così atipico): ho un DAC che supporta fino a DSD512 (teoricamente addirittura 1024), ma il PC che fa da server non è in grado di convertire da PCM (e tanto meno "upsamplare" DSD) oltre DSD128. Ora, di files DSD nativi a 512 ed oltre non ne ho mai visti (e considerati i pochissimi sistemi audio in grado di supportarli e le dimensioni folli, dubito ce ne siano...), ma DSD256 sì.

Va da sé che, in simili condizioni, idealmente ciò che vorrei ottenere è che (ad es.) PCM e DSD64 siano convertiti in DSD128 (di più non posso), mentre DSD128 e superiori siano inviati in uscita così come sono.

request: configuration interface changes

Please remove everything but "Supported input formats" and "Default Enable C-3PO for new players" from the "GENERAL SETTINGS" tab.

Leave/move everything else (only) in "PLAYER SETTINGS".

(also remove the "Use global settings" and "Show details" buttons).

If possible, also include (within the player settings) a direct link to the "general settings".

Tnx. :-)

Available set of resample options might not be ideal

My recent post to the slimdevices forum documents all the SoX "rate" options: https://forums.slimdevices.com/showthread.php?105309-C-3PO-plugin-a-trnscoding-helper&p=982220&viewfull=1#post982220

Adding options:

In C-3PO's "Resample" settings, quality level may be selected from 5 options: q, l, m, h, or v. But recent versions of SoX provide a choice of 8 levels: the above 5 plus g, e, and u.

It might be nice to add at least the "u" quality level, since that would allow the selection of 192 dB of noise rejection / 32-bit depth, which currently cannot be selected any other way in C-3PO. Alternatively, adding a way to directly set the "Noise Rejection dB" (-R) or "bit depth" (-d) override options would accomplish the same thing.

Removing options:

C-3PO currently allows the "Use Hi-Precision Clock" (-t) and "No Small Integer Optimisations" (-n) override options to be set. As far as I know, those options simply change the way that certain resampler operations are internally implemented, to aid in SoX software development; they are not intended to affect the output sound in any way.

It might make sense to remove those two options from C-3PO.

Nuove opzioni di ricampionamento

Da SimoneFil #5

Ciao Marco; ti suggerisco due features da aggiungere per la prossima release che a mio parere possono essere molto utili:

1- Menu "Ricampiona:"; insieme a "Sempre", "Mai", "Solo se la frequenza di campionamento non è supportata" aggiungere "Solo per file 16bit 44.1Khz". Fare upsampling a file già in Hi-Res a poco senso e a volte ho pure notato una degradazione sonora; mentre se si limitasse ai 16/44.1 sarebbe ottimo!

  1. #7

add "max irrational ratio" to the "resample at" select.

Da pm67:

Pro memoria:

In pratica è l'inverso di max sync. Significa: "ricampiona sempre al s/r supportato più vicino a max, che non sia un multiplo intero del s/r originario dello stream".

In altre parole, se in ingresso ho un s/r multiplo di 44.1K in uscita produco sempre un s/r multiplo di 48K e viceversa.

SoX multi-thread

Originariamente richiesta da SimoneFil: Vedi #5

Ciao Marco; ti suggerisco una feature da aggiungere per la prossima release che a mio parere può essere molto utile:

Aggiunta al menu Avanzate -> C-3PO (le impostazioni generale). Una casella con: "Enable SoX multi-thread". Ora come ora con una conversione PCM->DSD128 SoX si "beve" il 50% di un core fisico di uno Xeon X5570; che all'incirca è la potenza di un core di un i5 di penultima generazione o un core di un i3 ultima gen. In questo modo si escludono tutte le cpu che sono multi core con TDP molto basso (molte fanless) come i pentium 4core, gli atom 4core e 8core fanless (stile il c2750) che in multithreading riuscirebbero a convertire ma in single core non ce la fanno.

Feature request: Option to place additional effects in a file

Hello, Marco. Thank you for creating this plugin.

For one of my players, I use C-3PO to apply a chain of equalization effects for my headphones. However, I have multiple headphones with different EQ curves, so when I change headphones I must also change the entire contents of the "additional effects" text field. Each headphone's chain contains 11 effects, so this is cumbersome and error-prone -- even if I do it by manually copy-and-paste from text files on my PC.

I am sure that there are other people with similar use-cases.

It would be nice to have the option to specify a file which contains the additional effects, instead of typing directly into the "additional effects" fields. In my case, for example, that would allow me to change my entire EQ effects chain by simply changing a filename in C-3PO settings from "headphone1.txt" to "headphone2.txt".

If you wanted to provide a way to select among multiple effects files -- as LMS does with the Media Folders selection on the Basic Settings tab -- I certainly would not complain. But even just a single file would be great.

Feature request: add missing sdm options

Ciao Marco,

you've recently asked about any feature still missing. I answered "basically none" but, well... I did forgot about the "extra" options (-t,-n,-l) of the sdm function:

https://www.nexthardware.com/forum/pc-top-software/89323-dsd-lms-con-sox-98.html#post975953

sdm [-f filter] [-t order] [-n num] [-l latency]

       Apply  a  1-bit  sigma-delta  modulator  producing DSD output.  The input 
       should be previously upsampled, e.g. with the rate effect, to a high rate, 
       2.8224MHz for DSD64.  The -f option selects the noise-shaping filter from 
       the following list where the number indicates the order of the filter:

                 clans-4      sdm-4
                 clans-5      sdm-5
                 clans-6      sdm-6
                 clans-7      sdm-7
                 clans-8      sdm-8

       The noise filter may be combined with a partial trellis/viterbi search 
       by supplying the following options:

       -t     Trellis order, max 32.

       -n     Number of paths to consider, max 32.

       -l     Output latency, max 2048.

       The result of using these parameters is hard to predict and can include
       high noise levels or instability. Caution is advised.

As warned in the man page, those options can be potentially "dangerous"... but they can also have a significant impact on the perceived sound quality. Hence they are rather important for our goals.

Though labeled as "advanced" and with clear warning about the possible problems they can cause (as well as something like "do not change, use defaults unless you know what you are doing" and "keep volume very low while testing"), IMHO they should be added.

I would add them in the form of drop-down menus or sliders to set the corresponding parameter.

For each of them there must be the possibility (enabled by default) to not include the corresponding option in the generated sox command line. Perhaps a "use default" check-box next to the slider, or the same label included as the first (and default) entry in the menu.

Maybe we should ask Mans for guidelines about how to reasonably set those params (if you do ask, please add me in CC:) and include them in the "info" shown next to them.

Possibile problema con "gain"

Ciao Marco,

devo verificare meglio, ma c'è un possibile problema con l'uso di gain per la riduzione del volume se si usa contemporaneamente la riduzione fissa e quella automatica (gain -h). In breve, la riduzione fissa unitamente a quella automatica può essere applicata in due modi:

  1. con una singola invocazione di "gain", cioè: "gain -h $dB" (soluzione preferibile)

  2. con due invocazioni separate di "gain", purché l'eventuale riduzione fissa sia applicata prima di "gain -h", cioè: "gain $dB gain -h"

(ho usato "$dB" per indicare il valore numerico della riduzione fissa da applicare)

Quello che invece è da evitare (e non vorrei che sia proprio ciò che accade attualmente) è che ci siano due invocazioni separate laddove "gain -h" precede "gain $dB" ... perché in tal caso "gain -h" potrebbe annullare l'effetto di "gain $dB".

"failed to load: Experimental keys on scalar is now forbidden ..." (again)

Dopo aver visto il msg nell'altro issue, ho provato a caricare la nuova beta (v2.01.02). Ma mi sa che qualcosa che avevi sistemato nella stabile non è passato: ci risiamo...

[17-04-06 00:35:52.8740] Slim::Utils::PluginManager::load (241) Loading plugin: C3PO
[17-04-06 00:35:52.8790] Slim::Utils::Misc::msg (1244) Warning: [00:35:52.8788] Subroutine preferences redefined at /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/C3PO/PreferencesHelper.pm line 53.
[17-04-06 00:35:52.9653] Slim::bootstrap::tryModuleLoad (286) Warning: Module [Plugins::C3PO::Plugin] failed to load:
Experimental keys on scalar is now forbidden at /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/C3PO/Plugin.pm line 622.
Compilation failed in require at (eval 925) line 1.
BEGIN failed--compilation aborted at (eval 925) line 1.

PCM->DSD non funziona

...a occhio e croce, non viene scritto il sample-rate nei comandi di sox:

"flc-dsf--00:1c:c0:37:22:73" => {
capabilities => { D => "RESAMPLE=-r %d", F => "noArgs", I => "noArgs", R => "noArgs" },
command => "[flac] -dcs --totally-silent $START$ $END$ -- $FILE$ | [sox] -q -t wav - -t dsf -b 1 - gain -h rate -v -L -b 95 sdm -f sdm-8",
profile => "flc-dsf-
-00:1c:c0:37:22:73",
},
"wav-dsf--00:1c:c0:37:22:73" => {
capabilities => {
D => "RESAMPLE=-r %d",
F => "noArgs",
R => "noArgs",
T => "START=-ss %s",
U => "END=-t %w",
},
command => "[ffmpeg] -vn -v 0 $START$ $END$ -i $FILE$ -f wav - | [sox] -q -t wav - -t dsf -b 1 - gain -h rate -v -L -b 95 sdm -f sdm-8",
profile => "wav-dsf-
-00:1c:c0:37:22:73",
},
}

Selective conversion to DSD based on sample rate

Adding a feature allowing to choose if to convert into DSD or PCM based on sample rate.
Using the selection check-boxes already available in c3-po that control the conversion sample rates when outputting as PCM, in case of DSD output, if a track has a sample rate that is one of the selected (eq. 192000) c3-po will output as PCM without resampling instead of DSF. The scope is not to apply useless (possibly damaging) upsampling to hi-res files.

Before and after resampling user commands always used.

Sox recommend using gain -h before resampling, and gain -r after. I can do that and it works when resampling is required. But your code is adding those commands for native sample rates when no resampling is required. The resulting combination of gain -h gain -r has zero volume.
Please only add User commands when resampling is required.

Richiesta features

Ciao Marco; ti suggerisco due features da aggiungere per la prossima release che a mio parere possono essere molto utili:

1- Menu "Ricampiona:"; insieme a "Sempre", "Mai", "Solo se la frequenza di campionamento non è supportata" aggiungere "Solo per file 16bit 44.1Khz". Fare upsampling a file già in Hi-Res a poco senso e a volte ho pure notato una degradazione sonora; mentre se si limitasse ai 16/44.1 sarebbe ottimo!

EDIT: creata nuova: #8

2- Aggiunta al menu Avanzate -> C-3PO (le impostazioni generale). Una casella con: "Enable SoX multi-thread". Ora come ora con una conversione PCM->DSD128 SoX si "beve" il 50% di un core fisico di uno Xeon X5570; che all'incirca è la potenza di un core di un i5 di penultima generazione o un core di un i3 ultima gen. In questo modo si escludono tutte le cpu che sono multi core con TDP molto basso (molte fanless) come i pentium 4core, gli atom 4core e 8core fanless (stile il c2750) che in multithreading riuscirebbero a convertire ma in single core non ce la fanno.

EDIT: creata nuova: #7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.