Streaming over HTTPS: Stopping hangs

Discuss client development (or even MPD development if you feel so inclined), ask questions about the client libs, MPD feature requests from client developers, etc...
Post Reply
maersu
Posts: 4
Joined: January 23rd, 2019, 5:48 am

Streaming over HTTPS: Stopping hangs

Post by maersu » January 23rd, 2019, 6:20 am

Hi

Streaming over HTTPS starts but when I send the stop command the MPD becomes unresponsive for a few seconds. Works perfect with HTTP. Unfortunately, we can't use HTTP, because we stream a private stream to a IoT device (like voice messages).
The device is similar to a PI. During the stopping of the stream, the CPU load is 100%. I tried both python client libs (python-mpd2 and python-musicpd) both with the same issue. Also tried different formats (available on AWS Elastic Transcoder).

Any help is appreciated ;)

Thanks & regards,
Marcel

Version

Music Player Daemon 0.19.21

Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright (C) 2008-2014 Max Kellermann <max@duempel.org>
This is free software; see the source for copying conditions. There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Database plugins:
simple upnp

Storage plugins:
local

Decoders plugins:
[mpg123] mp3
[vorbis] ogg oga
[oggflac] ogg oga
[flac] flac
[opus] opus ogg oga
[sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
[dsdiff] dff
[dsf] dsf
[faad] aac
[wavpack] wv
[modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm
[fluidsynth] mid
[ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
[pcm]

Output plugins:
null fifo alsa ao oss openal pulse jack httpd recorder

Encoder plugins:
null vorbis opus wave flac

Archive plugins:
[bz2] bz2

Input plugins:
file alsa archive curl ffmpeg mms

Playlist plugins:
extm3u m3u pls xspf asx rss soundcloud cue embcue

Protocols:
file:// http:// https:// mms:// mmsh:// mmst:// mmsu:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps:// alsa://

max
Forum team
Posts: 863
Joined: January 15th, 2013, 3:43 pm

Re: Streaming over HTTPS: Stopping hangs

Post by max » January 23rd, 2019, 7:59 am

Your MPD version is very old and unsupported.

skidoo
Posts: 162
Joined: April 28th, 2013, 10:06 pm
Location: Western Germany

Re: Streaming over HTTPS: Stopping hangs

Post by skidoo » January 23rd, 2019, 7:20 pm

Not able to reproduce with Music Player Daemon 0.21.5 (v0.21.4-38-gcfe22502a) (Debian testing with x64 flavour) stop and pause working as expected. No increase in cpu load. Please consider updating MPD.

maersu
Posts: 4
Joined: January 23rd, 2019, 5:48 am

Re: Streaming over HTTPS: Stopping hangs

Post by maersu » January 23rd, 2019, 8:12 pm

Thanks you very much for the super fast replies!
Ok, we will try to update it (takes a while to make a build for yocto linux).

max
Forum team
Posts: 863
Joined: January 15th, 2013, 3:43 pm

Re: Streaming over HTTPS: Stopping hangs

Post by max » January 24th, 2019, 9:25 am

Here's my patch submission for updating OpenEmbedded's MPD recipe to 0.21.3: https://patchwork.openembedded.org/series/14981/
It was however not merged because there were problems on the buildbot, but nobody was able to explain them to me.

maersu
Posts: 4
Joined: January 23rd, 2019, 5:48 am

Re: Streaming over HTTPS: Stopping hangs

Post by maersu » January 24th, 2019, 3:13 pm

We updated the MPD via Yocto with the same result :( ( Max, thanks for the Patch, we will try tomorrow!)

HTTPS still hangs after stopping. But starting the stream triggers the following log entry (but not with HTTP)

Code: Select all

Jan 24 15:00 : ffmpeg/mov,mp4,m4a,3gp,3g2,mj2: Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing 
Our protocols include https:

Code: Select all

Music Player Daemon 0.20.22 (v0.20.22-dirty)

...

Protocols:
 file:// http:// https:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps:// alsa://

max
Forum team
Posts: 863
Joined: January 15th, 2013, 3:43 pm

Re: Streaming over HTTPS: Stopping hangs

Post by max » January 24th, 2019, 5:27 pm

Just like skidoo, I can't reproduce this with MPD 0.21. This suggests it could be fixed by upgrading. MPD 0.20 isn't supported anymore, so there's no point in using that version.

maersu
Posts: 4
Joined: January 23rd, 2019, 5:48 am

Re: Streaming over HTTPS: Stopping hangs

Post by maersu » January 25th, 2019, 1:21 pm

First things first: Thanks for your help, we appreciate it.

We try to build the MPD from your patch. Unfortunately, packaging fails:
out.png
out.png (106.61 KiB) Viewed 379 times
This is the log from the yocto do_package (maybe it helps):

Code: Select all

DEBUG: Executing python function sstate_task_prefunc
DEBUG: Python function sstate_task_prefunc finished
DEBUG: Executing python function extend_recipe_sysroot
NOTE: Direct dependencies are ['/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-support/curl/curl_7.58.0.bb:do_populate_sysroot', 'virtual:native:/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-devtools/ninja/ninja_1.7.2.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.3.3.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-devtools/gcc/gcc-cross_7.3.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-support/boost/boost_1.64.0.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/meta-openembedded/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-core/base-files/base-files_3.0.14.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-support/sqlite/sqlite3_3.20.0.bb:do_populate_sysroot', 'virtual:native:/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot', 'virtual:native:/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-extended/shadow/shadow_4.2.1.bb:do_populate_sysroot', 'virtual:native:/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-devtools/rpm/rpm_git.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-core/systemd/systemd_234.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-devtools/python/python3-native_3.5.3.bb:do_populate_sysroot', 'virtual:native:/home/philipp/Documents/yocto-env/sources/meta-caru/recipes-devtools/meson/meson_0.47.2.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-extended/shadow/shadow_4.2.1.bb:do_populate_sysroot', 'virtual:native:/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-support/icu/icu_59.1.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-multimedia/mpg123/mpg123_1.25.6.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-core/dbus/dbus_1.10.20.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-core/expat/expat_2.2.3.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-multimedia/pulseaudio/pulseaudio_10.0.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-core/systemd/systemd-systemctl-native.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb:do_populate_sysroot', '/home/philipp/Documents/yocto-env/sources/poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.4.1.bb:do_populate_sysroot']
NOTE: Installed into sysroot: []
NOTE: Skipping as already exists in sysroot: ['gcc-runtime', 'curl', 'ninja-native', 'ffmpeg', 'gcc-cross-arm', 'boost', 'glibc', 'yajl', 'base-files', 'sqlite3', 'pkgconfig-native', 'shadow-native', 'rpm-native', 'systemd', 'shadow-sysroot', 'python3-native', 'meson-native', 'shadow', 'pseudo-native', 'icu', 'mpg123', 'quilt-native', 'dbus', 'expat', 'libsndfile1', 'pulseaudio', 'systemd-systemctl-native', 'base-passwd', 'alsa-lib', 'linux-libc-headers', 'libgcc', 'gnutls', 'zlib', 're2c-native', 'x264', 'xz', 'libogg', 'libtheora', 'bzip2', 'automake-native', 'libtool-native', 'zlib-native', 'binutils-cross-arm', 'xz-native', 'gmp-native', 'autoconf-native', 'gnu-config-native', 'mpfr-native', 'libmpc-native', 'texinfo-dummy-native', 'python3', 'db-native', 'nss-native', 'gettext-minimal-native', 'libarchive-native', 'bzip2-native', 'file-native', 'elfutils-native', 'popt-native', 'dbus-native', 'opkg-utils', 'bash-completion', 'util-linux', 'acl', 'libcap', 'readline', 'lz4', 'kmod', 'libcgroup', 'readline-native', 'openssl-native', 'sqlite3-native', 'python3-setuptools-native', 'attr', 'flac', 'libvorbis', 'libtool', 'bluez5', 'glib-2.0', 'sbc', 'ofono', 'gconf', 'libatomic-ops', 'speexdsp', 'avahi', 'libidn', 'gmp', 'libunistring', 'nettle', 'flex-native', 'bison-native', 'm4-native', 'gdbm', 'openssl', 'db', 'libffi', 'nspr-native', 'e2fsprogs-native', 'lzo-native', 'expat-native', 'ncurses', 'ncurses-native', 'makedepend-native', 'cryptodev-linux-native', 'unzip-native', 'dbus-glib', 'libcheck', 'libical', 'libpcre', 'mobile-broadband-provider-info', 'libxml2', 'gobject-introspection', 'libdaemon', 'cryptodev-linux', 'util-linux-native', 'attr-native', 'pigz-native', 'util-macros-native', 'xproto-native']
DEBUG: Python function extend_recipe_sysroot finished
DEBUG: Executing python function do_package
DEBUG: Executing python function package_get_auto_pr
DEBUG: Python function package_get_auto_pr finished
DEBUG: Executing python function perform_packagecopy
DEBUG: Python function perform_packagecopy finished
DEBUG: Executing python function split_and_strip_files
DEBUG: runstrip: ['arm-phytec-linux-gnueabi-strip', '--remove-section=.comment', '--remove-section=.note', '/home/philipp/Documents/yocto-env/build/tmp/work/cortexa7hf-neon-vfpv4-phytec-linux-gnueabi/mpd/0.21.3-r0/package/usr/bin/mpd']
DEBUG: Python function split_and_strip_files finished
DEBUG: Executing python function fixup_perms
DEBUG: Python function fixup_perms finished
DEBUG: Executing python function systemd_populate_packages
DEBUG: adding systemd calls to postinst/postrm for mpd
ERROR: SYSTEMD_SERVICE_mpd value mpd.socket does not exist
DEBUG: Python function systemd_populate_packages finished
DEBUG: Python function do_package finished
ERROR: Function failed: systemd_populate_packages
Manually installing the two systemd files gives:

Code: Select all

ERROR: mpd-0.21.3-r0 do_package_qa: QA Issue: package mpd contains bad RPATH /home/philipp/Documents/yocto-env/build/tmp/work/cortexa7hf-neon-vfpv4-phytec-linux-gnueabi/mpd/0.21.3-r0/recipe-sysroot-native/usr/lib:/home/philipp/Documents/yocto-env/build/tmp/work/cortexa7hf-neon-vfpv4-phytec-linux-gnueabi/mpd/0.21.3-r0/recipe-sysroot-native/lib in file /home/philipp/Documents/yocto-env/build/tmp/work/cortexa7hf-neon-vfpv4-phytec-linux-gnueabi/mpd/0.21.3-r0/packages-split/mpd/usr/bin/mpd
package mpd contains bad RPATH /home/philipp/Documents/yocto-env/build/tmp/work/cortexa7hf-neon-vfpv4-phytec-linux-gnueabi/mpd/0.21.3-r0/recipe-sysroot-native/usr/lib:/home/philipp/Documents/yocto-env/build/tmp/work/cortexa7hf-neon-vfpv4-phytec-linux-gnueabi/mpd/0.21.3-r0/recipe-sysroot-native/lib in file /home/philipp/Documents/yocto-env/build/tmp/work/cortexa7hf-neon-vfpv4-phytec-linux-gnueabi/mpd/0.21.3-r0/packages-split/mpd/usr/bin/mpd [rpaths]
ERROR: mpd-0.21.3-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.
ERROR: mpd-0.21.3-r0 do_package_qa: Function failed: do_package_qa
ERROR: Logfile of failure stored in: /home/philipp/Documents/yocto-env/build/tmp/work/cortexa7hf-neon-vfpv4-phytec-linux-gnueabi/mpd/0.21.3-r0/temp/log.do_package_qa.29804
ERROR: Task (/home/philipp/Documents/yocto-env/sources/meta-caru/recipes-multimedia/musicpd/mpd_0.21.3.bb:do_package_qa) failed with exit code '1'

Post Reply