From 087e7cedae1e336172ac5869beb53214dab7a67e Mon Sep 17 00:00:00 2001 From: casey langen Date: Wed, 1 Apr 2020 19:29:36 -0700 Subject: [PATCH 01/33] Ensure we always build the MPRIS plugin in release binaries. --- .circleci/config.yml | 2 +- musikcube.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 522ad0a33..4f81bae91 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,7 +45,7 @@ jobs: steps: - checkout - run: apt-get update - - run: apt-get install -y build-essential clang cmake libboost-thread1.67-dev libboost-system1.67-dev libboost-filesystem1.67-dev libboost-date-time1.67-dev libboost-atomic1.67-dev libboost-chrono1.67-dev libogg-dev libvorbis-dev libavutil-dev libavformat-dev libswresample-dev libncursesw5-dev libasound2-dev libpulse-dev pulseaudio libmicrohttpd-dev libmp3lame-dev libcurl4-openssl-dev libev-dev libssl-dev libtag1-dev + - run: apt-get install -y build-essential clang cmake libboost-thread1.67-dev libboost-system1.67-dev libboost-filesystem1.67-dev libboost-date-time1.67-dev libboost-atomic1.67-dev libboost-chrono1.67-dev libogg-dev libvorbis-dev libavutil-dev libavformat-dev libswresample-dev libncursesw5-dev libasound2-dev libpulse-dev pulseaudio libmicrohttpd-dev libmp3lame-dev libcurl4-openssl-dev libev-dev libssl-dev libtag1-dev libsystemd-dev - run: cmake -DGENERATE_DEB=1 -DDEB_ARCHITECTURE=amd64 -DDEB_PLATFORM=ubuntu -DDEB_DISTRO=eoan -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release . - run: make -j2 - run: make package diff --git a/musikcube.spec b/musikcube.spec index d625cd24c..bf9f26d3f 100644 --- a/musikcube.spec +++ b/musikcube.spec @@ -8,7 +8,7 @@ Summary: A cross-platform, terminal-based audio engine, library, player and serv Source0: https://github.com/clangen/musikcube/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz License: BSD-3-Clause Packager: David Muckle -BuildRequires: gcc-c++ cmake boost-devel libogg-devel libvorbis-devel ffmpeg-devel ncurses-devel zlib-devel alsa-lib-devel pulseaudio-libs-devel openssl-devel libcurl-devel libmicrohttpd-devel lame-devel libev-devel taglib-devel make +BuildRequires: gcc-c++ cmake boost-devel libogg-devel libvorbis-devel ffmpeg-devel ncurses-devel zlib-devel alsa-lib-devel pulseaudio-libs-devel openssl-devel libcurl-devel libmicrohttpd-devel lame-devel libev-devel taglib-devel systemd-devel make Requires: boost libogg libvorbis ffmpeg-libs ncurses zlib alsa-lib pulseaudio-libs openssl libcurl libmicrohttpd lame libev taglib %description From 1621d355fa75c6c6b62d78b9c2b95d4194b64b35 Mon Sep 17 00:00:00 2001 From: casey langen Date: Wed, 1 Apr 2020 19:29:53 -0700 Subject: [PATCH 02/33] Fix bug where directory browsing would get reset when switching between tabs. --- src/musikcube/app/layout/DirectoryLayout.cpp | 4 ++++ src/musikcube/app/layout/DirectoryLayout.h | 3 ++- src/musikcube/app/layout/LibraryLayout.cpp | 18 ++++++++++++------ src/musikcube/app/layout/LibraryLayout.h | 3 ++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/musikcube/app/layout/DirectoryLayout.cpp b/src/musikcube/app/layout/DirectoryLayout.cpp index f977190ac..db19620ba 100644 --- a/src/musikcube/app/layout/DirectoryLayout.cpp +++ b/src/musikcube/app/layout/DirectoryLayout.cpp @@ -129,6 +129,10 @@ void DirectoryLayout::SetDirectory(const std::string& directory) { this->Refresh(true); } +std::string DirectoryLayout::GetDirectory() { + return this->adapter->GetCurrentPath(); +} + void DirectoryLayout::OnVisibilityChanged(bool visible) { LayoutBase::OnVisibilityChanged(visible); if (visible) { diff --git a/src/musikcube/app/layout/DirectoryLayout.h b/src/musikcube/app/layout/DirectoryLayout.h index b66893378..0a70f990e 100644 --- a/src/musikcube/app/layout/DirectoryLayout.h +++ b/src/musikcube/app/layout/DirectoryLayout.h @@ -62,7 +62,8 @@ namespace musik { virtual void OnVisibilityChanged(bool visible); virtual bool KeyPress(const std::string& key); - virtual void SetDirectory(const std::string& directory); + void SetDirectory(const std::string& directory); + std::string GetDirectory(); protected: virtual void OnLayout(); diff --git a/src/musikcube/app/layout/LibraryLayout.cpp b/src/musikcube/app/layout/LibraryLayout.cpp index 3189a595f..8bec41e2c 100755 --- a/src/musikcube/app/layout/LibraryLayout.cpp +++ b/src/musikcube/app/layout/LibraryLayout.cpp @@ -159,7 +159,7 @@ void LibraryLayout::ShowBrowse(const std::string& category) { if (category.size()) { this->browseLayout->SwitchCategory(category); } - + this->lastBrowseCategoryType = category; REMEMBER(keys::LastLibraryView, type::Browse); } @@ -167,7 +167,6 @@ void LibraryLayout::ShowCategorySearch() { SHOULD_REFOCUS(this->categorySearchLayout) ? this->categorySearchLayout->FocusInput() : this->ChangeMainLayout(this->categorySearchLayout); - REMEMBER(keys::LastLibraryView, type::CategoryFilter); } @@ -180,11 +179,13 @@ void LibraryLayout::ShowTrackSearch() { } void LibraryLayout::ShowDirectories(const std::string& directory) { - this->directoryLayout->SetDirectory(directory); + if (directory.size()) { + this->directoryLayout->SetDirectory(directory); + REMEMBER(keys::LastBrowseDirectoryRoot, directory); + } this->ChangeMainLayout(this->directoryLayout); - + this->lastBrowseCategoryType = MagicConstants::DirectoryCategoryType; REMEMBER(keys::LastLibraryView, type::Directory); - REMEMBER(keys::LastBrowseDirectoryRoot, directory); } void LibraryLayout::InitializeWindows() { @@ -445,7 +446,12 @@ bool LibraryLayout::KeyPress(const std::string& key) { return true; } else if (Hotkeys::Is(Hotkeys::NavigateLibraryBrowse, key)) { - this->ShowBrowse(); + if (this->lastBrowseCategoryType == MagicConstants::DirectoryCategoryType) { + this->ShowDirectories(); + } + else { + this->ShowBrowse(); + } return true; } else if (Hotkeys::Is(Hotkeys::NavigateLibraryFilter, key)) { diff --git a/src/musikcube/app/layout/LibraryLayout.h b/src/musikcube/app/layout/LibraryLayout.h index 9f330142b..ba67f5991 100755 --- a/src/musikcube/app/layout/LibraryLayout.h +++ b/src/musikcube/app/layout/LibraryLayout.h @@ -97,7 +97,7 @@ namespace musik { void ShowCategorySearch(); void ShowTrackSearch(); void ShowDirectoryChooser(); - void ShowDirectories(const std::string& directory); + void ShowDirectories(const std::string& directory = ""); void ChangeMainLayout(std::shared_ptr newLayout); void OnLayoutChanged(); @@ -115,6 +115,7 @@ namespace musik { std::shared_ptr trackSearchLayout; std::shared_ptr visibleLayout; cursespp::ShortcutsWindow* shortcuts; + std::string lastBrowseCategoryType; }; } } From 20ca61058c2cf053f189b3e34a26f776ade2d986 Mon Sep 17 00:00:00 2001 From: casey langen Date: Thu, 2 Apr 2020 22:07:43 -0700 Subject: [PATCH 03/33] Added the ability to hot swap from a browse category selection. --- src/musikcube/app/overlay/PlayQueueOverlays.cpp | 6 ++++++ src/musikcube/data/locales/en_US.json | 1 + 2 files changed, 7 insertions(+) diff --git a/src/musikcube/app/overlay/PlayQueueOverlays.cpp b/src/musikcube/app/overlay/PlayQueueOverlays.cpp index d2ca78840..b70d1bf71 100644 --- a/src/musikcube/app/overlay/PlayQueueOverlays.cpp +++ b/src/musikcube/app/overlay/PlayQueueOverlays.cpp @@ -516,6 +516,7 @@ void PlayQueueOverlays::ShowAddCategoryOverlay( adapter->AddEntry(_TSTR("playqueue_overlay_add_to_start_of_queue")); adapter->AddEntry(_TSTR("playqueue_overlay_add_to_end_in_queue")); adapter->AddEntry(_TSTR("playqueue_overlay_add_as_next_in_queue")); + adapter->AddEntry(_TSTR("playqueue_overlay_add_hotswap_queue")); adapter->SetSelectable(true); size_t selectedIndex = 0; @@ -542,6 +543,11 @@ void PlayQueueOverlays::ShowAddCategoryOverlay( showAddCategorySelectionToPlaylistOverlay( messageQueue, library, fieldColumn, fieldValue, fieldId); } + else if (index == adapter->GetEntryCount() - 1) { + auto tracks = queryTracksByCategory( + library, fieldColumn, fieldValue, fieldId); + playback.HotSwap(*tracks); + } else { handleAddCategorySelectionToPlayQueue( playback, library, fieldColumn, fieldValue, fieldId, index - 1); diff --git a/src/musikcube/data/locales/en_US.json b/src/musikcube/data/locales/en_US.json index f075101af..22b32a1e5 100644 --- a/src/musikcube/data/locales/en_US.json +++ b/src/musikcube/data/locales/en_US.json @@ -159,6 +159,7 @@ "playqueue_overlay_add_to_start_of_queue": "add to beginning of play queue", "playqueue_overlay_add_to_end_in_queue": "add to end of play queue", "playqueue_overlay_add_as_next_in_queue": "add as next in play queue", + "playqueue_overlay_add_hotswap_queue": "hotswap with play queue", "playqueue_overlay_add_to_playlist": "add to playlist", "playqueue_overlay_select_playlist_title": "select a playlist", From e1884321ff335fd89409e3967ca8f66be47a2d07 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sat, 4 Apr 2020 19:51:09 -0700 Subject: [PATCH 04/33] Fixed a super old null pointer dereference in TransportWindow. --- src/musikcube/app/window/TransportWindow.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/musikcube/app/window/TransportWindow.cpp b/src/musikcube/app/window/TransportWindow.cpp index d325ea7ba..120718949 100755 --- a/src/musikcube/app/window/TransportWindow.cpp +++ b/src/musikcube/app/window/TransportWindow.cpp @@ -223,11 +223,12 @@ struct musik::cube::TransportDisplayCache { if (updatedTotal != secondsTotal) { secondsTotal = updatedTotal; if (secondsTotal <= 0 && secondsTotal != INT_MIN) { - std::string duration = - this->track->GetString(constants::Track::DURATION); - - if (duration.size()) { - secondsTotal = std::stoi(duration); + if (this->track) { + std::string duration = + this->track->GetString(constants::Track::DURATION); + if (duration.size()) { + secondsTotal = std::stoi(duration); + } } } From fe8d32f58614cb639dabd02b63782c18fbba3eaf Mon Sep 17 00:00:00 2001 From: casey langen Date: Sat, 4 Apr 2020 19:51:25 -0700 Subject: [PATCH 05/33] Fixed dbus plugin to report metadata (and also added album art). --- src/plugins/mpris/dbus.cpp | 1 + src/plugins/mpris/mpris.cpp | 20 ++++++++++++++++++-- src/plugins/mpris/mpris.h | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/plugins/mpris/dbus.cpp b/src/plugins/mpris/dbus.cpp index 71e2a9eb2..034fbe0c2 100644 --- a/src/plugins/mpris/dbus.cpp +++ b/src/plugins/mpris/dbus.cpp @@ -188,6 +188,7 @@ static int get_metadata(sd_bus* bus, const char* path, const char *iface, // append fields sd_msg_append_dict(reply, "mpris:trackid", metadata.trackid.c_str(), 'o'); sd_msg_append_dict(reply, "mpris:length", &metadata.length, 'x'); + sd_msg_append_dict(reply, "mpris:artUrl", metadata.albumArt.c_str(), 's'); sd_msg_append_strlist_dict(reply, "xesam:artist", metadata.artist.c_str()); sd_msg_append_dict(reply, "xesam:title", metadata.title.c_str(), 's'); sd_msg_append_dict(reply, "xesam:album", metadata.album.c_str(), 's'); diff --git a/src/plugins/mpris/mpris.cpp b/src/plugins/mpris/mpris.cpp index 57613c6d9..a8029c843 100644 --- a/src/plugins/mpris/mpris.cpp +++ b/src/plugins/mpris/mpris.cpp @@ -4,12 +4,14 @@ #include #include #include +#include extern "C" { #include } -thread_local char localBuffer[1024]; +std::string thumbnailPath; +thread_local char localBuffer[4096]; static MPRISRemote remote; static const std::map> MPRISPropertyNames = @@ -25,6 +27,12 @@ static std::string GetMetadataString(ITrack* track, const char* key) return std::string(localBuffer); } +static std::string GetThumbnailPath(ITrack* track) +{ + int64_t thumbnailId = track->GetInt64(track::ThumbnailId); + return thumbnailPath + std::to_string(thumbnailId) + ".jpg"; +} + static class MPRISPlugin : public IPlugin { public: MPRISPlugin() { } @@ -39,6 +47,13 @@ static class MPRISPlugin : public IPlugin { int SdkVersion() { return musik::core::sdk::SdkVersion; } } plugin; +extern "C" void SetEnvironment(IEnvironment* environment) { + if (environment) { + environment->GetPath(PathLibrary, localBuffer, sizeof(localBuffer)); + thumbnailPath = std::string(localBuffer) + "/thumbs/"; + } +} + extern "C" IPlugin* GetPlugin() { return &plugin; } @@ -101,7 +116,7 @@ void MPRISRemote::MPRISDeinit() { void MPRISRemote::MPRISEmitChange(MPRISProperty prop) { if (bus) { - char** strv = (char**)(&MPRISPropertyNames.at(prop)); + char** strv = (char**)(MPRISPropertyNames.at(prop).data()); std::unique_lock lock(sd_mutex); sd_bus_emit_properties_changed_strv(bus, "/org/mpris/MediaPlayer2", "org.mpris.MediaPlayer2.Player", @@ -181,6 +196,7 @@ struct MPRISMetadataValues MPRISRemote::MPRISGetMetadata() { metadata.discNumber = curTrack->GetInt32(track::DiscNum); metadata.trackNumber = curTrack->GetInt32(track::TrackNum); metadata.length = curTrack->GetInt64(track::Duration)*1000*1000; + metadata.albumArt = GetThumbnailPath(curTrack); metadata.available = true; } } diff --git a/src/plugins/mpris/mpris.h b/src/plugins/mpris/mpris.h index 352402932..a3ca130f8 100644 --- a/src/plugins/mpris/mpris.h +++ b/src/plugins/mpris/mpris.h @@ -27,6 +27,7 @@ struct MPRISMetadataValues { std::string title; std::string album; std::string albumArtist; + std::string albumArt; std::string genre; std::string comment; uint32_t trackNumber; From 98e8662c55e141a2519f9bc205f1ebca0a52c31c Mon Sep 17 00:00:00 2001 From: casey langen Date: Sat, 4 Apr 2020 21:59:59 -0700 Subject: [PATCH 06/33] Whitespace fix. --- src/musikcube/app/layout/LibraryLayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/musikcube/app/layout/LibraryLayout.cpp b/src/musikcube/app/layout/LibraryLayout.cpp index 8bec41e2c..7076028af 100755 --- a/src/musikcube/app/layout/LibraryLayout.cpp +++ b/src/musikcube/app/layout/LibraryLayout.cpp @@ -350,7 +350,7 @@ IWindowPtr LibraryLayout::GetFocus() { result = this->visibleLayout->GetFocus(); } - return result; + return result; } bool LibraryLayout::SetFocus(cursespp::IWindowPtr window) { From 08871978e2212ef07b3abc9ea0109d3aa86a9f48 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sun, 5 Apr 2020 17:47:00 -0700 Subject: [PATCH 07/33] Added a bash script for quickly installing dependencies on supported, non-Windows platforms. Likely needs a bit of tweaking. --- install-deps.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 install-deps.sh diff --git a/install-deps.sh b/install-deps.sh new file mode 100755 index 000000000..1e0f8150f --- /dev/null +++ b/install-deps.sh @@ -0,0 +1,44 @@ +#!/bin/bash +OS=`uname` +if [ $OS == "Linux" ]; then + echo "detected linux" + if [ -x "$(command -v lsb_release)" ]; then + DISTRO=`lsb_release -cs` + echo "detected ${DISTRO}" + case $DISTRO in + "cosmic" | "disco" | "eoan") + sudo apt-get install build-essential clang cmake libboost-thread1.67-dev libboost-system1.67-dev libboost-filesystem1.67-dev libboost-date-time1.67-dev libboost-atomic1.67-dev libboost-chrono1.67-dev libogg-dev libvorbis-dev libavutil-dev libavformat-dev libswresample-dev libncursesw5-dev libasound2-dev libpulse-dev pulseaudio libmicrohttpd-dev libmp3lame-dev libcurl4-openssl-dev libev-dev libtag1-dev libsystemd-dev + ;; + "bionic") + sudo apt-get install build-essential clang cmake libboost-thread1.65-dev libboost-system1.65-dev libboost-filesystem1.65-dev libboost-date-time1.65-dev libboost-atomic1.65-dev libboost-chrono1.65-dev libogg-dev libvorbis-dev libavutil-dev libavformat-dev libswresample-dev libncursesw5-dev libasound2-dev libpulse-dev pulseaudio libmicrohttpd-dev libmp3lame-dev libcurl4-openssl-dev libev-dev libtag1-dev libsystemd-dev + ;; + "artful") + sudo apt-get install build-essential clang cmake libboost-thread1.63-dev libboost-system1.63-dev libboost-filesystem1.63-dev libboost-date-time1.63-dev libboost-atomic1.63-dev libboost-chrono1.63-dev libogg-dev libvorbis-dev libavutil-dev libavformat-dev libswresample-dev libncursesw5-dev libasound2-dev libpulse-dev pulseaudio libmicrohttpd-dev libmp3lame-dev libcurl4-openssl-dev libev-dev libtag1-dev libsystemd-dev + ;; + esac + fi + if [ -f "/etc/fedora-release" ]; then + DISTRO=`cat /etc/fedora-release` + echo "detected ${DISTRO}" + sudo dnf install gcc-c++ make cmake boost-devel libogg-devel libvorbis-devel ffmpeg-devel ncurses-devel zlib-devel alsa-lib-devel pulseaudio-libs-devel libcurl-devel libmicrohttpd-devel lame-devel libev-devel taglib-devel libsystemd-devel + fi + if [ -f "/etc/arch-release" ] || [ -f "/etc/manjaro-release" ]; then + sudo pacman -S libogg libvorbis libmicrohttpd ffmpeg lame cmake ncurses boost pulseaudio libpulse alsa-lib curl libev taglib + fi +fi +if [ $OS == "Darwin" ]; then + echo "detected macos" + brew install cmake boost libogg libvorbis ffmpeg libmicrohttpd lame libev taglib +fi +if [ $OS == "FreeBSD" ]; then + echo "detected freebsd" + pkg install boost-all curl libvorbis libogg libmicrohttpd ffmpeg alsa-lib cmake sndio libev taglib bash + portsnap fetch + portsnap extract (if first time using ports) + cd /usr/ports/audio/lame + make reinstall +fi +if [ $OS == "OpenBSD" ]; then + echo "detected openbsd" + pkg_add git cmake ffmpeg boost sndio libev libmicrohttpd taglib +fi From c79e0965548f1c7f965f7ccf909e602b426a4319 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sun, 5 Apr 2020 18:49:59 -0700 Subject: [PATCH 08/33] Updated install-deps to add support for the upcoming ubuntu 'focal' release. --- install-deps.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install-deps.sh b/install-deps.sh index 1e0f8150f..8befd874f 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -6,6 +6,9 @@ if [ $OS == "Linux" ]; then DISTRO=`lsb_release -cs` echo "detected ${DISTRO}" case $DISTRO in + "focal") + sudo apt-get install build-essential clang cmake libboost-thread1.71-dev libboost-system1.71-dev libboost-filesystem1.71-dev libboost-date-time1.71-dev libboost-atomic1.71-dev libboost-chrono1.71-dev libogg-dev libvorbis-dev libavutil-dev libavformat-dev libswresample-dev libncursesw5-dev libasound2-dev libpulse-dev pulseaudio libmicrohttpd-dev libmp3lame-dev libcurl4-openssl-dev libev-dev libtag1-dev libsystemd-dev + ;; "cosmic" | "disco" | "eoan") sudo apt-get install build-essential clang cmake libboost-thread1.67-dev libboost-system1.67-dev libboost-filesystem1.67-dev libboost-date-time1.67-dev libboost-atomic1.67-dev libboost-chrono1.67-dev libogg-dev libvorbis-dev libavutil-dev libavformat-dev libswresample-dev libncursesw5-dev libasound2-dev libpulse-dev pulseaudio libmicrohttpd-dev libmp3lame-dev libcurl4-openssl-dev libev-dev libtag1-dev libsystemd-dev ;; From 36ede66603682fa3a72fc5d7dd1016f8a95af6b8 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sun, 5 Apr 2020 19:29:24 -0700 Subject: [PATCH 09/33] Added OpenSUSE support to install-deps and fixed a syntax error. --- install-deps.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install-deps.sh b/install-deps.sh index 8befd874f..38bf6c4e8 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -28,6 +28,10 @@ if [ $OS == "Linux" ]; then if [ -f "/etc/arch-release" ] || [ -f "/etc/manjaro-release" ]; then sudo pacman -S libogg libvorbis libmicrohttpd ffmpeg lame cmake ncurses boost pulseaudio libpulse alsa-lib curl libev taglib fi + if [ -f "/etc/SUSE-brand" ]; then + echo "detected SUSE" + sudo zypper install libcurl-devel libmicrohttpd-devel libboost_thread1_71_0-devel libboost_system1_71_0-devel libboost_filesystem1_71_0-devel libboost_date_time1_71_0-devel libboost_atomic1_71_0-devel libboost_chrono1_71_0-devel cmake ncurses-devel libogg-devel libvorbis-devel ffmpeg-3-libavcodec-devel ffmpeg-3-libswresample-devel ffmpeg-3-libavformat-devel ffmpeg-3-libavutil-devel libmp3lame-devel pulseaudio libpulse-devel alsa-devel zlib-devel libressl-devel libev-devel libtag-devel systemd-devel + fi fi if [ $OS == "Darwin" ]; then echo "detected macos" @@ -37,7 +41,7 @@ if [ $OS == "FreeBSD" ]; then echo "detected freebsd" pkg install boost-all curl libvorbis libogg libmicrohttpd ffmpeg alsa-lib cmake sndio libev taglib bash portsnap fetch - portsnap extract (if first time using ports) + portsnap extract cd /usr/ports/audio/lame make reinstall fi From 821b4de874f38531b33dd4e974abf47eab1f025c Mon Sep 17 00:00:00 2001 From: casey langen Date: Mon, 6 Apr 2020 23:35:58 -0700 Subject: [PATCH 10/33] Add a couple things required to support snap packges. --- CMakeLists.txt | 19 +++++++++++++++++++ src/musikcube/musikcube.snap | 3 +++ src/musikcubed/musikcubed.snap | 3 +++ 3 files changed, 25 insertions(+) create mode 100755 src/musikcube/musikcube.snap create mode 100755 src/musikcubed/musikcubed.snap diff --git a/CMakeLists.txt b/CMakeLists.txt index f04ac61d4..94fa60e41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -261,6 +261,25 @@ install( GROUP_EXECUTE GROUP_READ GROUP_WRITE WORLD_EXECUTE WORLD_READ) +# snap wrapper scripts, if applicable +if (${SNAP_ENABLED} MATCHES "true") + install( + FILES "${CMAKE_CURRENT_BINARY_DIR}src/musikcube/musikcube.snap" + DESTINATION share/musikcube.snap + PERMISSIONS + OWNER_EXECUTE OWNER_READ OWNER_WRITE + GROUP_EXECUTE GROUP_READ GROUP_WRITE + WORLD_EXECUTE WORLD_READ) + + install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/src/musikcubed/musikcubed.snap" + DESTINATION share/musikcubed.snap + PERMISSIONS + OWNER_EXECUTE OWNER_READ OWNER_WRITE + GROUP_EXECUTE GROUP_READ GROUP_WRITE + WORLD_EXECUTE WORLD_READ) +endif() + # executable and shell script for daemon install( FILES bin/musikcubed diff --git a/src/musikcube/musikcube.snap b/src/musikcube/musikcube.snap new file mode 100755 index 000000000..cf01f4391 --- /dev/null +++ b/src/musikcube/musikcube.snap @@ -0,0 +1,3 @@ +#!/bin/sh +set -eu +LANG=C.UTF-8 ./musikcube diff --git a/src/musikcubed/musikcubed.snap b/src/musikcubed/musikcubed.snap new file mode 100755 index 000000000..e2d59d414 --- /dev/null +++ b/src/musikcubed/musikcubed.snap @@ -0,0 +1,3 @@ +#!/bin/sh +set -eu +LANG=C.UTF-8 ./musikcubed From aa2ccdb0b282ff3d18c3d1f21aaecbf2c840384a Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 00:03:54 -0700 Subject: [PATCH 11/33] Support stripping binaries from out of tree builds --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 94fa60e41..1be55a38a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -368,5 +368,5 @@ add_custom_command(TARGET postbuild POST_BUILD COMMAND cmake .) # strip binaries in release mode if (CMAKE_BUILD_TYPE MATCHES Release) message(STATUS "stripping binaries...") - add_custom_command(TARGET postbuild POST_BUILD COMMAND ./strip-nix.sh) + add_custom_command(TARGET postbuild POST_BUILD COMMAND "${CMAKE_CURRENT_BINARY_DIR}/strip-nix.sh") endif() From 28e3ed18f83f6aa1978c3200932b3c161ba0bf81 Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 00:28:43 -0700 Subject: [PATCH 12/33] Ugh, fix incorrect path variable. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1be55a38a..e2b36742e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -368,5 +368,5 @@ add_custom_command(TARGET postbuild POST_BUILD COMMAND cmake .) # strip binaries in release mode if (CMAKE_BUILD_TYPE MATCHES Release) message(STATUS "stripping binaries...") - add_custom_command(TARGET postbuild POST_BUILD COMMAND "${CMAKE_CURRENT_BINARY_DIR}/strip-nix.sh") + add_custom_command(TARGET postbuild POST_BUILD COMMAND "${CMAKE_SOURCE_DIR}/strip-nix.sh") endif() From fac1364a000924dfbdb5339444e7469abaa67682 Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 00:38:39 -0700 Subject: [PATCH 13/33] Man this is annoying to test... --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2b36742e..01b4d0605 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -264,7 +264,7 @@ install( # snap wrapper scripts, if applicable if (${SNAP_ENABLED} MATCHES "true") install( - FILES "${CMAKE_CURRENT_BINARY_DIR}src/musikcube/musikcube.snap" + FILES "${CMAKE_CURRENT_BINARY_DIR}/src/musikcube/musikcube.snap" DESTINATION share/musikcube.snap PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE From 306c33a83c960a1f606017c8627296abefc8f9af Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 00:48:32 -0700 Subject: [PATCH 14/33] More snap-related cmake tweaks. --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01b4d0605..c9e7fc9ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -264,16 +264,16 @@ install( # snap wrapper scripts, if applicable if (${SNAP_ENABLED} MATCHES "true") install( - FILES "${CMAKE_CURRENT_BINARY_DIR}/src/musikcube/musikcube.snap" - DESTINATION share/musikcube.snap + FILES "${CMAKE_SOURCE_DIR}/src/musikcube/musikcube.snap" + DESTINATION share/ PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ GROUP_WRITE WORLD_EXECUTE WORLD_READ) install( - FILES "${CMAKE_CURRENT_BINARY_DIR}/src/musikcubed/musikcubed.snap" - DESTINATION share/musikcubed.snap + FILES "${CMAKE_SOURCE_DIR}/src/musikcubed/musikcubed.snap" + DESTINATION share/ PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ GROUP_WRITE From e2eb85d481466f334bd79cda53b7a6cf20c16e3b Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 01:03:12 -0700 Subject: [PATCH 15/33] Third time's a charm. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9e7fc9ad..a4ea6a3c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,7 +265,7 @@ install( if (${SNAP_ENABLED} MATCHES "true") install( FILES "${CMAKE_SOURCE_DIR}/src/musikcube/musikcube.snap" - DESTINATION share/ + DESTINATION share/musikcube/ PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ GROUP_WRITE @@ -273,7 +273,7 @@ if (${SNAP_ENABLED} MATCHES "true") install( FILES "${CMAKE_SOURCE_DIR}/src/musikcubed/musikcubed.snap" - DESTINATION share/ + DESTINATION share/musikcube/ PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ GROUP_WRITE From 688dafcdb48be7378654097563f39b4ab5b78b65 Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 09:22:09 -0700 Subject: [PATCH 16/33] Fixed .snap wrapper scripts... hopefully. --- src/musikcube/musikcube.snap | 5 +++-- src/musikcubed/musikcubed.snap | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/musikcube/musikcube.snap b/src/musikcube/musikcube.snap index cf01f4391..7d0578368 100755 --- a/src/musikcube/musikcube.snap +++ b/src/musikcube/musikcube.snap @@ -1,3 +1,4 @@ -#!/bin/sh +#!/bin/bash set -eu -LANG=C.UTF-8 ./musikcube +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +LANG=C.UTF-8 "${DIR}/musikcube" diff --git a/src/musikcubed/musikcubed.snap b/src/musikcubed/musikcubed.snap index e2d59d414..f9b78b1c8 100755 --- a/src/musikcubed/musikcubed.snap +++ b/src/musikcubed/musikcubed.snap @@ -1,3 +1,4 @@ -#!/bin/sh +#!/bin/bash set -eu -LANG=C.UTF-8 ./musikcubed +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +LANG=C.UTF-8 "${DIR}/musikcubed" "$@" From 1c974ca1412a08797c5e74c890686fb086ed1f96 Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 10:05:46 -0700 Subject: [PATCH 17/33] Added pulse environment variables to snap wrappers. --- src/musikcube/musikcube.snap | 2 +- src/musikcubed/musikcubed.snap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/musikcube/musikcube.snap b/src/musikcube/musikcube.snap index 7d0578368..b9c061911 100755 --- a/src/musikcube/musikcube.snap +++ b/src/musikcube/musikcube.snap @@ -1,4 +1,4 @@ #!/bin/bash set -eu DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -LANG=C.UTF-8 "${DIR}/musikcube" +PULSE_RUNTIME_PATH=/var/run/pulse PULSE_SYSTEM=1 LANG=C.UTF-8 "${DIR}/musikcube" diff --git a/src/musikcubed/musikcubed.snap b/src/musikcubed/musikcubed.snap index f9b78b1c8..e50960736 100755 --- a/src/musikcubed/musikcubed.snap +++ b/src/musikcubed/musikcubed.snap @@ -1,4 +1,4 @@ #!/bin/bash set -eu DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -LANG=C.UTF-8 "${DIR}/musikcubed" "$@" +PULSE_RUNTIME_PATH=/var/run/pulse PULSE_SYSTEM=1 LANG=C.UTF-8 "${DIR}/musikcubed" "$@" From 78054e77a0b75e182b1b3763e88b26babebe0834 Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 12:12:05 -0700 Subject: [PATCH 18/33] Revert "Added pulse environment variables to snap wrappers." This reverts commit 1c974ca1412a08797c5e74c890686fb086ed1f96. --- src/musikcube/musikcube.snap | 2 +- src/musikcubed/musikcubed.snap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/musikcube/musikcube.snap b/src/musikcube/musikcube.snap index b9c061911..7d0578368 100755 --- a/src/musikcube/musikcube.snap +++ b/src/musikcube/musikcube.snap @@ -1,4 +1,4 @@ #!/bin/bash set -eu DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -PULSE_RUNTIME_PATH=/var/run/pulse PULSE_SYSTEM=1 LANG=C.UTF-8 "${DIR}/musikcube" +LANG=C.UTF-8 "${DIR}/musikcube" diff --git a/src/musikcubed/musikcubed.snap b/src/musikcubed/musikcubed.snap index e50960736..f9b78b1c8 100755 --- a/src/musikcubed/musikcubed.snap +++ b/src/musikcubed/musikcubed.snap @@ -1,4 +1,4 @@ #!/bin/bash set -eu DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -PULSE_RUNTIME_PATH=/var/run/pulse PULSE_SYSTEM=1 LANG=C.UTF-8 "${DIR}/musikcubed" "$@" +LANG=C.UTF-8 "${DIR}/musikcubed" "$@" From 10f3bc43976942abef7ea59a89d94cb63a074af9 Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 15:33:26 -0700 Subject: [PATCH 19/33] Additional logging for PulseOut --- src/plugins/pulseout/PulseOut.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/plugins/pulseout/PulseOut.cpp b/src/plugins/pulseout/PulseOut.cpp index f2ad8d215..6f3ccb8dd 100755 --- a/src/plugins/pulseout/PulseOut.cpp +++ b/src/plugins/pulseout/PulseOut.cpp @@ -242,6 +242,7 @@ void PulseOut::OpenDevice(musik::core::sdk::IBuffer* buffer) { this->rate != buffer->SampleRate() || this->channels != buffer->Channels()) { + int errorCode = 0; this->CloseDevice(); pa_sample_spec spec; @@ -249,9 +250,8 @@ void PulseOut::OpenDevice(musik::core::sdk::IBuffer* buffer) { spec.channels = buffer->Channels(); spec.rate = buffer->SampleRate(); - std::cerr << "PulseOut: opening device\n"; - std::string deviceId = this->GetPreferredDeviceId(); + std::cerr << "PulseOut: opening device: " << deviceId << "\n"; /* output to preferred device id, as specified in prefs */ this->audioConnection = pa_blocking_new( @@ -263,7 +263,11 @@ void PulseOut::OpenDevice(musik::core::sdk::IBuffer* buffer) { &spec, nullptr, nullptr, - 0); + &errorCode); + + if (!this->audioConnection) { + std::cerr << "PulseOut: failed to open device. errorCode=" << errorCode << "\n"; + } if (!this->audioConnection && deviceId.size()) { /* fall back to default if preferred is not found */ @@ -276,7 +280,11 @@ void PulseOut::OpenDevice(musik::core::sdk::IBuffer* buffer) { &spec, nullptr, nullptr, - 0); + &errorCode); + + if (!this->audioConnection) { + std::cerr << "PulseOut: failed to open default device. errorCode=" << errorCode << "\n"; + } } if (this->audioConnection) { From 34020712c3ab9b96f302fcc116c617dc2eb346a1 Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 16:50:18 -0700 Subject: [PATCH 20/33] Revert "Revert "Added pulse environment variables to snap wrappers."" This reverts commit 78054e77a0b75e182b1b3763e88b26babebe0834. --- src/musikcube/musikcube.snap | 2 +- src/musikcubed/musikcubed.snap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/musikcube/musikcube.snap b/src/musikcube/musikcube.snap index 7d0578368..b9c061911 100755 --- a/src/musikcube/musikcube.snap +++ b/src/musikcube/musikcube.snap @@ -1,4 +1,4 @@ #!/bin/bash set -eu DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -LANG=C.UTF-8 "${DIR}/musikcube" +PULSE_RUNTIME_PATH=/var/run/pulse PULSE_SYSTEM=1 LANG=C.UTF-8 "${DIR}/musikcube" diff --git a/src/musikcubed/musikcubed.snap b/src/musikcubed/musikcubed.snap index f9b78b1c8..e50960736 100755 --- a/src/musikcubed/musikcubed.snap +++ b/src/musikcubed/musikcubed.snap @@ -1,4 +1,4 @@ #!/bin/bash set -eu DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -LANG=C.UTF-8 "${DIR}/musikcubed" "$@" +PULSE_RUNTIME_PATH=/var/run/pulse PULSE_SYSTEM=1 LANG=C.UTF-8 "${DIR}/musikcubed" "$@" From 743848e12c5fec503ca19d677727ad437524f42c Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 17:36:57 -0700 Subject: [PATCH 21/33] Revert "Revert "Revert "Added pulse environment variables to snap wrappers.""" This reverts commit 34020712c3ab9b96f302fcc116c617dc2eb346a1. --- src/musikcube/musikcube.snap | 2 +- src/musikcubed/musikcubed.snap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/musikcube/musikcube.snap b/src/musikcube/musikcube.snap index b9c061911..7d0578368 100755 --- a/src/musikcube/musikcube.snap +++ b/src/musikcube/musikcube.snap @@ -1,4 +1,4 @@ #!/bin/bash set -eu DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -PULSE_RUNTIME_PATH=/var/run/pulse PULSE_SYSTEM=1 LANG=C.UTF-8 "${DIR}/musikcube" +LANG=C.UTF-8 "${DIR}/musikcube" diff --git a/src/musikcubed/musikcubed.snap b/src/musikcubed/musikcubed.snap index e50960736..f9b78b1c8 100755 --- a/src/musikcubed/musikcubed.snap +++ b/src/musikcubed/musikcubed.snap @@ -1,4 +1,4 @@ #!/bin/bash set -eu DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -PULSE_RUNTIME_PATH=/var/run/pulse PULSE_SYSTEM=1 LANG=C.UTF-8 "${DIR}/musikcubed" "$@" +LANG=C.UTF-8 "${DIR}/musikcubed" "$@" From 816cafad5a50d4a063504e25a211160eb72a3d97 Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 19:42:27 -0700 Subject: [PATCH 22/33] Even more pulse debugging. --- src/plugins/pulseout/PulseOut.cpp | 2 +- src/plugins/pulseout/pulse_blocking_stream.c | 33 ++++++++++++++++---- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/plugins/pulseout/PulseOut.cpp b/src/plugins/pulseout/PulseOut.cpp index 6f3ccb8dd..4d011d518 100755 --- a/src/plugins/pulseout/PulseOut.cpp +++ b/src/plugins/pulseout/PulseOut.cpp @@ -251,7 +251,7 @@ void PulseOut::OpenDevice(musik::core::sdk::IBuffer* buffer) { spec.rate = buffer->SampleRate(); std::string deviceId = this->GetPreferredDeviceId(); - std::cerr << "PulseOut: opening device: " << deviceId << "\n"; + std::cerr << "PulseOut: opening device " << deviceId << "\n"; /* output to preferred device id, as specified in prefs */ this->audioConnection = pa_blocking_new( diff --git a/src/plugins/pulseout/pulse_blocking_stream.c b/src/plugins/pulseout/pulse_blocking_stream.c index c390d144c..396e572c9 100644 --- a/src/plugins/pulseout/pulse_blocking_stream.c +++ b/src/plugins/pulseout/pulse_blocking_stream.c @@ -158,10 +158,15 @@ pa_blocking* pa_blocking_new( pa_blocking *p; int error = PA_ERR_INTERNAL, r; + fprintf(stderr, "pulse_blocking_stream: CHECK_VALIDITY server\n"); CHECK_VALIDITY_RETURN_ANY(rerror, !server || *server, PA_ERR_INVALID, NULL); + fprintf(stderr, "pulse_blocking_stream: CHECK_VALIDITY dir\n"); CHECK_VALIDITY_RETURN_ANY(rerror, dir == PA_STREAM_PLAYBACK || dir == PA_STREAM_RECORD, PA_ERR_INVALID, NULL); + fprintf(stderr, "pulse_blocking_stream: CHECK_VALIDITY device\n"); CHECK_VALIDITY_RETURN_ANY(rerror, !dev || *dev, PA_ERR_INVALID, NULL); + fprintf(stderr, "pulse_blocking_stream: CHECK_VALIDITY spec\n"); CHECK_VALIDITY_RETURN_ANY(rerror, ss && pa_sample_spec_valid(ss), PA_ERR_INVALID, NULL); + fprintf(stderr, "pulse_blocking_stream: CHECK_VALIDITY channel map\n"); CHECK_VALIDITY_RETURN_ANY(rerror, !map || (pa_channel_map_valid(map) && map->channels == ss->channels), PA_ERR_INVALID, NULL) p = pa_xnew0(pa_blocking, 1); @@ -170,33 +175,43 @@ pa_blocking* pa_blocking_new( p->sink_id = -1; p->hw_volume = -1; - if (!(p->mainloop = pa_threaded_mainloop_new())) + if (!(p->mainloop = pa_threaded_mainloop_new())) { + fprintf(stderr, "pulse_blocking_stream: failed to create main loop\n"); goto fail; + } - if (!(p->context = pa_context_new(pa_threaded_mainloop_get_api(p->mainloop), name))) + if (!(p->context = pa_context_new(pa_threaded_mainloop_get_api(p->mainloop), name))) { + fprintf(stderr, "pulse_blocking_stream: failed to create context\n"); goto fail; + } pa_context_set_state_callback(p->context, context_state_cb, p); if (pa_context_connect(p->context, server, 0, NULL) < 0) { + fprintf(stderr, "pulse_blocking_stream: failed to connect context\n"); error = pa_context_errno(p->context); goto fail; } pa_threaded_mainloop_lock(p->mainloop); - if (pa_threaded_mainloop_start(p->mainloop) < 0) + if (pa_threaded_mainloop_start(p->mainloop) < 0) { + fprintf(stderr, "pulse_blocking_stream: failed to start main loop\n"); goto unlock_and_fail; + } for (;;) { pa_context_state_t state; state = pa_context_get_state(p->context); - if (state == PA_CONTEXT_READY) + if (state == PA_CONTEXT_READY) { + fprintf(stderr, "pulse_blocking_stream: context is ready\n"); break; + } if (!PA_CONTEXT_IS_GOOD(state)) { + fprintf(stderr, "pulse_blocking_stream: context is bad\n"); error = pa_context_errno(p->context); goto unlock_and_fail; } @@ -206,6 +221,7 @@ pa_blocking* pa_blocking_new( } if (!(p->stream = pa_stream_new(p->context, stream_name, ss, map))) { + fprintf(stderr, "pulse_blocking_stream: failed to create stream\n"); error = pa_context_errno(p->context); goto unlock_and_fail; } @@ -227,6 +243,7 @@ pa_blocking* pa_blocking_new( |PA_STREAM_AUTO_TIMING_UPDATE); if (r < 0) { + fprintf(stderr, "pulse_blocking_stream: failed to connect stream to output device\n"); error = pa_context_errno(p->context); goto unlock_and_fail; } @@ -236,10 +253,13 @@ pa_blocking* pa_blocking_new( state = pa_stream_get_state(p->stream); - if (state == PA_STREAM_READY) + if (state == PA_STREAM_READY) { + fprintf(stderr, "pulse_blocking_stream: stream is ready\n"); break; + } if (!PA_STREAM_IS_GOOD(state)) { + fprintf(stderr, "pulse_blocking_stream: stream is bad\n"); error = pa_context_errno(p->context); goto unlock_and_fail; } @@ -249,13 +269,14 @@ pa_blocking* pa_blocking_new( } pa_threaded_mainloop_unlock(p->mainloop); - + fflush(stderr); return p; unlock_and_fail: pa_threaded_mainloop_unlock(p->mainloop); fail: + fflush(stderr); if (rerror) *rerror = error; pa_blocking_free(p); From f58f5228a13f6fca93bfce9fa5ac236affad02ec Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 20:28:11 -0700 Subject: [PATCH 23/33] OK, I think I got to the bottom of the pulse issue. Yikes. --- src/musikcube/musikcube.snap | 3 ++- src/musikcubed/musikcubed.snap | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/musikcube/musikcube.snap b/src/musikcube/musikcube.snap index 7d0578368..c46cc7e74 100755 --- a/src/musikcube/musikcube.snap +++ b/src/musikcube/musikcube.snap @@ -1,4 +1,5 @@ #!/bin/bash set -eu DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -LANG=C.UTF-8 "${DIR}/musikcube" +PULSE_SOCKET="unix:/run/user/${UID}/pulse/native" +LANG=C.UTF-8 PULSE_SERVER=${PULSE_SOCKET} "${DIR}/musikcube" diff --git a/src/musikcubed/musikcubed.snap b/src/musikcubed/musikcubed.snap index f9b78b1c8..c5cd16566 100755 --- a/src/musikcubed/musikcubed.snap +++ b/src/musikcubed/musikcubed.snap @@ -1,4 +1,5 @@ #!/bin/bash set -eu DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -LANG=C.UTF-8 "${DIR}/musikcubed" "$@" +PULSE_SOCKET="unix:/run/user/${UID}/pulse/native" +LANG=C.UTF-8 PULSE_SERVER=${PULSE_SOCKET} "${DIR}/musikcubed" "$@" From 5cbdea7b1efdb9f83a702b7b291fc264782d2a6a Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 7 Apr 2020 21:33:08 -0700 Subject: [PATCH 24/33] Added preliminary snap file. --- snap/snapcraft.yaml | 83 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 snap/snapcraft.yaml diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 000000000..97ecd1d4f --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,83 @@ +name: musikcube # you probably want to 'snapcraft register ' +version: 0.85.0 +summary: a terminal-based music player, metadata indexer, and server +description: | + musikcube is a fully functional terminal-based music player, library, and + streaming audio server that runs natively on Windows, macOS, and Linux. It + also runs well on a Raspberry Pi with a custom DAC (e.g. IQaudIO DAC+, + HiFiBerry DAC+ and others), and can output 24bit/192k audio comfortably. +grade: stable # be 'stable' to release into candidate/stable channels +confinement: strict # use 'strict' once you have the right plugs and slots +base: core18 + +parts: + musikcube: + plugin: cmake + configflags: + - -DSNAP_ENABLED=true + - -DCMAKE_BUILD_TYPE=Release + source: https://github.com/clangen/musikcube.git + build-packages: + - build-essential + - clang + - cmake + - libboost-thread1.65-dev + - libboost-system1.65-dev + - libboost-filesystem1.65-dev + - libboost-date-time1.65-dev + - libboost-atomic1.65-dev + - libboost-chrono1.65-dev + - libogg-dev + - libvorbis-dev + - libavutil-dev + - libavformat-dev + - libswresample-dev + - libncursesw5-dev + - libasound2-dev + - libpulse-dev + - libmicrohttpd-dev + - libmp3lame-dev + - libcurl4-openssl-dev + - libev-dev + - libtag1-dev + - libsystemd-dev + - libssl-dev + stage-packages: + - libboost-thread1.65.1 + - libboost-system1.65.1 + - libboost-chrono1.65.1 + - libboost-filesystem1.65.1 + - libboost-date-time1.65.1 + - libmicrohttpd12 + - libcurl4 + - libogg0 + - libvorbis0a + - libvorbisfile3 + - libncursesw5 + - libasound2 + - libpulse0 + - libmp3lame0 + - libev4 + - libavcodec-extra + - libavutil55 + - libavformat57 + - libswresample2 + - libsystemd0 + - libtag1v5 + +apps: + musikcube: + command: share/musikcube/musikcube.snap + environment: + ALSA_CONFIG_PATH: /snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/alsa/alsa.conf + LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio + plugs: + - home + - removable-media + - pulseaudio + - network + - network-bind + - audio-playback + - alsa + slots: + - mpris From 0e6e96b58fe7671e878afc03d166a64a207cee63 Mon Sep 17 00:00:00 2001 From: casey langen Date: Wed, 8 Apr 2020 20:56:32 -0700 Subject: [PATCH 25/33] Yikes, found a pretty nasty race condition in AlsaOut. This should stabilize things. --- src/plugins/alsaout/AlsaOut.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/plugins/alsaout/AlsaOut.cpp b/src/plugins/alsaout/AlsaOut.cpp index 4cb6fbe03..60ee18a5f 100755 --- a/src/plugins/alsaout/AlsaOut.cpp +++ b/src/plugins/alsaout/AlsaOut.cpp @@ -165,6 +165,7 @@ AlsaOut::~AlsaOut() { } void AlsaOut::CloseDevice() { + LOCK("CloseDevice()"); if (this->pcmHandle) { std::cerr << "AlsaOut: closing PCM handle\n"; snd_pcm_close(this->pcmHandle); @@ -417,12 +418,17 @@ void AlsaOut::WriteLoop() { } } - WRITE_BUFFER(this->pcmHandle, next, samplesPerChannel); /* sets 'err' */ + { + LOCK("WRITE_BUFFER()"); + if (this->pcmHandle) { + WRITE_BUFFER(this->pcmHandle, next, samplesPerChannel); /* sets 'err' */ - if (err == -EINTR || err == -EPIPE || err == -ESTRPIPE) { - if (!snd_pcm_recover(this->pcmHandle, err, 1)) { - /* try one more time... */ - WRITE_BUFFER(this->pcmHandle, next, samplesPerChannel); + if (err == -EINTR || err == -EPIPE || err == -ESTRPIPE) { + if (!snd_pcm_recover(this->pcmHandle, err, 1)) { + /* try one more time... */ + WRITE_BUFFER(this->pcmHandle, next, samplesPerChannel); + } + } } } From 43962e86847f0263388a755008876449cce53883 Mon Sep 17 00:00:00 2001 From: casey langen Date: Wed, 8 Apr 2020 21:03:36 -0700 Subject: [PATCH 26/33] Fix AlsaOut in the snap package. --- snap/snapcraft.yaml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 97ecd1d4f..0f63c9624 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -13,6 +13,8 @@ base: core18 parts: musikcube: plugin: cmake + build-environment: + - CMAKE_BUILD_PARALLEL_LEVEL: "6" configflags: - -DSNAP_ENABLED=true - -DCMAKE_BUILD_TYPE=Release @@ -69,8 +71,8 @@ apps: musikcube: command: share/musikcube/musikcube.snap environment: - ALSA_CONFIG_PATH: /snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/alsa/alsa.conf LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio + ALSA_CONFIG_PATH: /snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/alsa/alsa.conf plugs: - home - removable-media @@ -81,3 +83,23 @@ apps: - alsa slots: - mpris + + musikcubed: + command: share/musikcube/musikcubed.snap + environment: + LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio + ALSA_CONFIG_PATH: /snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/alsa/alsa.conf + plugs: + - home + - removable-media + - pulseaudio + - network + - network-bind + - audio-playback + - alsa + slots: + - mpris + +layout: + /usr/share/alsa: + bind: $SNAP/usr/share/alsa From baeec9b81553a3529c7d2b72dfda37f3d17d86b6 Mon Sep 17 00:00:00 2001 From: casey langen Date: Thu, 9 Apr 2020 15:33:10 -0700 Subject: [PATCH 27/33] Added icon and desktop entry. --- CMakeLists.txt | 9 +++++++-- share/applications/musikcube.desktop | 13 +++++++++++++ share/icons/hicolor/48x48/apps/musikcube.png | Bin 0 -> 801 bytes .../linux/share/applications/musikcube.desktop | 13 +++++++++++++ .../share/icons/hicolor/48x48/apps/musikcube.png | Bin 0 -> 801 bytes 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 share/applications/musikcube.desktop create mode 100644 share/icons/hicolor/48x48/apps/musikcube.png create mode 100644 src/musikcube/data/linux/share/applications/musikcube.desktop create mode 100644 src/musikcube/data/linux/share/icons/hicolor/48x48/apps/musikcube.png diff --git a/CMakeLists.txt b/CMakeLists.txt index a4ea6a3c5..ab406e61f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,12 +237,17 @@ file(GLOB locales "src/musikcube/data/locales/*.json") file(COPY ${locales} DESTINATION bin/locales) install(FILES ${locales} DESTINATION share/musikcube/locales) +if (CMAKE_SYSTEM_NAME MATCHES "Linux") + file(GLOB_RECURSE linux_share "src/musikcube/data/linux/share/*") + install(FILES ${linux_share} DESTINATION share/) +endif() + # libmusikcore sshared library if (CMAKE_SYSTEM_NAME MATCHES "Darwin") install(FILES "bin/libmusikcore.dylib" DESTINATION share/musikcube) -else () +else() install(FILES "bin/libmusikcore.so" DESTINATION share/musikcube) -endif () +endif() # executable and shell script for musikcube install( diff --git a/share/applications/musikcube.desktop b/share/applications/musikcube.desktop new file mode 100644 index 000000000..651e030b9 --- /dev/null +++ b/share/applications/musikcube.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=musikcube +GenericName=musikcube +Comment=terminal-based music player +Exec=musikcube %U +TryExec=musikcube +Icon=musikcube +Terminal=true +Categories=AudioVideo;Player;Audio; +StartupNotify=false +StartupWMClass=musikcube diff --git a/share/icons/hicolor/48x48/apps/musikcube.png b/share/icons/hicolor/48x48/apps/musikcube.png new file mode 100644 index 0000000000000000000000000000000000000000..d8bd6fe42ba006ac00cfc3a2d068b8efb7e46512 GIT binary patch literal 801 zcmV++1K#|JP)h%Pkkm#SVl`1gO&c`|YC}6QD8+jRcfOL`XM)T9 z-tYT;e}4Dg9iTy%j@l1V6#vi^A{UlrI{-jOTS%*1yLf?RSsFTs5k>Lb|F$0i%>ZpQ z1GLc$(5CJ=K$AhQ9zzeh(Lcmsz-_|I(N)P9Y6dJe9o%Ck*zTKf+hN4LVH3I-`4i&G z42<}VuzO6n>txV3V8G3OgCgy!YGBZ-$I~}f+_D;)>Rl34UBq`B23TE;Z1MYhXT+LyW&~$#MDbT@;N-Z9;(7&Jg))}K1LPNuu)9`msm&`f zz{j^x$Q@ycFDu@*|r&STr3Pj~0 z6bgakI5->*lu9Lp!(p{`5kp+x1VMn^ZU@ivh{a;a<#KR3ooZ?$LiTeY6bc~{iNNi4 zBN~mWp-C39t5715Krk3YKA*?j+?*PkWI;RvwQA(|`w@vm;PH5{x+=X}R2!lZsP%d# zlflHqgepR~fEmMV4~*TNvf?BS_0m^>4>`_hOSM zr(y=UfEkZpThHzNulMRNjalN$5Jq?KaIzO&j1HxZ3ch|hKw_pyoL3P87Mre4e2vmZ z<sjIKbY|GEqr=^s6>i}C^Ch1*Q$8? zYz2>=+<>vW6F;|4@nL?a<h%Pkkm#SVl`1gO&c`|YC}6QD8+jRcfOL`XM)T9 z-tYT;e}4Dg9iTy%j@l1V6#vi^A{UlrI{-jOTS%*1yLf?RSsFTs5k>Lb|F$0i%>ZpQ z1GLc$(5CJ=K$AhQ9zzeh(Lcmsz-_|I(N)P9Y6dJe9o%Ck*zTKf+hN4LVH3I-`4i&G z42<}VuzO6n>txV3V8G3OgCgy!YGBZ-$I~}f+_D;)>Rl34UBq`B23TE;Z1MYhXT+LyW&~$#MDbT@;N-Z9;(7&Jg))}K1LPNuu)9`msm&`f zz{j^x$Q@ycFDu@*|r&STr3Pj~0 z6bgakI5->*lu9Lp!(p{`5kp+x1VMn^ZU@ivh{a;a<#KR3ooZ?$LiTeY6bc~{iNNi4 zBN~mWp-C39t5715Krk3YKA*?j+?*PkWI;RvwQA(|`w@vm;PH5{x+=X}R2!lZsP%d# zlflHqgepR~fEmMV4~*TNvf?BS_0m^>4>`_hOSM zr(y=UfEkZpThHzNulMRNjalN$5Jq?KaIzO&j1HxZ3ch|hKw_pyoL3P87Mre4e2vmZ z<sjIKbY|GEqr=^s6>i}C^Ch1*Q$8? zYz2>=+<>vW6F;|4@nL?a< Date: Thu, 9 Apr 2020 15:41:21 -0700 Subject: [PATCH 28/33] Fixed share paths. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab406e61f..181334652 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,8 +238,10 @@ file(COPY ${locales} DESTINATION bin/locales) install(FILES ${locales} DESTINATION share/musikcube/locales) if (CMAKE_SYSTEM_NAME MATCHES "Linux") - file(GLOB_RECURSE linux_share "src/musikcube/data/linux/share/*") - install(FILES ${linux_share} DESTINATION share/) + file(GLOB_RECURSE linux_share_applications "src/musikcube/data/linux/share/applications/*") + install(FILES ${linux_share_applications} DESTINATION share/applications/) + file(GLOB_RECURSE linux_share_icons_48 "src/musikcube/data/linux/share/icons/hicolor/48x48/apps/*") + install(FILES ${linux_share_icons_48} DESTINATION share/icons/hicolor/48x48/apps/) endif() # libmusikcore sshared library From adb3048a212a354168b4a6e5bda7840384b697b7 Mon Sep 17 00:00:00 2001 From: casey langen Date: Thu, 9 Apr 2020 16:36:58 -0700 Subject: [PATCH 29/33] These wrappers are no longer required because we can use `desktop-launch` to get all the correct environment variables set. --- src/musikcube/musikcube.snap | 5 ----- src/musikcubed/musikcubed.snap | 5 ----- 2 files changed, 10 deletions(-) delete mode 100755 src/musikcube/musikcube.snap delete mode 100755 src/musikcubed/musikcubed.snap diff --git a/src/musikcube/musikcube.snap b/src/musikcube/musikcube.snap deleted file mode 100755 index c46cc7e74..000000000 --- a/src/musikcube/musikcube.snap +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -eu -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -PULSE_SOCKET="unix:/run/user/${UID}/pulse/native" -LANG=C.UTF-8 PULSE_SERVER=${PULSE_SOCKET} "${DIR}/musikcube" diff --git a/src/musikcubed/musikcubed.snap b/src/musikcubed/musikcubed.snap deleted file mode 100755 index c5cd16566..000000000 --- a/src/musikcubed/musikcubed.snap +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -eu -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -PULSE_SOCKET="unix:/run/user/${UID}/pulse/native" -LANG=C.UTF-8 PULSE_SERVER=${PULSE_SOCKET} "${DIR}/musikcubed" "$@" From c95cb68ae4e0644f7f54c3a5e077be5c5f5f01a4 Mon Sep 17 00:00:00 2001 From: casey langen Date: Thu, 9 Apr 2020 16:54:03 -0700 Subject: [PATCH 30/33] Fix invalid handle issue in AlsaOut --- src/plugins/alsaout/AlsaOut.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/plugins/alsaout/AlsaOut.cpp b/src/plugins/alsaout/AlsaOut.cpp index 60ee18a5f..f1488c33f 100755 --- a/src/plugins/alsaout/AlsaOut.cpp +++ b/src/plugins/alsaout/AlsaOut.cpp @@ -499,20 +499,22 @@ void AlsaOut::SetFormat(IBuffer *buffer) { this->InitDevice(); - int err = snd_pcm_set_params( - this->pcmHandle, - PCM_FORMAT, - PCM_ACCESS_TYPE, - this->channels, - this->rate, - 1, /* allow resampling */ - 500000); /* 0.5s latency */ + if (this->pcmHandle) { + int err = snd_pcm_set_params( + this->pcmHandle, + PCM_FORMAT, + PCM_ACCESS_TYPE, + this->channels, + this->rate, + 1, /* allow resampling */ + 500000); /* 0.5s latency */ - if (err > 0) { - std::cerr << "AlsaOut: set format error: " << snd_strerror(err) << std::endl; - } - else { - this->SetVolume(this->volume); + if (err > 0) { + std::cerr << "AlsaOut: set format error: " << snd_strerror(err) << std::endl; + } + else { + this->SetVolume(this->volume); + } } std::cerr << "AlsaOut: device format initialized from buffer\n"; From 61c3cf808551246770ab13233b1269cbb42f3bfc Mon Sep 17 00:00:00 2001 From: casey langen Date: Thu, 9 Apr 2020 16:55:34 -0700 Subject: [PATCH 31/33] Added some seemingly unnecessary dependencies that seem to fix a couple weird issues. --- snap/snapcraft.yaml | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 0f63c9624..d8480e5e7 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -6,15 +6,24 @@ description: | streaming audio server that runs natively on Windows, macOS, and Linux. It also runs well on a Raspberry Pi with a custom DAC (e.g. IQaudIO DAC+, HiFiBerry DAC+ and others), and can output 24bit/192k audio comfortably. -grade: stable # be 'stable' to release into candidate/stable channels -confinement: strict # use 'strict' once you have the right plugs and slots +grade: stable +confinement: strict base: core18 parts: + desktop-glib-musikcube: + source: https://github.com/ubuntu/snapcraft-desktop-helpers.git + source-subdir: glib-only/ + plugin: make + build-packages: + - libglib2.0-dev + stage-packages: + - libglib2.0-bin + musikcube: + after: + - desktop-glib-musikcube plugin: cmake - build-environment: - - CMAKE_BUILD_PARALLEL_LEVEL: "6" configflags: - -DSNAP_ENABLED=true - -DCMAKE_BUILD_TYPE=Release @@ -69,26 +78,12 @@ parts: apps: musikcube: - command: share/musikcube/musikcube.snap - environment: - LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio - ALSA_CONFIG_PATH: /snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/alsa/alsa.conf - plugs: - - home - - removable-media - - pulseaudio - - network - - network-bind - - audio-playback - - alsa - slots: - - mpris - - musikcubed: - command: share/musikcube/musikcubed.snap + desktop: share/applications/musikcube.desktop + command: desktop-launch $SNAP/share/musikcube/musikcube environment: LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio ALSA_CONFIG_PATH: /snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/alsa/alsa.conf + LANG: C.UTF-8 plugs: - home - removable-media @@ -97,6 +92,10 @@ apps: - network-bind - audio-playback - alsa + - unity7 + - x11 + - desktop + - desktop-legacy slots: - mpris From 11d116276de5d74b057c434110c809bee4f1f21b Mon Sep 17 00:00:00 2001 From: casey langen Date: Thu, 9 Apr 2020 17:01:50 -0700 Subject: [PATCH 32/33] Cruft removal. No longer required! --- CMakeLists.txt | 19 ------------------- snap/snapcraft.yaml | 1 - 2 files changed, 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 181334652..84bfa7850 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -268,25 +268,6 @@ install( GROUP_EXECUTE GROUP_READ GROUP_WRITE WORLD_EXECUTE WORLD_READ) -# snap wrapper scripts, if applicable -if (${SNAP_ENABLED} MATCHES "true") - install( - FILES "${CMAKE_SOURCE_DIR}/src/musikcube/musikcube.snap" - DESTINATION share/musikcube/ - PERMISSIONS - OWNER_EXECUTE OWNER_READ OWNER_WRITE - GROUP_EXECUTE GROUP_READ GROUP_WRITE - WORLD_EXECUTE WORLD_READ) - - install( - FILES "${CMAKE_SOURCE_DIR}/src/musikcubed/musikcubed.snap" - DESTINATION share/musikcube/ - PERMISSIONS - OWNER_EXECUTE OWNER_READ OWNER_WRITE - GROUP_EXECUTE GROUP_READ GROUP_WRITE - WORLD_EXECUTE WORLD_READ) -endif() - # executable and shell script for daemon install( FILES bin/musikcubed diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index d8480e5e7..f3be549e9 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -25,7 +25,6 @@ parts: - desktop-glib-musikcube plugin: cmake configflags: - - -DSNAP_ENABLED=true - -DCMAKE_BUILD_TYPE=Release source: https://github.com/clangen/musikcube.git build-packages: From 8e769d2cabcc9947c39492cc994d5eea1b1f52a9 Mon Sep 17 00:00:00 2001 From: casey langen Date: Thu, 9 Apr 2020 18:39:57 -0700 Subject: [PATCH 33/33] More build fixes. --- .circleci/config.yml | 14 ++++++++++++++ CMakeLists.txt | 3 +++ snap/snapcraft.yaml | 3 --- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4f81bae91..67e342e2f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,6 +52,19 @@ jobs: - run: mkdir -p /root/debs && mv /root/project/*.deb /root/debs/ - store_artifacts: path: /root/debs/ + build_ubuntu_focal: + docker: + - image: ubuntu:focal + steps: + - checkout + - run: apt-get update + - run: apt-get install -y build-essential clang cmake libboost-thread1.71-dev libboost-system1.71-dev libboost-filesystem1.71-dev libboost-date-time1.71-dev libboost-atomic1.71-dev libboost-chrono1.71-dev libogg-dev libvorbis-dev libavutil-dev libavformat-dev libswresample-dev libncursesw5-dev libasound2-dev libpulse-dev pulseaudio libmicrohttpd-dev libmp3lame-dev libcurl4-openssl-dev libev-dev libssl-dev libtag1-dev libsystemd-dev + - run: cmake -DGENERATE_DEB=1 -DDEB_ARCHITECTURE=amd64 -DDEB_PLATFORM=ubuntu -DDEB_DISTRO=eoan -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release . + - run: make -j2 + - run: make package + - run: mkdir -p /root/debs && mv /root/project/*.deb /root/debs/ + - store_artifacts: + path: /root/debs/ build_fedora_26: docker: - image: fedora:26 @@ -126,6 +139,7 @@ workflows: - build_ubuntu_cosmic: *workflow_filters - build_ubuntu_disco: *workflow_filters - build_ubuntu_eoan: *workflow_filters + - build_ubuntu_focal: *workflow_filters - build_fedora_26: *workflow_filters - build_fedora_27: *workflow_filters - build_fedora_28: *workflow_filters diff --git a/CMakeLists.txt b/CMakeLists.txt index 84bfa7850..31a7bcfd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -314,6 +314,9 @@ if (GENERATE_DEB MATCHES "1") set(DEB_AVUTIL_VERSION "56") set(DEB_AVFORMAT_VERSION "58") set(DEB_SWRESAMPLE_VERSION "3") + elseif (DEB_DISTRO MATCHES "focal") + set(DEB_BOOST_VERSION "1.71.0") + set(DEB_MICROHTTPD_VERSION "12") elseif (DEB_DISTRO MATCHES "xenial") set(DEB_BOOST_VERSION "1.58.0") set(DEB_MICROHTTPD_VERSION "10") diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index f3be549e9..0b146129e 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -91,10 +91,7 @@ apps: - network-bind - audio-playback - alsa - - unity7 - - x11 - desktop - - desktop-legacy slots: - mpris