Closed xabolcs closed 6 years ago
An example audio_output
section in /etc/mpd.conf
"
audio_output {
type "httpd"
name "MPD Stream"
encoder "flac"
port "8000"
bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
compression "0" # Sets the libFLAC compression level. The levels range from 0 (fastest, least compression) to 8 (slowest, most compression).
# quality "5.0" # do not define if bitrate is defined
# bitrate "128" # do not define if quality is defined
format "44100:16:2"
# max_clients "0" # optional 0=no limit
always_on "1" # prevent MPD from disconnecting all listeners when playback is stopped.
tags "yes" # httpd supports sending tags to listening streams.
}
That's easily fixable however mpd needs a refresh, it's a pity that it doesn't support ffmpeg for encoding which would make it a lot nicer instead of having seprate libraries for everything. I have a private repo however it's not optimized for small flash device (I'm lazy) so ffmpeg (4.02) is like ~4.5mbyte however it includes what you'd expect for normal usage. However you could probably slim it down quite a bit by dumping the video support, however I haven't managed to get it to compile on MIPS.
Anyhow, please create a pull request (if you're able to) for adding flac although as I mentioned before ffmpeg support upstream would be nicer... :/
..as a sidenote, this might be worth a consideration as it would lower the load by not encoding to FLAC however it does depend on what you're using on the other end. https://undeadly.org/cgi?action=article&sid=20180410063454
That's easily fixable however ...
Sure, I fixed it by manually compiling it.
Anyhow, please create a pull request (if you're able to) for adding flac ...
Of course I'm able add a PR with those flac lines in the Makefile
, but I'm unsure about the intends of the referenced commit.
I think there's just a misunderstanding that mpd doesn't support encoding via ffmpeg. Personally I'd like a "one size fits all" but there's no data available of usage so you kinda make general assumptions as a result. Some might have a preference to fit everything within 8mbyte flash for instance which makes your choices very limited.
@xabolcs - Thanks for the additional info. I will handle the update shortly with an MPD update too. As Daniel mentioned, it's unfortunate that MPD does not use ffmpeg for encoding.
... however it does depend on what you're using on the other end.
OpenWrt boxes on both end! 😉
In that case, adding support for sndio would offer a more efficient solution. Looking at Alpine Linux and comparing it to libflac it looks like it would be the same size or even possibly a few kbytes smaller. :-)
MPD updated to 0.20.20 and added back flac encoder here: 91171954ea9552298829e495210a0ea5db9865a0 Closing this as fixed.
@diizzyy - Suggestions for building newer versions of mpc and libmpdclient are welcome. Both now require python3/meson/ninja - sigh...
@thess It's not pretty but it does work ;-) Since libmpdclient moves slowly I just ripped out the essential commits, left out the new build stuff and things related to the test directory. The commits should line up just fine using git on upstream repo. 0001-libs-libmpdclient-Update-to-2.14.zip
Yes, that is certain gross and not very maintainable. You did give me an idea though... Bring forward the minimum autotools files with a few tweaks (config.h.in, configure.ac, Makefile.am, libmpdclient.pc.in and m4/ax_check_compiler_flags.m4) -- and, you are good to go! You could probably do without the compiler flags check macro if you trust your environment ;-)
$ autoreconf -fi
$ ./configure --disable-documentation
$ make
That said, I'm pretty sure there's at least one new source file. Is that included?
Already fully tested - As I said - you need a few tweaks. I might check them in after I get the latest mpc to build too. I take it from your question, you'd like the patch.
Yeah, that sounds great :-) I have no idea about mpc as I used ncmpcpp instead (that name) on another platform
Maintainer: @thess
Environment:
Description:
mpd-full
package doesn't haveflac
encoder, butmpd-mini
has.(Continuing from commit 2cedae0aa9befe1135c83f007942d89ec906658e comment ... )
I wanted to use the
httpd
output with a compressed format.flac
was supported bympd-full
in older versions of OpenWrt, like 15.05 and 17.01 and it had moderate CPU usage withcompression 0
.Removing
libffmpeg-mini
and installinglibffmpeg-full
doesn't help.It would be nice if
mpd-full
would haveflac
encoding feature like before.mpd-mini
opkg info
mpd --version
mpd-full
opkg info
Note the missing
libflac
dependency!mpd --version
Note the missing
flac
encoder plugin!