From ef5f96a193c8fb946958d5ca86760a435fc0f57b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Mar 2018 10:42:05 +0100 Subject: increment version number to 0.20.19 --- NEWS | 2 ++ configure.ac | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index b35157d59..ba33b53a7 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +ver 0.20.19 (not yet released) + ver 0.20.18 (2018/02/24) * input - curl: allow authentication methods other than "Basic" diff --git a/configure.ac b/configure.ac index d1ec1fe9e..7e4041a57 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.20.18, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.20.19, musicpd-dev-team@lists.sourceforge.net) VERSION_MAJOR=0 VERSION_MINOR=20 -VERSION_REVISION=18 +VERSION_REVISION=19 VERSION_EXTRA=0 AC_CONFIG_SRCDIR([src/Main.cxx]) -- cgit v1.2.3 From 79535212c871a0428a813c72cf349332d6d5d165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Kr=C3=B6ner?= Date: Sat, 3 Mar 2018 20:56:28 +0100 Subject: Get rid of GCD on macOS which breaks debug builds With Grand Central Dispatch used in Main.cxx, debug builds on macOS crash as the IsInside() assertion gets triggered in the event loop. As a simple fix, usage of GCD is removed. Plugging and unplugging headphones or changes of the default output device was tested without issues. Whatever the original commit tried to fix by GCD probably does not need fixing anymore. --- NEWS | 1 + src/Main.cxx | 19 +------------------ 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/NEWS b/NEWS index ba33b53a7..5c40e4f6c 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ ver 0.20.19 (not yet released) +* macOS: fix crash bug ver 0.20.18 (2018/02/24) * input diff --git a/src/Main.cxx b/src/Main.cxx index def4aed30..31c4d9fbd 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -107,10 +107,6 @@ #include #endif -#ifdef __BLOCKS__ -#include -#endif - #include static constexpr size_t KILOBYTE = 1024; @@ -483,21 +479,8 @@ try { daemonize_begin(options.daemon); #endif -#ifdef __BLOCKS__ - /* Runs the OS X native event loop in the main thread, and runs - the rest of mpd_main on a new thread. This lets CoreAudio receive - route change notifications (e.g. plugging or unplugging headphones). - All hardware output on OS X ultimately uses CoreAudio internally. - This must be run after forking; if dispatch is called before forking, - the child process will have a broken internal dispatch state. */ - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - exit(mpd_main_after_fork(config)); - }); - dispatch_main(); - return EXIT_FAILURE; // unreachable, because dispatch_main never returns -#else return mpd_main_after_fork(config); -#endif + } catch (const std::exception &e) { LogError(e); return EXIT_FAILURE; -- cgit v1.2.3 From dadd3ca6716f37fdb530a48e9ef98e0fa6bc6a89 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Mar 2018 11:46:11 +0100 Subject: protocol/ArgParser: disallow negative seek times Instead of stopping playback (due to seek time overflow), reject the seek command. Closes #240 Relative negative values (with "seekcur") are still allowed, and MPD will fix the resulting position if it turns out to be negative. But the "seek" and "seekid" commands use an unsigned time stamp which must not be negative. --- NEWS | 2 ++ src/protocol/ArgParser.cxx | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/NEWS b/NEWS index 5c40e4f6c..670cb3256 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.20.19 (not yet released) +* protocol + - validate absolute seek time, reject negative values * macOS: fix crash bug ver 0.20.18 (2018/02/24) diff --git a/src/protocol/ArgParser.cxx b/src/protocol/ArgParser.cxx index 47fdfa405..bdc28bcbf 100644 --- a/src/protocol/ArgParser.cxx +++ b/src/protocol/ArgParser.cxx @@ -164,6 +164,10 @@ SongTime ParseCommandArgSongTime(const char *s) { auto value = ParseCommandArgFloat(s); + if (value < 0) + throw FormatProtocolError(ACK_ERROR_ARG, + "Negative value not allowed: %s", s); + return SongTime::FromS(value); } -- cgit v1.2.3 From cf7ec2c9d369b864479c070a8b4a25779bd2694c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Mar 2018 20:19:22 +0100 Subject: doc/user.xml: add section about compiling for Android --- doc/user.xml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/doc/user.xml b/doc/user.xml index feab01cc6..1636914ef 100644 --- a/doc/user.xml +++ b/doc/user.xml @@ -265,6 +265,52 @@ apt-get install g++ \ script. + +
+ Compiling for Android + + + MPD can be compiled as an Android app. It can be installed + easily with Google + Play, but if you want to build it from source, follow + this section. + + + + You need: + + + + + + Android SDK + + + + + + Android + NDK + + + + + + Just like with the native build, unpack the + MPD source tarball and change + into the directory. Then, instead of + ./configure, type: + + + ./android/build.py SDK_PATH NDK_PATH +make android/build/mpd-debug.apk + + + This downloads various library sources, and then configures + and builds MPD. + +
-- cgit v1.2.3 From e86015a72a8225f534df8777c16748a849914522 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Mar 2018 20:32:50 +0100 Subject: android/build.py: convert ndk_arch to local variable --- android/build.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/build.py b/android/build.py index 4c4f77ae7..516829274 100755 --- a/android/build.py +++ b/android/build.py @@ -44,7 +44,7 @@ class AndroidNdkToolchain: self.src_path = src_path self.build_path = build_path - self.ndk_arch = 'arm' + ndk_arch = 'arm' android_abi = 'armeabi-v7a' ndk_platform = 'android-14' @@ -53,7 +53,7 @@ class AndroidNdkToolchain: ndk_platform_path = os.path.join(ndk_path, 'platforms', ndk_platform) sysroot = os.path.join(ndk_path, 'sysroot') - target_root = os.path.join(ndk_platform_path, 'arch-' + self.ndk_arch) + target_root = os.path.join(ndk_platform_path, 'arch-' + ndk_arch) install_prefix = os.path.join(arch_path, 'root') @@ -95,7 +95,7 @@ class AndroidNdkToolchain: ' ' + common_flags self.libs = '' - self.is_arm = self.ndk_arch == 'arm' + self.is_arm = ndk_arch == 'arm' self.is_armv7 = self.is_arm and 'armv7' in self.cflags self.is_windows = False -- cgit v1.2.3 From ea552208fcb5d59386253233955b5ae5f7989562 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Mar 2018 20:43:59 +0100 Subject: android/build.py: add ABI parameter --- android/build.py | 26 ++++++++++++++++++-------- doc/user.xml | 9 ++++++++- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/android/build.py b/android/build.py index 516829274..02b426119 100755 --- a/android/build.py +++ b/android/build.py @@ -3,13 +3,14 @@ import os, os.path import sys, subprocess -if len(sys.argv) < 3: - print("Usage: build.py SDK_PATH NDK_PATH [configure_args...]", file=sys.stderr) +if len(sys.argv) < 4: + print("Usage: build.py SDK_PATH NDK_PATH ABI [configure_args...]", file=sys.stderr) sys.exit(1) sdk_path = sys.argv[1] ndk_path = sys.argv[2] -configure_args = sys.argv[3:] +android_abi = sys.argv[3] +configure_args = sys.argv[4:] if not os.path.isfile(os.path.join(sdk_path, 'tools', 'android')): print("SDK not found in", ndk_path, file=sys.stderr) @@ -19,8 +20,18 @@ if not os.path.isdir(ndk_path): print("NDK not found in", ndk_path, file=sys.stderr) sys.exit(1) +android_abis = { + 'armeabi-v7a': { + 'arch': 'arm-linux-androideabi', + 'ndk_arch': 'arm', + 'llvm_triple': 'armv7-none-linux-androideabi', + 'cflags': '-march=armv7-a -mfpu=vfp -mfloat-abi=softfp', + }, +} + # select the NDK target -arch = 'arm-linux-androideabi' +abi_info = android_abis[android_abi] +arch = abi_info['arch'] # the path to the MPD sources mpd_path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]) or '.', '..')) @@ -44,8 +55,7 @@ class AndroidNdkToolchain: self.src_path = src_path self.build_path = build_path - ndk_arch = 'arm' - android_abi = 'armeabi-v7a' + ndk_arch = abi_info['ndk_arch'] ndk_platform = 'android-14' # select the NDK compiler @@ -63,11 +73,11 @@ class AndroidNdkToolchain: toolchain_path = os.path.join(ndk_path, 'toolchains', arch + '-' + gcc_version, 'prebuilt', build_arch) llvm_path = os.path.join(ndk_path, 'toolchains', 'llvm', 'prebuilt', build_arch) - llvm_triple = 'armv7-none-linux-androideabi' + llvm_triple = abi_info['llvm_triple'] common_flags = '-Os -g' common_flags += ' -fPIC' - common_flags += ' -march=armv7-a -mfpu=vfp -mfloat-abi=softfp' + common_flags += ' ' + abi_info['cflags'] toolchain_bin = os.path.join(toolchain_path, 'bin') llvm_bin = os.path.join(llvm_path, 'bin') diff --git a/doc/user.xml b/doc/user.xml index 1636914ef..1707a8cbc 100644 --- a/doc/user.xml +++ b/doc/user.xml @@ -303,9 +303,16 @@ apt-get install g++ \ ./configure, type: - ./android/build.py SDK_PATH NDK_PATH + ./android/build.py SDK_PATH NDK_PATH ABI make android/build/mpd-debug.apk + + SDK_PATH is the absolute path where you + installed the Android SDK; NDK_PATH is + the Android NDK installation path; ABI is + the Android ABI to be built, e.g. "armeabi-v7a". + + This downloads various library sources, and then configures and builds MPD. -- cgit v1.2.3 From 8266ab5588ccca25b0b8b09e970736898159e73f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Mar 2018 20:46:46 +0100 Subject: android/build.py: support the x86 ABI First commit for issue #69 --- android/build.py | 11 ++++++++++- python/build/libs.py | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/android/build.py b/android/build.py index 02b426119..19dcbaee7 100755 --- a/android/build.py +++ b/android/build.py @@ -24,9 +24,18 @@ android_abis = { 'armeabi-v7a': { 'arch': 'arm-linux-androideabi', 'ndk_arch': 'arm', + 'toolchain_arch': 'arm-linux-androideabi', 'llvm_triple': 'armv7-none-linux-androideabi', 'cflags': '-march=armv7-a -mfpu=vfp -mfloat-abi=softfp', }, + + 'x86': { + 'arch': 'i686-linux-android', + 'ndk_arch': 'x86', + 'toolchain_arch': 'x86', + 'llvm_triple': 'i686-none-linux-android', + 'cflags': '-march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32', + }, } # select the NDK target @@ -71,7 +80,7 @@ class AndroidNdkToolchain: self.install_prefix = install_prefix self.sysroot = sysroot - toolchain_path = os.path.join(ndk_path, 'toolchains', arch + '-' + gcc_version, 'prebuilt', build_arch) + toolchain_path = os.path.join(ndk_path, 'toolchains', abi_info['toolchain_arch'] + '-' + gcc_version, 'prebuilt', build_arch) llvm_path = os.path.join(ndk_path, 'toolchains', 'llvm', 'prebuilt', build_arch) llvm_triple = abi_info['llvm_triple'] diff --git a/python/build/libs.py b/python/build/libs.py index 4cbab63ee..18b4cbbaf 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -23,6 +23,11 @@ libvorbis = AutotoolsProject( [ '--disable-shared', '--enable-static', ], + + edits={ + # this option is not understood by clang + 'configure': lambda data: data.replace('-mno-ieee-fp', ' '), + } ) opus = AutotoolsProject( -- cgit v1.2.3