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

High-resolution volume control and normalisation #660

Merged
merged 24 commits into from
Apr 10, 2021

Commits on Mar 12, 2021

  1. High-resolution volume control and normalisation

     - Store and output samples as 32-bit floats instead of 16-bit integers.
       This provides 24-25 bits of transparency, allowing for 42-48 dB of
       headroom to do volume control and normalisation without throwing
       away bits or dropping dynamic range below 96 dB CD quality.
    
     - Perform volume control and normalisation in 64-bit arithmetic.
    
     - Add a dynamic limiter with configurable threshold, attack time,
       release or decay time, and steepness for the sigmoid transfer
       function. This mimics the native Spotify limiter, offering greater
       dynamic range than the old limiter, that just reduced overall gain
       to prevent clipping.
    
     - Make the configurable threshold also apply to the old limiter, which
       is still available.
    
    Resolves: librespot-org#608
    roderickvd committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    f29e521 View commit details
    Browse the repository at this point in the history
  2. Fix build on Rust < 1.50.0

    roderickvd committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    1672eb8 View commit details
    Browse the repository at this point in the history
  3. Add command-line option to set F32 or S16 bit output

    Usage: `--format {F32|S16}`. Default is F32.
    
     - Implemented for all backends, except for JACK audio which itself
     only supports 32-bit output at this time. Setting JACK audio to S16
     will panic and instruct the user to set output to F32.
    
     - The F32 default works fine for Rodio on macOS, but not on Raspian 10
     with Alsa as host. Therefore users on Linux systems are warned to set
     output to S16 in case of garbled sound with Rodio. This seems an issue
     with cpal incorrectly detecting the output stream format.
    
     - While at it, DRY up lots of code in the backends and by that virtue,
     also enable OggData passthrough on the subprocess backend.
    
     - I tested Rodio, ALSA, pipe and subprocess quite a bit, and call on
     others to join in and test the other backends.
    roderickvd committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    5257be7 View commit details
    Browse the repository at this point in the history
  4. Fix example

    roderickvd committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    6379926 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a4ef174 View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2021

  1. Add support for S32 output format

    While at it, add a small tweak when converting "silent" samples
    from float to integer. This ensures 0.0 converts to 0 and vice
    versa.
    roderickvd committed Mar 13, 2021
    Configuration menu
    Copy the full SHA
    5f26a74 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2021

  1. Rename steepness to knee

    roderickvd committed Mar 14, 2021
    Configuration menu
    Copy the full SHA
    309e264 View commit details
    Browse the repository at this point in the history

Commits on Mar 16, 2021

  1. Default to S16 output

    roderickvd committed Mar 16, 2021
    Configuration menu
    Copy the full SHA
    9dcaeee View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    770ea15 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2021

  1. Configuration menu
    Copy the full SHA
    b94879d View commit details
    Browse the repository at this point in the history
  2. First round of refactoring

     - DRY-ups
    
     - Remove incorrect optimization attempt in the libvorbis decoder,
       that skewed 0.0 samples non-linear
    
     - PortAudio and SDL backends do not support S24 output. The PortAudio
       bindings could, but not through this API.
    roderickvd committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    a1326ba View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2021

  1. Configuration menu
    Copy the full SHA
    001d3ca View commit details
    Browse the repository at this point in the history

Commits on Mar 21, 2021

  1. Configuration menu
    Copy the full SHA
    74b2fea View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2021

  1. Configuration menu
    Copy the full SHA
    bfca1ec View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cdbce21 View commit details
    Browse the repository at this point in the history
  3. Fix formatting

    roderickvd committed Mar 27, 2021
    Configuration menu
    Copy the full SHA
    a200b25 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cc60dc1 View commit details
    Browse the repository at this point in the history
  5. Warn about broken backends

    roderickvd committed Mar 27, 2021
    Configuration menu
    Copy the full SHA
    d252eee View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2021

  1. Configuration menu
    Copy the full SHA
    07d710e View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2021

  1. Configuration menu
    Copy the full SHA
    78bc621 View commit details
    Browse the repository at this point in the history
  2. DRY up constructors

    roderickvd committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    928a673 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2021

  1. Configuration menu
    Copy the full SHA
    d0ea963 View commit details
    Browse the repository at this point in the history
  2. Bump playback crates to the latest supporting Rust 1.41.1

    For Rodio, this fixes garbled sound on some but not all Alsa hosts.
    roderickvd committed Apr 9, 2021
    Configuration menu
    Copy the full SHA
    222f9bb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e20b96c View commit details
    Browse the repository at this point in the history