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

Jack output add soxr resampling #939

Merged
merged 3 commits into from
Dec 23, 2019

Conversation

pdgendt
Copy link

@pdgendt pdgendt commented Dec 3, 2019

First attempt at adding soxr resampling to the jack audio output, I thought I would share it already.
Some notes:

  • Configurable buffer size would be an improvement
  • Tested with soxr "very high" resampling quality, other options are barely tested!
  • TODO: Describe config options in scripts/shairport-sync.conf

@mikebrady
Copy link
Owner

Thanks for this contribution. I wonder if Jörn Nettingsmeier (@nettings) would have a view...

@mikebrady
Copy link
Owner

Hi there. No response from Jörn.

One little thing. Could you change jack.soxr_resample_recipe to jack.soxr_resample_quality please? It makes more sense to me...

@mikebrady mikebrady merged commit e3d56b9 into mikebrady:development Dec 23, 2019
@mikebrady
Copy link
Owner

Thanks!

@pdgendt pdgendt deleted the feature/jack-soxr-resampling branch December 23, 2019 08:24
@nettings
Copy link

Hi, sorry for the late reply, the end of the year was insanely busy! I'm really excited about this feature and pulling it into my test environment as I'm typing this. Will report back.

@nettings
Copy link

nettings commented Jan 21, 2020

Yay! Running my jackd server at 48k now, with shairport-sync resampling merrily. Hartelijk dank @pdgent !
I wonder: we are currently running two resampling steps, one in player.c and one in audio_jack.c. I guess we could fold those together and make player.c output the target sample rate already.
Now: player.c from N samples to N+/-1 samples -> audio_jack.c from M samples to M*ratio samples.
Maybe: player.c from K samples to (K+/-1)*ratio samples, audio_jack.c doesn't need to resample any more. That should save 50% of the resampling costs and enable other backends to run at different clocks, such as alsa.
Haven't dug into all the code yet, but am I making sense?

mikebrady added a commit that referenced this pull request Feb 20, 2020
    Don't use strndup as old versions of OpenWrt don't seem to have it
    Update FREEBSD.md
    Fix comparison between old and new metadata strings by checking they have equal lengths as well.
    Remove a redundant definition to prevent use on an uninitialised copy, clean up some of the less-used backends
    Remove some unwanted and unused variable declarations from audio_dummy.c and audio_soundio.c
    Add the -fno-common flag to compilation.
    Treat the "mper" attribute as the 64-bit item that it is rather than a 32-bit item as hithereto. Output it as a hexadecimal number to correspond with the format of the track id obtained from AppleScript
    Make changes to that it compiles under gcc-10 with -fno-common
    Add a SIGCHLD handler to reap zombie processes generated after script invocations where wait_for_completion is set to "no".
    Update and rename CONTRIBUTING.md to REPORTING ISSUES.md
    Add a few more commands and clarify some text.
    Change from talking about a server to talking about a client. Technically, e.g. iTunes is a client of Shairport Sync.
    Store the UserAgent so as to recognise forked-daapd so as to always send a revision_number of 1 when asking for playerstatus of forked-daapd.
    Add or update some of the copyright notices
    Add the ability to set the volume directly to the D-Bus RemoteControl interface and to the MPRIS interface. Both use the recently-discovered ability to set the device_volume.
    Merge in Pieter De Gendt's work on resampling on the jack backend.
    Merge pull request #939 from pdgendt/feature/jack-soxr-resampling
    Add SetAirplayVolume to the D-Bus RemoteControl interface.
    Add SetVolume to the MPRIS interface.
    Hook up the Volume property in the MPRIS interface.
    Modify RemoteCommand in the D-Bus interface to return the HTTP status and response.
    Change the type of airplay_volume from int to double in the metadata hub.
    Add a few sample commands in the D-Bus document.
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.

3 participants