musicplayerdaemon / libmpdclient Goto Github PK
View Code? Open in Web Editor NEWC library to implement a MPD client
C library to implement a MPD client
I've started seeing problems connecting to local mpd instance on an OSX host since version 2.12 of libmpdclient. Specifically:
mpd
runs fine, and I can connect to it via telnet localhost 6600
$ mpc status
mpd error: Operation now in progress
Same goes for ncmpcpp, which also uses libmpdclient.
Here's a strace of mpc -h localhost -p 6600
:
dtrace: system integrity protection is on, some features will not be available
SYSCALL(args) = return
mpd error: Operation now in progress
open("/dev/dtracehelper\0", 0x2, 0x7FFF5C49A8F0) = 3 0
ioctl(0x3, 0x80086804, 0x7FFF5C49A878) = 0 0
close(0x3) = 0 0
thread_selfid(0x3, 0x80086804, 0x7FFF5C49A878) = 148204 0
bsdthread_register(0x7FFFC0625080, 0x7FFFC0625070, 0x2000) = 1073741919 0
ulock_wake(0x1, 0x7FFF5C49A02C, 0x0) = -1 Err#2
issetugid(0x1, 0x7FFF5C49A02C, 0x0) = 0 0
mprotect(0x10379F000, 0x88, 0x1) = 0 0
mprotect(0x1037A1000, 0x1000, 0x0) = 0 0
mprotect(0x1037B7000, 0x1000, 0x0) = 0 0
mprotect(0x1037B8000, 0x1000, 0x0) = 0 0
mprotect(0x1037CE000, 0x1000, 0x0) = 0 0
mprotect(0x103774000, 0x1000, 0x1) = 0 0
mprotect(0x10379F000, 0x88, 0x3) = 0 0
mprotect(0x10379F000, 0x88, 0x1) = 0 0
getpid(0x10379F000, 0x88, 0x1) = 33807 0
stat64("/AppleInternal/XBS/.isChrooted\0", 0x7FFF5C499EE8, 0x1) = -1 Err#2
stat64("/AppleInternal\0", 0x7FFF5C499F80, 0x1) = -1 Err#2
csops(0x840F, 0x7, 0x7FFF5C499A10) = -1 Err#22
dtrace: error on enabled probe ID 2158 (ID 561: syscall::sysctl:return): invalid kernel access in action #10 at DIF offset 40
ulock_wake(0x1, 0x7FFF5C499F90, 0x0) = -1 Err#2
csops(0x840F, 0x7, 0x7FFF5C4992F0) = -1 Err#22
shm_open(0x7FFFC0618DE7, 0x0, 0x0) = 3 0
mmap(0x0, 0x1000, 0x1, 0x1, 0x3, 0x0) = 0x1037CF000 0
close_nocancel(0x3) = 0 0
open_nocancel("/etc/.mdns_debug\0", 0x0, 0x0) = -1 Err#2
dtrace: error on enabled probe ID 2158 (ID 561: syscall::sysctl:return): invalid kernel access in action #10 at DIF offset 40
dtrace: error on enabled probe ID 2158 (ID 561: syscall::sysctl:return): invalid kernel access in action #10 at DIF offset 40
kqueue(0x7FFF5C49B3A0, 0x6, 0x7FBDB9003200) = 3 0
kevent(0x3, 0x7FFF5C49B540, 0x1) = 0 0
socket(0x1, 0x1, 0x0) = 4 0
setsockopt(0x4, 0xFFFF, 0x1022) = 0 0
setsockopt(0x4, 0xFFFF, 0x1100) = 0 0
connect_nocancel(0x4, 0x7FFF5C49B350, 0x6A) = 0 0
sendto_nocancel(0x4, 0x7FBDB8C02CD0, 0x1C) = 28 0
select_nocancel(0x5, 0x7FFF5C49B340, 0x0) = 1 0
recvfrom_nocancel(0x4, 0x7FFF5C49B310, 0x4) = 4 0
socketpair(0x1, 0x1, 0x0) = 0 0
setsockopt(0x5, 0xFFFF, 0x1100) = 0 0
sendto_nocancel(0x4, 0x7FBDB8C027E0, 0x32) = 50 0
sendmsg_nocancel(0x4, 0x7FFF5C49B2C0, 0x0) = 1 0
close_nocancel(0x6) = 0 0
select_nocancel(0x6, 0x7FFF5C49B2C0, 0x0) = 1 0
recvfrom_nocancel(0x5, 0x7FFF5C49B290, 0x4) = 4 0
close_nocancel(0x5) = 0 0
socketpair(0x1, 0x1, 0x0) = 0 0
setsockopt(0x5, 0xFFFF, 0x1100) = 0 0
sendto_nocancel(0x4, 0x7FBDB8C027E0, 0x32) = 50 0
sendmsg_nocancel(0x4, 0x7FFF5C49B2C0, 0x0) = 1 0
close_nocancel(0x6) = 0 0
select_nocancel(0x6, 0x7FFF5C49B2C0, 0x0) = 1 0
recvfrom_nocancel(0x5, 0x7FFF5C49B290, 0x4) = 4 0
close_nocancel(0x5) = 0 0
kevent(0x3, 0x7FFF5C49B540, 0x1) = 0 0
kevent(0x3, 0x0, 0x0) = 1 0
kevent(0x3, 0x0, 0x0) = 1 0
recvfrom_nocancel(0x4, 0x7FFF5C49B340, 0x1C) = 28 0
recvfrom_nocancel(0x4, 0x7FBDB8C02D40, 0x25) = 37 0
select_nocancel(0x5, 0x7FFF5C49B370, 0x0) = 1 0
kevent(0x3, 0x7FFF5C49AE40, 0x1) = 0 0
recvfrom_nocancel(0x4, 0x7FFF5C49B340, 0x1C) = 28 0
recvfrom_nocancel(0x4, 0x7FBDB8C027E0, 0x31) = 49 0
select_nocancel(0x5, 0x7FFF5C49B370, 0x0) = 0 0
kevent(0x3, 0x7FFF5C49AE40, 0x1) = 0 0
sendto_nocancel(0x4, 0x7FBDB8C02D50, 0x1C) = 28 0
sendto_nocancel(0x4, 0x7FBDB8C02D50, 0x1C) = 28 0
close_nocancel(0x3) = 0 0
sysctlbyname(net.statistics, 0xE, 0x7FFFC936EB00, 0x7FFF5C49B290, 0x0) = -1 Err#2
proc_info(0x2, 0x840F, 0x11) = 56 0
proc_info(0x2, 0x840F, 0x11) = 56 0
dtrace: error on enabled probe ID 2158 (ID 561: syscall::sysctl:return): invalid kernel access in action #10 at DIF offset 40
issetugid(0x7FFF5C49B050, 0x4, 0x7FFF5C49ADC8) = 0 0
open("/Users/yacoob/brew/bin/mpc\0", 0x8004, 0x7FFFC0664583) = 3 0
fcntl(0x3, 0x32, 0x7FFF5C49A650) = 0 0
close(0x3) = 0 0
openat(0xFFFFFFFE, "/System/Library/Preferences/Logging/Subsystems/com.apple.network.plist\0", 0x1000104, 0x7FFF5C49ABB8) = 3 0
lseek(0x3, 0x0, 0x2) = 433 0
dtrace: error on enabled probe ID 2149 (ID 463: syscall::pread:return): invalid kernel access in action #12 at DIF offset 44
close(0x3) = 0 0
openat(0xFFFFFFFE, "/Library/Preferences/Logging/Subsystems/com.apple.network.plist\0", 0x1000104, 0x7FFF5C49ABB8) = -1 Err#2
socket(0x20, 0x2, 0x2) = 3 0
setsockopt(0x3, 0xFFFF, 0x1022) = 0 0
ioctl(0x3, 0xC0644E03, 0x7FFF5C49B1A0) = 0 0
connect(0x3, 0x7FFF5C49B178, 0x20) = 0 0
setsockopt(0x3, 0xFFFF, 0x1002) = 0 0
fcntl(0x3, 0x3, 0x0) = 2 0
fcntl(0x3, 0x4, 0x6) = 0 0
sendto(0x3, 0x7FFF5C49B318, 0x24) = 36 0
recvfrom(0x3, 0x7FFF5C49B2F0, 0x28) = 40 0
sendto(0x3, 0x7FFF5C49B318, 0x24) = 36 0
recvfrom(0x3, 0x7FFF5C49B2F0, 0x28) = 40 0
socket(0x1E, 0x1, 0x6) = 5 0
fcntl(0x5, 0x1, 0x0) = 0 0
fcntl(0x5, 0x2, 0x1) = 0 0
fcntl(0x5, 0x3, 0x0) = 2 0
fcntl(0x5, 0x4, 0x6) = 0 0
connect(0x5, 0x7FBDB8C02D50, 0x1C) = -1 Err#36
close(0x5) = 0 0
socket(0x2, 0x1, 0x6) = 5 0
fcntl(0x5, 0x1, 0x0) = 0 0
fcntl(0x5, 0x2, 0x1) = 0 0
fcntl(0x5, 0x3, 0x0) = 2 0
fcntl(0x5, 0x4, 0x6) = 0 0
connect(0x5, 0x7FBDB8C02770, 0x10) = -1 Err#36
close(0x5) = 0 0
dtrace: error on enabled probe ID 2133 (ID 951: syscall::write_nocancel:return): invalid kernel access in action #12 at DIF offset 92
Sadly I haven't found a way to convince dtruss to decode things like sockaddr
structures, so I can't verify whether those connect calls are correct. I can't see any attempt to talk to mpd on a network sniffer. I haven't been changing any network settings, and the problems started after libmpdclient was updated to 2.12 via homebrew, so I'm guessing something has changed there.
Version information, etc:
$ mpd --version
Music Player Daemon 0.20.9
Copyright (C) 2003-2007 Warren Dukes <[email protected]>
Copyright 2008-2017 Max Kellermann <[email protected]>
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 proxy
Storage plugins:
local
Decoders plugins:
[dsdiff] dff
[dsf] dsf
[faad] aac
[fluidsynth] mid
[ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx 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]
Filters:
libsamplerate
Tag plugins:
id3tag
Output plugins:
null fifo openal osx httpd recorder
Encoder plugins:
null wave
Archive plugins:
[bz2] bz2
Input plugins:
file archive curl ffmpeg
Playlist plugins:
extm3u m3u pls cue embcue
Protocols:
file:// http:// https:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps://
Other features:
icu ipv6 tcp un
HOMEBREW_VERSION: 1.2.4-107-gaa8eb21
macOS: 10.12.5-x86_64
mpc: stable 0.28 (bottled)
ncmpcpp: stable 0.8 (bottled), HEAD
libmpdclient: stable 2.12 (bottled), HEAD
Please tell me if you need any more specific information.
libmpdclient: v2.18
mpd: v0.21.11
I have been trying to use libmpdclient's sticker functionality to attach custom data to tracks in my music collection, and I'm getting false
returned from the mpd_send_sticker_get()
call and mpd_connection_get_error_message()
returns "no such sticker"
.
An example:
const char *path = "Air/Moon_Safari/01_-_La_Femme_d_argent.flac";
const char *name = "PLAY_COUNT";
auto result = mpd_send_sticker_get(connection, StickerTypeSong, path, name);
if(!result)
throw std::runtime_error(mpd_connection_get_error_message(connection));
I have seen that communicating directly with MPD using telnet, that querying a named sticker field will result in the "no such sticker"
error if it hasn't been initially assigned. But, having pre-assigned it with the follwoing;
[sturd@laptop ~]$ telnet ***.***.***.*** 6600
Trying ***.***.***.***...
Connected to ***.***.***.***.
Escape character is '^]'.
OK MPD 0.21.11
sticker set song Air/Moon_Safari/01_-_La_Femme_d_argent.flac PLAY_COUNT 666
OK
sticker get song Air/Moon_Safari/01_-_La_Femme_d_argent.flac PLAY_COUNT
sticker: PLAY_COUNT=666
OK
I still appear to be getting the "no such sticker"
error, when running the code above, via libmpdclient
.
Howdy, I develop an MPD client called ashuffle
that uses libmpdclient. A user filed an issue where a long comment on a track caused an mpd_recv_song
as part of an mpd_list_all_meta
command to fail with the error message Response line too large
, which I presume is an MPD_ERROR_MALFORMED
. It looks like this is caused by libmpdclient's fixed 4KiB buffer size. The user was able to confirm that a line in the raw response from MPD was over the 4KiB limit (4.4KiB). I have not directly confirmed this at HEAD but the issue appears to be in the code.
It looks like this has come up before in issue #51, and PR #53 has a proposed fix, but there hasn't been any activity on it in almost 10mo. Would the libmpdclient maintainers be open to moving forward with that, or another, fix?
Hello,
I would like to have an example of use for the function mpd_send_add_tag_id.
Thx
libmpdclient
tests whether linker supports --version-script
with script used for libmpdclient
itself (explicitly lists symbols):
Lines 77 to 84 in 14e9b3b
That however is problematic with mold
since it errors out if defined symbol is not found in binary and libmpdclient
concludes linker does not support --version-script
even though it does:
Command line: `/usr/libexec/icecc/bin/gcc /home/users/builder/rpm/BUILD/libmpdclient-2.21/build/meson-private/tmphs6u03ul/testfile.c -o /home/users/builder/rpm/BUILD/libmpdclient-2.21/build/meson-private/tmphs6u03ul/output.exe -O2 -fwrapv -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -Werror=trampolines -fomit-frame-pointer -mbranch-protection=standard -mtune=cortex-a72.cortex-a53 -D_FILE_OFFSET_BITS=64 -O0 -Wl,--fatal-warnings -Wl,--version-script=/home/users/builder/rpm/BUILD/libmpdclient-2.21/libmpdclient.ld -Wl,--as-needed -Wl,--no-copy-dt-needed-entries -Wl,-z,relro -Wl,-z,combreloc -Wl,-fuse-ld=mold` -> 1
stderr:
mold: error: /home/users/builder/rpm/BUILD/libmpdclient-2.21/libmpdclient.ld: cannot assign version `libmpdclient2` to symbol `mpd_async_new`: symbol not found
mold: error: /home/users/builder/rpm/BUILD/libmpdclient-2.21/libmpdclient.ld: cannot assign version `libmpdclient2` to symbol `mpd_async_free`: symbol not found
...
collect2: error: ld returned 1 exit status
-----------
Compiler for C supports link arguments -Wl,--version-script=/home/users/builder/rpm/BUILD/libmpdclient-2.21/libmpdclient.ld: NO
Perhaps meson.build
should test with some limited version script like:
libmpdclient2 {
local:
*;
};
and use real version script only for actual library linking.
In ncmpcpp, I had a look at making a search on "any" also search file names.. But it seems to be a constraint in the libmpdclient implementation that any
does not search URIs.. Is there any point in this and what could be done to overcome this inconvenience.. Thanks in advance ; )
Here is a follow-up of debian bug report #953110 :
Uses mpc to send a 'find' request, containing an invalid search expression. The expected result is an error message about the invalid search expression.
$ strace -s 40 -e trace=sendto,recvfrom mpc find '('$(for i in $(seq 1 4086); do echo -n "+"; done)')'
recvfrom(3, "OK MPD 0.21.4\n", 4096, MSG_DONTWAIT, NULL, NULL) = 14
sendto(3, "find \"(+++++++++++++++++++++++++++++++++"..., 4096, MSG_DONTWAIT, NULL, 0) = 4096
recvfrom(3, "ACK [2@0] {find} Word expected\n", 4096, MSG_DONTWAIT, NULL, NULL) = 31
mpd error: Word expected
+++ exited with 1 +++
Note the request size on line 3: 4096 bytes.
The only difference is one more '+' in the expression, which would result in a request of 4097 bytes.
$ strace -s 40 -e trace=sendto,recvfrom mpc find '('$(for i in $(seq 1 4087); do echo -n "+"; done)')'
recvfrom(3, "OK MPD 0.21.4\n", 4096, MSG_DONTWAIT, NULL, NULL) = 14
mpd error: Timeout
+++ exited with 1 +++
Instead of error about the invalid request, a timeout occurs after 30 seconds because the request is not really sent (note the missing sendto()
call).
Ideally, libmpdclient should support requests of arbitrary size (eventually reaching the server limit), but if that is not feasible, at least a proper error reporting would be nice.
I've been implementing an MPD client in Go and using this library as a reference and I noticed something while comparing the implementation of mpd_status_feed
to the protocol docs.
From the docs:
time: total time elapsed (of current playing/paused song) in seconds (deprecated, use elapsed instead)
elapsed: Total time elapsed within the current song in seconds, but with higher resolution.
duration: Duration of the current song in seconds.
It looks like the time
field has been deprecated in the protocol in favor of elapsed
and duration
. libmpdclient
supports the new elapsed
field; however, it still reads the total time of the current song from the time
field instead of duration
:
Lines 246 to 251 in 1315357
This is low priority as I imagine the time
field won't be removed any time soon for back-compat reasons but just thought I'd point it out.
I wouldn't mind implementing the fix myself but it does raise the question of how to handle the case where both time
and duration
are present in the response. Ideally, the value of duration
would be favored; however, that could be more difficult than it sounds given how the library reads line-by-line. I know the server reports the version in the initial connection process and I imagine libmpdclient
probably stores this somewhere. Maybe if the version is >=0.20
we ignore the time
field and just use elapsed
& duration
?
Edit: Another thought is the new duration
field provides millisecond precision so this has an added functional benefit other than just code clean up
Current Haiku, x86_64, current libmpdclient:
Log:
/Ports/Testring/libmpdclient-2.14/b❯❯❯ uname -a
Haiku shredder 1 hrev51858 Mar 24 2018 14:07:08 x86_64 x86_64 Haiku
/Ports/Testring/libmpdclient-2.14/b❯❯❯ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/5.4.0/lto-wrapper
Target: x86_64-unknown-haiku
Configured with: /sources/gcc-5.4.0/configure --build=x86_64-unknown-haiku --prefix=/packages/gcc-5.4.0_2016_06_04-7/.self/develop/tools --libexecdir=/packages/gcc-5.4.0_2016_06_04-7/.self/develop/tools/lib --mandir=/packages/gcc-5.4.0_2016_06_04-7/.self/documentation/man --docdir=/packages/gcc-5.4.0_2016_06_04-7/.self/documentation/packages/gcc --enable-threads=posix --disable-nls --enable-shared --with-gnu-ld --with-gnu-as --enable-version-specific-runtime-libs --enable-languages=c,c++,fortran --enable-lto --enable-frame-pointer --with-pkgversion=2016_06_04 --enable-__cxa-atexit --with-system-zlib --enable-checking=release --with-bug-url=http://dev.haiku-os.org/ --with-default-libstdcxx-abi=gcc4-compatible --enable-libssp --disable-multilib
Thread model: posix
gcc version 5.4.0 (2016_06_04)
/Ports/Testring/libmpdclient-2.14/b❯❯❯ meson --version
0.44.0
/Ports/Testring/libmpdclient-2.14/b❯❯❯ ninja test
[0/1] Running all tests.
1/2 t_iso8601 FAIL 0.13 s
2/2 t_commands OK 0.14 s
OK: 1
FAIL: 1
SKIP: 0
TIMEOUT: 0
The output from the failed tests:
1/2 t_iso8601 FAIL 0.13 s
--- command ---
/Ports/Testring/libmpdclient-2.14/b/test/t_iso8601
--- stdout ---
Running suite(s): iso8601
0%: Checks: 1, Failures: 1, Errors: 0
../test/t_iso8601.c:20:F:Core:test_iso8601:0: Assertion 't == now' failed: t == 1522999670, now == 1523003270
-------
Full log written to /Ports/Testring/libmpdclient-2.14/b/meson-logs/testlog.txt
FAILED: meson-test
'/packages/meson-0.44.0-1/cmd~python3.6/bin/python3' -u /bin/meson test --no-rebuild --print-errorlogs
ninja: build stopped: subcommand failed.
/Ports/Testring/libmpdclient-2.14/b❯❯❯
License
BSD-2-Clause OR BSD-3-Clause
or
BSD-2-Clause AND BSD-3-Clause
?
Hello,
I am developing a MPD client for mac OS (Xcode 10, Mojave), everything works fine except the connection management.
After a certain delay MPD closes the connection and can not reconnect.
I tried a failed mpd_connexion_free, mpd_connection_set_keepalive no effect, mpd_connection_set_timeout no effect.
mpd_connection_free(mpd1Connection);
mpd1Connection = mpd_connection_new(host, port, 0);
error: Failed ti resolve hostname
Would you have a way to give me?
Libmpdclient doesn't support the new albumart command.
I tried to implement it myself, but I don't know how I get the binary data. Is there a appropriated way in libmpdclient?
The documentation on https://www.musicpd.org/doc/libmpdclient/ is not for libmpdclient but for mpd in general.
~/Downloads/libmpdclient-2.13 $ meson -Dtest=true . output
The Meson build system
Version: 0.41.1
Source dir: /home/HEILBRONN/hn11022/Downloads/libmpdclient-2.13
Build dir: /home/HEILBRONN/hn11022/Downloads/libmpdclient-2.13/output
Build type: native build
Project name: libmpdclient
Native c compiler: cc (gcc 6.3.0)
Build machine cpu family: x86_64
Build machine cpu: x86_64
Checking for function "getaddrinfo": YES
Configuring config.h using configuration
Configuring version.h using configuration
Compiler for c supports argument -Wall: YES
Compiler for c supports argument -Wextra: YES
Compiler for c supports argument -Wno-deprecated-declarations: YES
Compiler for c supports argument -Wmissing-prototypes: YES
Compiler for c supports argument -Wshadow: YES
Compiler for c supports argument -Wpointer-arith: YES
Compiler for c supports argument -Wstrict-prototypes: YES
Compiler for c supports argument -Wcast-qual: YES
Compiler for c supports argument -Wwrite-strings: YES
Compiler for c supports argument -Wl,--version-script=/home/HEILBRONN/hn11022/Downloads/libmpdclient-2.13/libmpdclient.ld: YES
Found pkg-config: /usr/host/bin/pkg-config (0.29.2)
Native dependency check found: YES 0.11.0
Build targets in project: 5
Traceback (most recent call last):
File "/usr/x86_64-pc-linux-gnu/lib/python3.6/site-packages/mesonbuild/mesonmain.py", line 307, in run
app.generate()
File "/usr/x86_64-pc-linux-gnu/lib/python3.6/site-packages/mesonbuild/mesonmain.py", line 182, in generate
g.generate(intr)
File "/usr/x86_64-pc-linux-gnu/lib/python3.6/site-packages/mesonbuild/backend/ninjabackend.py", line 194, in generate
self.generate_target(t, outfile)
File "/usr/x86_64-pc-linux-gnu/lib/python3.6/site-packages/mesonbuild/backend/ninjabackend.py", line 445, in generate_target
elem = self.generate_link(target, outfile, outname, obj_list, linker, pch_objects)
File "/usr/x86_64-pc-linux-gnu/lib/python3.6/site-packages/mesonbuild/backend/ninjabackend.py", line 2331, in generate_link
target.install_rpath)
File "/usr/x86_64-pc-linux-gnu/lib/python3.6/site-packages/mesonbuild/compilers.py", line 839, in build_rpath_args
return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, install_rpath)
File "/usr/x86_64-pc-linux-gnu/lib/python3.6/site-packages/mesonbuild/compilers.py", line 768, in build_unix_rpath_args
relative = os.path.relpath(p, from_dir)
File "/usr/x86_64-pc-linux-gnu/lib/python3.6/posixpath.py", line 448, in relpath
raise ValueError("no path specified")
ValueError: no path specified
Without the tests it works fine:
~/Downloads/libmpdclient-2.13 $ meson -Dtest=false . output
The Meson build system
Version: 0.41.1
Source dir: /home/HEILBRONN/hn11022/Downloads/libmpdclient-2.13
Build dir: /home/HEILBRONN/hn11022/Downloads/libmpdclient-2.13/output
Build type: native build
Project name: libmpdclient
Native c compiler: cc (gcc 6.3.0)
Build machine cpu family: x86_64
Build machine cpu: x86_64
Checking for function "getaddrinfo": YES
Configuring config.h using configuration
Configuring version.h using configuration
Compiler for c supports argument -Wall: YES
Compiler for c supports argument -Wextra: YES
Compiler for c supports argument -Wno-deprecated-declarations: YES
Compiler for c supports argument -Wmissing-prototypes: YES
Compiler for c supports argument -Wshadow: YES
Compiler for c supports argument -Wpointer-arith: YES
Compiler for c supports argument -Wstrict-prototypes: YES
Compiler for c supports argument -Wcast-qual: YES
Compiler for c supports argument -Wwrite-strings: YES
Compiler for c supports argument -Wl,--version-script=/home/HEILBRONN/hn11022/Downloads/libmpdclient-2.13/libmpdclient.ld: YES
Build targets in project: 2
It looks like passwords in an environment variable no longer work after updating to libmpdclient 2.18 and mpc 0.33:
$ MPD_HOST='[email protected]' mpc status
MPD error: Failed to resolve host name
However passing --host
works as expected:
$ mpc status --host '[email protected]'
volume: n/a repeat: off random: off single: off consume: on
I believe this may be due to e7c4c12.
Should be the priority definition in following functions not the same? int or unsigned and not different.
mpd_pure
unsigned
mpd_song_get_prio(const struct mpd_song *song);
bool
mpd_run_prio(struct mpd_connection *connection, int priority,
unsigned position);
Please add a interface for the searchaddpl mpd command.
Hi,
Looks like the latest release of libmpdclient (2.20) didn't generate/update the documentation located at https://www.musicpd.org/doc/libmpdclient/ -- which appears to be version 2.19 per the header. Any chance we could get it updated to the latest?
(My main reason is that I'm trying to use jcorporation's album art work. Reading the source does "work for me", but I figure it might trip up the next person to look for that feature)
From looking at the README / musicpd.org sites, I think this is the right place to log this request as it doesn't look like the website repo hosts the documentation. If not, just let me know.
Thanks!
> mpc --host='@mpd'
mpd error: Failed to resolve host name
> env MPD_HOST="@mpd" mpc
volume: 24% repeat: off random: off single: off consume: off
libmpdclient-2.16 is installed on my system.
Hi Max,
I would implement the position parameter for the load command and have a question:
Current we have these functions to load a playlist into the queue.
Should be following functions added? This would hide the special 0: range specification.
Will this position parameter also support whence as addid or searchadd?
Similar issue as in mpc: MusicPlayerDaemon/mpc#14
WARNING: -Wl,--version-script=/buildroot/output/build/libmpdclient-2.14/libmpdclient.ld
looks like a linker argument, but has_argument and other similar methods only support
checking compiler arguments. Using them to check linker arguments are never
supported, and results are likely to be wrong regardless of the compiler you are using.
has_link_argument or other similar method can be used instead.
Tested with Meson version 0.46.0 and libmpdclient 2.14.
The documentation is just a class reference with no indication of where to start or understanding the API. Please write an overview or tutorial to get us started
I'm developing an open source iOS app to remote control MPD.
My music library is organised like this music_dir/albums_artists/albums
; Each album folder contain the songs and a cover.jpg file.
Currently to obtain the album path in order to download covers I have to do something like :
mpd_search_db_songs(connection, true)
mpd_search_add_tag_constraint(connection, MPD_OPERATOR_DEFAULT, MPD_TAG_ALBUM, album_name)
mpd_recv_song(connection)
/ mpd_song_get_uri(song)
Would it be possible to have a single function that returns the URI given the album_name
? Or am I doing things the wrong way ?
Thanks.
I have an Alsa source which is in fact a bluetooth source (thanks to bluealsa). I can get the duration of a song, but I can't find how to set this duration for mpd?
Is it possible?
Thx!
After upgrading to 2.12, i'm unable to connect to mpd with any mpd client.
Mpc outputs;
dyld: Library not loaded: /usr/local/opt/libmpdclient/lib/libmpdclient.2.dylib Referenced from: /usr/local/bin/mpc Reason: Incompatible library version: mpc requires version 3.0.0 or later, but libmpdclient.2.dylib provides version 0.0.0
Any idea what could it be?
I'm using OSX 10.12.
I am now trying to build 45 minutes from the tarball a rpm package, but does not work.
%build
export CFLAGS="%{optflags} -Os -fPIC -fuse-ld=gold -fuse-linker-plugin"
export CXXFLAGS="$CFLAGS"
export CC="gcc $CFLAGS"
export LDFLAGS="-Wl,--as-needed -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack %{optflags} -Os -fuse-ld=gold -fuse-linker-plugin"
meson . dksoft-build
ninja -C dksoft-build
%install
ninja -C dksoft-build install DESTDIR=%{buildroot}
Error:
"I think" meson does not support my DESTDIR, has someone an idea why it fails?
Building libmpdclient version 2.18 fails when using the normal meson . output
and ninja -C output
command with the error
[55/55] Linking target example.exe
FAILED: example.exe example.pdb
link @example.exe.rsp
LINK : fatal error LNK1181: cannot open input file 'mpdclient.lib'
ninja: build stopped: subcommand failed.
When configuring with meson -Ddefault_library=static . output
building works, but it'll only build a libmpdclient.a file. Using -Ddefault_library=both
doesn't seem to work either.
I haven't really used meson so maybe I'm doing something wrong. I'm also not quite sure about the resulting libmpdclient.a but it seems to not work outside of the example program.
I also didn't use Meson 0.37 like in the readme but rather 0.54.2, although I tested 0.37 which didn't seem to work at all.
Vulnerability in libmpdclient v2.20.
When a malicious MP3 is played, the libmpdclient is crashed.
A vulnerability has been discovered in Automotive Grade Linux (AGL) using libmpdclient v2.20.
MP3 files were moved and played in the environment.
After that, it was confirmed that libmpdclient(v2.20) Crashed.
Checking the log, mpd_status_get_elapsed_ms: Assertion `status != NULL' faile.
That part appears to be the cause of the crash.
I will attach different files that cause the crash.
I first reported this problem to AGL.
-> https://jira.automotivelinux.org/browse/SPEC-4661
However, I think it's probably a problem with your client library (libmpdclient), which is open source.
Please check and reply.
Hi, I just wanna know how much is the Vapi updated. Last commit was in 2015, ¿there are so much changes since that?
After I called: meson . output
I saw an error mesage:
The Meson build system
Version: 0.40.1
Source dir: /home/magik/Downloads/libmpdclient-2.12
Build dir: /home/magik/Downloads/libmpdclient-2.12/output
Build type: native build
Project name: libmpdclient
Native c compiler: cc (gcc 5.4.0)
Build machine cpu family: x86_64
Build machine cpu: x86_64
Checking for function "getaddrinfo": YES
Configuring config.h using configuration
Configuring version.h using configuration
Compiler for c supports argument -Wall: YES
Compiler for c supports argument -Wextra: YES
Compiler for c supports argument -Wno-deprecated-declarations: YES
Compiler for c supports argument -Wmissing-prototypes: YES
Compiler for c supports argument -Wshadow: YES
Compiler for c supports argument -Wpointer-arith: YES
Compiler for c supports argument -Wstrict-prototypes: YES
Compiler for c supports argument -Wcast-qual: YES
Compiler for c supports argument -Wwrite-strings: YES
Compiler for c supports argument -Wl,--version-script=/home/magik/Downloads/libmpdclient-2.12/libmpdclient.ld: YES
Meson encountered an error in file meson.build, line 88, column 0:
Tried to form an absolute path to a source dir. You should not do that but use
relative paths instead.To get include path to any directory relative to the current dir do
incdir = include_directories(dirname)
After this incdir will contain both the current source dir as well as the
corresponding build dir. It can then be used in any subdirectory and
Meson will take care of all the busywork to make paths work.Dirname can even be '.' to mark the current directory. Though you should
remember that the current source and build directories are always
put in the include directories by default so you only need to do
include_directories('.') if you intend to use the result in a
different subdirectory.
I tried this command on two different systems (Mint Linux 18.2 & FreeBSD 11.0) with similar result.
This error message is from Mint Linux.
I'm using libmpdclient
in a C++ project. When I try to use struct mpd_status
like in the snippet below, the compiler complains about invalid use of incomplete type ‘struct mpd_status’
.
It looks like the reason for it is that this struct is defined in a .c file. Is there a way to make it accessible to C++? For now I moved the definition into status.h
.
struct mpd_status * status = mpd_run_status(connection);
skip = (status->state != MPD_STATE_PLAY);
mpd_status_free(status);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.