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

Provide audio format to pipe output command #3

Conversation

frankl-audio
Copy link

So far, the pipe output of MPD had the problem that the commands
in the pipe had no information about the format of the raw audio data
sent into the pipe.

With this patch mpd substitutes the strings "$MPDPIPE_BITS",
"$MPDPIPE_CHANNELS", "$MPDPIPE_RATE", "$MPDPIPE_FORMAT"
within the command started for the pipe by the number of bits per sample,
the number of channels, the sample rate, and the sample format (one of
"S8", "S16", "S24_P32" or "S32"), respectively.

Example: if in mpd.conf an audio_output of type pipe contains the line

    command         "/usr/local/bin/mympdpipe $MPDPIPE_BITS $MPDPIPE_CHANNELS $MPDPIPE_RATE $MPDPIPE_FORMAT"

then mpd starts a command like
/usr/local/bin/mympdpipe 16 2 44100 S16
for this pipe.

So far, the pipe output of MPD had the problem that the commands
in the pipe had no information about the format of the raw audio data
sent into the pipe.

With this patch mpd substitutes the strings "$MPDPIPE_BITS",
"$MPDPIPE_CHANNELS", "$MPDPIPE_RATE", "$MPDPIPE_FORMAT"
within the command started for the pipe by the number of bits per sample,
the number of channels, the sample rate, and the sample format (one of
"S8", "S16", "S24_P32" or "S32"), respectively.

Example: if in mpd.conf an audio_output of type pipe contains the line

        command         "/usr/local/bin/mympdpipe $MPDPIPE_BITS $MPDPIPE_CHANNELS $MPDPIPE_RATE $MPDPIPE_FORMAT"

then mpd starts a command like
        /usr/local/bin/mympdpipe 16 2 44100 S16
for this pipe.
@frankl-audio
Copy link
Author

Various people seem to use a patched version of MPD to resolve the problem of missing information about the audio format within the pipe command.

A very similar patch like this one was for example proposed here:
https://forum.musicpd.org/viewtopic.php?f=11&t=3820

@MaxKellermann
Copy link
Member

Wrong indentation, excessive use of std::string, duplicate code, and I'd rather pass environment variables instead of this obscure string replacement.

@frankl-audio
Copy link
Author

I'm fine with suggestions for better solutions.

But why is this request closed?

Are you going to implement a better solution of the problem addressed here?

Or are you not interested in solving this problem (which prevents people from using mpd together with any processing of the audio data, e.g., a filter for room correction)?

@MaxKellermann
Copy link
Member

The pipe output is the wrong tool to apply filters, so your example doesn't convince me that this is necessary at all. And no, I'm not going to implement this - there are tons of other things with a higher priority, and the pipe plugin has no priority at all for me. I told you how I'd do it, if ever, and that would be how I'd accept a pull request.

MaxKellermann pushed a commit that referenced this pull request Feb 13, 2021
)

Add cacert option for curl plugin

    add cacert option for Curl plugin. Allows to set cacert for curl lib
    Added documentation line into doc/plugins.rst with explanation for cacert option
@skidoo23 skidoo23 mentioned this pull request Aug 12, 2021
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.

2 participants