Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 11 123 ... LastLast
Results 1 to 10 of 109
  1. #1
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (Bologna Area) Italy
    Posts
    518

    C-3PO plugin, a transcoding helper.

    Hi,

    Last year I released squeezelite in a modified version called 1.8.2 (R2), that always inspects the pcm file headers to detect the real sample rate, depth and endianness, enabling the server side decoding to pcm and upsampling.

    This was previously impossible due to LMS always send 44100 as sample rate information for an upsampled pcm stream, so we needed to upsample then convert back in flac on the server, receive the stream (and convert it to pcm) on the client side and play it, or let squeezelite upsample it.

    Since that time, Squeezelite-R2 (so called for mnemonics) has been included in Daphile and Audiolinux and is used by other people in Debian, Win and macOsx systems. Here you could get more information about squeezelite-R2 and download it: https://github.com/marcoc1712/squeezelite-R2/releases.

    Squeezelite-R2 make possible to stream upsampled pcm startinf from any format in the server (and even remote stream services, like Qobuz), but as a long term squeezebox server user I missed a tool to handle those tasks in an easier way than using convert.conf files and file type conversion settings.

    That's why I've released C-3PO plugin that make it possible simply using two settings pages.

    Here the first (general):

    Name:  c3po_1.jpg
Views: 1084
Size:  88.8 KB

    and here the player specific:

    Name:  c3po_2.jpg
Views: 1083
Size:  99.7 KB

    I hope options are self explanatory, but I will comment them in details in next posts.

    To install C-3PO plugn, just add http://www.marcoc1712.it/downloads/repository.xml to your Plugin sources in the Server, Settings, Plugins page, then restart the server. when requested.

    More information here: https://github.com/marcoc1712/C-3PO/releases

    Thanks,

    Marco.
    Last edited by marcoc1712; 2016-03-07 at 13:26.
    __________________________________________________ __________
    SB+, Klimo Merlino + Kent Gold, Monitor Audio Studio 20 Gold SE+, Klimo reference and DIS Interconnect.

  2. #2
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (Bologna Area) Italy
    Posts
    518

    General settings

    Please remmber that C-3PO is not adding any functionality or capability to LMS, other than a better integrated interface over File type conversions and custom-convert.conf file, but everything it does was already here before.

    Or better, almost everything, one is new: the capability to program the runtime conversion based on the characteristics (i.e sample rate) of the track being played.

    To archive that, C-3PO has to know:

    a. witch input formats has to be converted
    b. to what output format.

    c. If and when to resample.
    d. to what sample rate.

    Since is using SOX to perform resample, it also need to know the parameters to use.

    Use the page in Advanced settings for this.

    NOTE:

    Those parameters are valid for all and any player (unless you force them by single player, see below) so be sure players are capable to play streams so defined.

    Pay particular attention to:

    a. Output format: use WAV and AIFF only with Squeezelite-R2 compliant players, if resampling.
    b. Bit-depth: must be lower or equal the player capability.
    c. Additional effects: this is a 'free' text field, be sure to enter only valid SOX effects.
    Last edited by marcoc1712; 2016-03-07 at 15:40.
    __________________________________________________ __________
    SB+, Klimo Merlino + Kent Gold, Monitor Audio Studio 20 Gold SE+, Klimo reference and DIS Interconnect.

  3. #3
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (Bologna Area) Italy
    Posts
    518

    Player Settings

    Settings defined in the Advanced Setings page relay on specific Player capabilities and preferences, that are defined in the Settings, Player, C-3PO page:

    Name:  c3po_2.jpg
Views: 1030
Size:  99.7 KB

    Default values comes form the player model capabilities, but you could refine and restrict the selection.

    Supported Sample Rates is used toghether with general settings to define the target sample rate of the stream.

    Supported codecs is unmodifiable, since depends on player model and C-3PO capabilities, buf for every codec (format) you could enable or disable:

    a. transcoding to the general settings output format.
    b. resampling

    disabling both is same to disable the format.


    You then have two more capabilities:

    c. seek
    d. standard input

    They are a little tricky, but in short they correspond to the "T" and "I" capabilities we used to use in convert.conf file. Firts is needed to seek inside a stream (i.e to reach a track in a cue sheet), second is used by many external source applications, like Qobuz plugin, or CDPlay or...

    Too bad, LMS could not have seek and standard Input enabled toghether when transcoding, so we must choose. Since streaming services like Qobuz use flac and people normaly use cue sheets with WAV, the default is to enable seek for WAV and stdIn for Flac, here is where you could change it.

    Hope is clear enought, but if you don't use .cue sheets or Qobuz, just don't mind.

    That's all is needed in normal scenarios.
    Last edited by marcoc1712; 2016-03-07 at 14:11.
    __________________________________________________ __________
    SB+, Klimo Merlino + Kent Gold, Monitor Audio Studio 20 Gold SE+, Klimo reference and DIS Interconnect.

  4. #4
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (Bologna Area) Italy
    Posts
    518

    Changing general settings by player

    If you have very specific requirement and need different upsampling methods for specific players, you should use general setting as intended for 'normal' cases, then you could 'force' same settings but just for the players you need.

    to do this, just uncheck the Use global settings box and click "show":

    Name:  c3po_3.jpg
Views: 1015
Size:  70.6 KB

    Tthen you have a private copy of the general settings to be used with the specific player.

    that's all.

    Some more info about Squeezelite-R2, C-3PO and falcon (a web interface for squeezelite) is found here: www.marcoc1712.it, too bad in italian language only at the moment.
    __________________________________________________ __________
    SB+, Klimo Merlino + Kent Gold, Monitor Audio Studio 20 Gold SE+, Klimo reference and DIS Interconnect.

  5. #5
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    1,794
    Quote Originally Posted by marcoc1712 View Post
    Since that time, Squeezelite-R2 (so called for mnemonics) has been included in Daphile and Audiolinux and is used by other people in Debian, Win and macOsx systems. Here you could get more information about squeezelite-R2 and download it: https://github.com/marcoc1712/squeezelite-R2/releases.
    I've included this capability with my squeezelite builds 1.8.3-709 and newer.
    The feature is off by default, you need to add -W to the command line options to enable it.
    Code:
    -W    Read format from wave and aiff file headers, ignore server parameters
    When you first asked me about the change I was reluctant to incorporate it. However, I felt is was unfair not to add it after adding other enhancements for picoreplayer.
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 1-UE Radio
    Squeezebox client builds donations always appreciated.

  6. #6
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (Bologna Area) Italy
    Posts
    518
    Quote Originally Posted by ralphy View Post
    I've included this capability with my squeezelite builds 1.8.3-709 and newer.
    The feature is off by default, you need to add -W to the command line options to enable it.
    Code:
    -W    Read format from wave and aiff file headers, ignore server parameters
    When you first asked me about the change I was reluctant to incorporate it. However, I felt is was unfair not to add it after adding other enhancements for picoreplayer.
    Great! Is like that for ANY build? I'll add a notice in gitHub and other places, that is exactly what I was meaning when asking you to have just one 'common' repository. More than Happy you decided to do it.

    By the way, are You still using "squeezelite" both for model name and model type? I use "squeezelite-R2" in model name just to inform the server (C-3PO) that the player is enabled to receive upsampled pcm streams, just to avoid errors, but sure I could change, just let me know what to test to identify your versions (I think 1.8.3 is not enought, you never know if other branches use the same version code, that's why I introduced R2 identifier as Daphile use "daphile").

    I'll have a try of your version on RPI soon.

    EDIT: Where should I find 1.8.3-709 builds for Win and OsX ? thanks.

    regards.

    Marco.
    Last edited by marcoc1712; 2016-03-08 at 07:23.
    __________________________________________________ __________
    SB+, Klimo Merlino + Kent Gold, Monitor Audio Studio 20 Gold SE+, Klimo reference and DIS Interconnect.

  7. #7
    Senior Member
    Join Date
    Nov 2010
    Location
    Hertfordshire, UK
    Posts
    2,573
    Hi Marco,

    All my files are stereo (a few mono) flacs, from 16/44100 to 24/192000.

    For squeezelite-R2 I mostly use a Meridian Explorer DAC, and started it using options -r 192000 -u hLE. The DAC indicates it's getting a 24/192000 feed - whether FLAC or PCM I don't know for sure, but I assume flac when not running C-3PO. Using C-3PO I got crackling and all sorts, even on 16/44100 tracks, whatever settings I tried. Today I tried starting squeezelite using -u vHX and it seems to be working much better with C-3PO. Is it possible that the squeezelite-R2 command line options need to match C-3PO in some fashion?

    Several player parameters never seem to stick. So, for instance, no matter what I set 'Quality' to it always seems to be reset to 'High' for this player. The same is true for the 'Resample' parameter. Why would that be?



    For squeeze2upnp I use 2 renderers. One will take flac or pcm to 24/192000, but I have no upsampling set, just conversion to pcm (no wav header) so the server does the conversion work. For the other it seems to prefer wav (ie pcm plus with a proper wav header) or flac, up to 24/96000. I got neither device to work at all with C-3PO.

    I probably don't really need this plugin, but if you want me to test things for your and other's benefits I'll happily do so.
    LMS 7.9.1 on VortexBox Midi box, Xubuntu 17.10, FLACs 16->24 bit, 44.1->192kbps. Touch & EDO. 2nd Touch standard.
    LMS plugin UPnP/DLNA Bridge to MF M1 CLiC (to A308CR amp & ESLs) & Marantz CR603 UPnP renderers.
    Alternatively Minimserver & Upplay to same & to upmpdcli/mpd PC renderers.
    Squeezelite to Meridian USB Explorer DAC to PC speakers/headphones.
    Wireless Xubuntu 17.10 laptop firefox/upplay or Android 'phone with Squeeze-Commander/BubbleUPnP controls LMS/Minimserver.

  8. #8
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (Bologna Area) Italy
    Posts
    518
    Quote Originally Posted by PasTim View Post
    Hi Marco,

    All my files are stereo (a few mono) flacs, from 16/44100 to 24/192000.

    For squeezelite-R2 I mostly use a Meridian Explorer DAC, and started it using options -r 192000 -u hLE. The DAC indicates it's getting a 24/192000 feed - whether FLAC or PCM I don't know for sure, but I assume flac when not running C-3PO. Using C-3PO I got crackling and all sorts, even on 16/44100 tracks, whatever settings I tried. Today I tried starting squeezelite using -u vHX and it seems to be working much better with C-3PO. Is it possible that the squeezelite-R2 command line options need to match C-3PO in some fashion?.
    Be aware that you should avoid to resample both on player and on server, using C-3PO, you should NOT use -u options launching squeezelite anymore.

    Did you restarted the DAC after enabling C-3PO (and so changing the output fomat)? that's probably why today, after a restart, things went better.

    Assuming you want to play everything at 192KHz/24bit, try this:

    GENERAL SETTINGS:

    Supported formats: be sure to select AT LEAST Flac.

    Resample "Always"
    Target sample rate "Max supported"
    Output format "WAV"

    bit-depth 24 (3).


    Please leave all the others at default value.


    PLAYER SETTINGS:

    Select the Meridian Explorer DAC attached Squeezelite-R2 player, then set:

    Supported Sample Rates: be sure 192KHz is the maximum value checked for the player, you could add ANY lower value but NOT higher, is important.

    Enable Transcoding and Resampling for FLAC.
    Live the others at Default values at the moment.

    Please check the "use general settings" box and apply changes.


    SQUEEZELITE-R2 COMMAND LINE:

    here a sample and safe command line, but You could try to adjust buffers (-b) if still get pop and clicks.

    Squeezelite-R2 -o (what you normally use) -a 100:3:24:1 -b 8192:8192 -r 192000:192000

    Pleas dont add -u option, the server is going to upsample to 192000Hz, 24 bit and decode to WAV.

    Please restart the DAC and Squeezelite with the new command line and try to play a flac 44100/16 or 192000/24 file, you should see squeezelite rreceive WAV 192KHz/24bit in both case.

    Forgot tio ask: are you using a wired network, correct? If not, be aware that where flac 44.1/16 is using less than 1 Mb/s, Wav 192/24 is at least 5 times the traffic, so be sure you have enougth bandwidth.

    Quote Originally Posted by PasTim View Post
    Several player parameters never seem to stick. So, for instance, no matter what I set 'Quality' to it always seems to be reset to 'High' for this player. The same is true for the 'Resample' parameter. Why would that be?.
    Not sure to well understand. Do you mean that setting quality in the general settings (or in the player setting after uncheking the use general setting box) is not working? In that case are you sure to always 'apply' changes before leave the page?

    Or you meant you don't see changes reflected to squeezelite? In that case is correct, as said before, you should NOT use -u option in squeezelite anymore.

    Could you please better elaborate?

    Quote Originally Posted by PasTim View Post
    For squeeze2upnp I use 2 renderers. One will take flac or pcm to 24/192000, but I have no upsampling set, just conversion to pcm (no wav header) so the server does the conversion work. For the other it seems to prefer wav (ie pcm plus with a proper wav header) or flac, up to 24/96000. I got neither device to work at all with C-3PO.
    Assuming your general settings are as explained before, to strictly archive what you describe you have to:

    a. select PLAYER ONE and:

    Supported Sample Rates: be sure 192KHz is the only value checked.

    Enable Transcoding for FLAC.
    Disble Resampling for FLAC.

    Live the others at Default values at the moment.
    Please check the "use general settings" box and apply changes.

    This way ONLY 192Khz flac files will be converted to WAV (there is no support for raw PCM in LMS) and sent to Squeezelite, files with other samplerate will be refused (seems to me is to strict, if you want to allow any samplerate decode and playback but not resampling till 192KHz, check as supported all samplerates starting from 44100 to 192Khz).

    b. select PLAYER TWO and:

    Supported Sample Rates: check ALL frequencies from 44100 to 96000, be sure nothing higher.

    Enable Transcoding for FLAC.
    Enable Resampling for FLAC.

    Live the others at Default values at the moment.
    Please check the "use general settings" box and apply changes.


    Quote Originally Posted by PasTim View Post
    I probably don't really need this plugin
    Is not clear to me how you today arrange to decode and upsamlýple, if in LMS using custom-convert.conf file, you could find C-3PO usefull just becouse is easier to use, if by the playrs, no, you don't need C-3PO at all.

    C-3PO is born to perform decode and upsampling SERVER SIDE, in order to need and use really low power by the client.


    Quote Originally Posted by PasTim View Post
    but if you want me to test things for your and other's benefits I'll happily do so.
    Tester are always welcome, but use of C-3PO make sense only in place of custom-convert.conf file and "File Type" conversion settings on LMS. If you are using them now, You'll probably find C-3PO easier and valuable, if not you'll probably fint it difficult and useless, just becouse you don't know how boring is using the others.

    Hope is more clear now, please try the settings I've posed, then please report if they works for you or not, or - if I misandestood - please post here your actual custom-convert.conf file and I'll try to replicate it in C-3PO settings.

    Marco
    __________________________________________________ __________
    SB+, Klimo Merlino + Kent Gold, Monitor Audio Studio 20 Gold SE+, Klimo reference and DIS Interconnect.

  9. #9
    Senior Member
    Join Date
    Nov 2010
    Location
    Hertfordshire, UK
    Posts
    2,573
    Quote Originally Posted by marcoc1712 View Post
    Be aware that you should avoid to resample both on player and on server, using C-3PO, you should NOT use -u options launching squeezelite anymore.

    Did you restarted the DAC after enabling C-3PO (and so changing the output fomat)? that's probably why today, after a restart, things went better.

    Assuming you want to play everything at 192KHz/24bit, try this:

    GENERAL SETTINGS:

    Supported formats: be sure to select AT LEAST Flac.

    Resample "Always"
    Target sample rate "Max supported"
    Output format "WAV"

    bit-depth 24 (3).


    Please leave all the others at default value.


    PLAYER SETTINGS:

    Select the Meridian Explorer DAC attached Squeezelite-R2 player, then set:

    Supported Sample Rates: be sure 192KHz is the maximum value checked for the player, you could add ANY lower value but NOT higher, is important.

    Enable Transcoding and Resampling for FLAC.
    Live the others at Default values at the moment.

    Please check the "use general settings" box and apply changes.


    SQUEEZELITE-R2 COMMAND LINE:

    here a sample and safe command line, but You could try to adjust buffers (-b) if still get pop and clicks.

    Squeezelite-R2 -o (what you normally use) -a 100:3:24:1 -b 8192:8192 -r 192000:192000

    Pleas dont add -u option, the server is going to upsample to 192000Hz, 24 bit and decode to WAV.

    Please restart the DAC and Squeezelite with the new command line and try to play a flac 44100/16 or 192000/24 file, you should see squeezelite rreceive WAV 192KHz/24bit in both case.

    Forgot tio ask: are you using a wired network, correct? If not, be aware that where flac 44.1/16 is using less than 1 Mb/s, Wav 192/24 is at least 5 times the traffic, so be sure you have enougth bandwidth.



    Not sure to well understand. Do you mean that setting quality in the general settings (or in the player setting after uncheking the use general setting box) is not working? In that case are you sure to always 'apply' changes before leave the page?

    Or you meant you don't see changes reflected to squeezelite? In that case is correct, as said before, you should NOT use -u option in squeezelite anymore.

    Could you please better elaborate?



    Assuming your general settings are as explained before, to strictly archive what you describe you have to:

    a. select PLAYER ONE and:

    Supported Sample Rates: be sure 192KHz is the only value checked.

    Enable Transcoding for FLAC.
    Disble Resampling for FLAC.

    Live the others at Default values at the moment.
    Please check the "use general settings" box and apply changes.

    This way ONLY 192Khz flac files will be converted to WAV (there is no support for raw PCM in LMS) and sent to Squeezelite, files with other samplerate will be refused (seems to me is to strict, if you want to allow any samplerate decode and playback but not resampling till 192KHz, check as supported all samplerates starting from 44100 to 192Khz).

    b. select PLAYER TWO and:

    Supported Sample Rates: check ALL frequencies from 44100 to 96000, be sure nothing higher.

    Enable Transcoding for FLAC.
    Enable Resampling for FLAC.

    Live the others at Default values at the moment.
    Please check the "use general settings" box and apply changes.




    Is not clear to me how you today arrange to decode and upsamlýple, if in LMS using custom-convert.conf file, you could find C-3PO usefull just becouse is easier to use, if by the playrs, no, you don't need C-3PO at all.

    C-3PO is born to perform decode and upsampling SERVER SIDE, in order to need and use really low power by the client.




    Tester are always welcome, but use of C-3PO make sense only in place of custom-convert.conf file and "File Type" conversion settings on LMS. If you are using them now, You'll probably find C-3PO easier and valuable, if not you'll probably fint it difficult and useless, just becouse you don't know how boring is using the others.

    Hope is more clear now, please try the settings I've posed, then please report if they works for you or not, or - if I misandestood - please post here your actual custom-convert.conf file and I'll try to replicate it in C-3PO settings.

    Marco
    Thanks - that's a lot of information for me to process in one go. Apologies if I haven't done what you asked, but some of what you ask doesn't seem to work at all, notably changing specific settings.

    When I said settings don't 'stick', I have a problem in that when I change several of the player-specific settings, and apply, next time I look at the settings they have reverted to what they were before. Until I can rely on the changes I make, all my attempts will fail. I can't even disable everything for some players, so I can't live with the plugin at all (I just get noise using squeeze2upnp players).

    I'm assuming that because my players are so different the general settings are irrelevant. I do not understand when you seem to suggest changing player-specific settings and then tick 'use general settings' - surely if they are 'specific' they are not 'general'?

    You say LMS doesn't support pcm. Well my understanding (using squeeze2upnp) is that it does. Looking at the standard flac file type settings, the option is convert to pcm, not to wav. In fact, as I understand it, the developer of that plugin had to specifically add wav headers for players that could not handle raw pcm.

    As to not using the squeezelite options, I think it clarifies that I am wasting your time - I'm just not getting where this is coming from or going to - sorry - I am not very clever at this stuff. In my case squeezelite and LMS are, usually, on the same machine. So I think it's best if we just drop this conversation. You are better off testing with someone who understands LMS, and audio, much better than I do and can help you with what you are doing. I'm sure it's really good for some situations, but I'm too dim to make it work. Sorry for wasting your time.
    LMS 7.9.1 on VortexBox Midi box, Xubuntu 17.10, FLACs 16->24 bit, 44.1->192kbps. Touch & EDO. 2nd Touch standard.
    LMS plugin UPnP/DLNA Bridge to MF M1 CLiC (to A308CR amp & ESLs) & Marantz CR603 UPnP renderers.
    Alternatively Minimserver & Upplay to same & to upmpdcli/mpd PC renderers.
    Squeezelite to Meridian USB Explorer DAC to PC speakers/headphones.
    Wireless Xubuntu 17.10 laptop firefox/upplay or Android 'phone with Squeeze-Commander/BubbleUPnP controls LMS/Minimserver.

  10. #10
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (Bologna Area) Italy
    Posts
    518
    Quote Originally Posted by PasTim View Post
    Thanks - that's a lot of information for me to process in one go. Apologies if I haven't done what you asked, but some of what you ask doesn't seem to work at all, notably changing specific settings.

    When I said settings don't 'stick', I have a problem in that when I change several of the player-specific settings, and apply, next time I look at the settings they have reverted to what they were before. Until I can rely on the changes I make, all my attempts will fail. I can't even disable everything for some players, so I can't live with the plugin at all (I just get noise using squeeze2upnp players).

    I'm assuming that because my players are so different the general settings are irrelevant. I do not understand when you seem to suggest changing player-specific settings and then tick 'use general settings' - surely if they are 'specific' they are not 'general'?

    You say LMS doesn't support pcm. Well my understanding (using squeeze2upnp) is that it does. Looking at the standard flac file type settings, the option is convert to pcm, not to wav. In fact, as I understand it, the developer of that plugin had to specifically add wav headers for players that could not handle raw pcm.

    As to not using the squeezelite options, I think it clarifies that I am wasting your time - I'm just not getting where this is coming from or going to - sorry - I am not very clever at this stuff. In my case squeezelite and LMS are, usually, on the same machine. So I think it's best if we just drop this conversation. You are better off testing with someone who understands LMS, and audio, much better than I do and can help you with what you are doing. I'm sure it's really good for some situations, but I'm too dim to make it work. Sorry for wasting your time.
    Don't worry, you are welcome, but let me abuse a little more of yor patient:

    We have General settings and Player Specific Settings in different pages.

    For each player you could decide to use the general settings (normal situation, as I was asking You to do) OR enable the capability to change same settings that you have in 'general' but for the specific player. This is done by unchecking the "use general settings" box. This is normally not necessary, and it was not in my advice in the last post.


    When you state: " I have a problem in that when I change several of the player-specific settings, and apply, next time I look at the settings they have reverted to what they were before." wich specific setting are you referring?

    Seems like a big bug, but I can't replicate it, could you please name one specific setting that's broken that way?

    ---
    FIY:

    WAV vs PCM in LMS is a bit confusing. Sometime it name it PCM and sometime WAV, but what is streamed is wav (or aiff), this is what I realized and moved me to modify squeezelite. If it where raw pcm I had no chance.

    I'll have a look to the plugin you mention, sound strange to me, but if it does what you say, for sure it could not work with upsampled PCM/WAV/AIFF stream: what information is writing to the header? If it trust LMS, is wrong, how is it guessing them? That, indeed, explain why it does not work with C-3PO (and will not work with custom-convert.conf too). To stream and decode WAV (or AIFF or PCM) you need the modified version of squeezelite, that trust on the fact that the stream ALWAIS contains a valid header and don't care what LMS reports.

    The only other way is make LMS report the correct format info in the steam information block sent to the player.

    ---

    If you have squeezelite and LMS on the same machine, best is to use "Local player plugin" and nothing more.

    Regards, Marco.
    __________________________________________________ __________
    SB+, Klimo Merlino + Kent Gold, Monitor Audio Studio 20 Gold SE+, Klimo reference and DIS Interconnect.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •