v1.0.21 release

- Performance improvements, TooB Convolution Reverb, Cab IR.
- Bug fix:CabIR  Impulses #2 and #3 load wrong file.
- Bug fix: Android client upload file extensions
This commit is contained in:
Robin Davies
2023-04-24 10:57:02 -04:00
parent 6bbc87be46
commit a8a1d2da36
17 changed files with 519 additions and 566 deletions
-20
View File
@@ -71,26 +71,6 @@ namespace pipedal
static const char *LV2_MIDI_PLUGIN = "http://lv2plug.in/ns/lv2core#MIDIPlugin";
// static const char *LV2_AUDIO_PORT = P_LV2_CORE_URI "AudioPort";
// static const char *LV2_PLUGIN = P_LV2_CORE_URI "Plugin";
// static const char *LV2_CONTROL_PORT = P_LV2_CORE_URI "ControlPort";
// static const char *LV2_INPUT_PORT = P_LV2_CORE_URI "InputPort";
// static const char *LV2_OUTPUT_PORT = P_LV2_CORE_URI "OutputPort";
// static const char *LV2_INTEGER = P_LV2_CORE_URI "integer";
// static const char *LV2_ENUMERATION = P_LV2_CORE_URI "enumeration";
// static const char *LV2_PORT_LOGARITHMIC = P_LV2_PPROPS "logarithmic";
// static const char *LV2_PORT_RANGE_STEPS = P_LV2_PPROPS "rangeSteps";
// static const char *LV2_PORT_TRIGGER = P_LV2_PPROPS "trigger";
// static const char *LV2_PORT_DISPLAY_PRIORITY = P_LV2_PPROPS "displayPriority";
// static const char *LV2_ATOM_PORT = "http://lv2plug.in/ns/ext/atom#AtomPort";
// static const char *LV2_ATOM_SEQUENCE = "http://lv2plug.in/ns/ext/atom#Sequence";
// static const char *LV2_ATOM_SOUND = "http://lv2plug.in/ns/ext/atom#Sound";
// static const char *LV2_ATOM_VECTOR = "http://lv2plug.in/ns/ext/atom#Vector";
// static const char *LV2_ATOM_STRING = "http://lv2plug.in/ns/ext/atom#String";
// static const char *LV2_MIDI_EVENT = "http://lv2plug.in/ns/ext/midi#MidiEvent";
// static const char *LV2_DESIGNATION = "http://lv2plug.in/ns/lv2core#Designation";
class PluginHost::Urids
{
+143 -148
View File
@@ -28,7 +28,6 @@
#include "SysExec.hpp"
#include "WriteTemplateFile.hpp"
using namespace pipedal;
using namespace std;
@@ -42,23 +41,22 @@ using namespace std;
#define SYSTEMCTL_BIN "/usr/bin/systemctl"
static char DNSMASQ_APD_PATH[] = "/etc/dnsmasq.d/30-pipedal-apd.conf";
static char DNSMASQ_P2P_SOURCE_PATH[] = "/etc/pipedal/config/templates/30-pipedal-p2p.conf";
static char DNSMASQ_P2P_PATH[] = "/etc/dnsmasq.d/30-pipedal-p2p.conf";
static bool IsApdInstalled() {
static bool IsApdInstalled()
{
return std::filesystem::exists(DNSMASQ_APD_PATH);
}
static bool IsP2pInstalled() {
static bool IsP2pInstalled()
{
return std::filesystem::exists(DNSMASQ_P2P_PATH);
}
static void restoreApdDhcpdConfFile()
{
// remove the interface wlan0 section.
@@ -135,7 +133,6 @@ static void restoreP2pDhcpdConfFile()
}
}
static void restoreApdDnsmasqConfFile()
{
std::filesystem::path path(DNSMASQ_APD_PATH);
@@ -155,21 +152,20 @@ static void restoreP2pDnsmasqConfFile()
static void UninstallHostApd()
{
if (IsApdInstalled())
{
sysExec(SYSTEMCTL_BIN " stop hostapd");
sysExec(SYSTEMCTL_BIN " disable hostapd");
sysExec(SYSTEMCTL_BIN " stop dnsmasq");
sysExec(SYSTEMCTL_BIN " disable dnsmasq");
if (IsApdInstalled())
{
sysExec(SYSTEMCTL_BIN " stop hostapd");
sysExec(SYSTEMCTL_BIN " disable hostapd");
sysExec(SYSTEMCTL_BIN " stop dnsmasq");
sysExec(SYSTEMCTL_BIN " disable dnsmasq");
restoreApdDhcpdConfFile();
restoreApdDnsmasqConfFile();
sysExec(SYSTEMCTL_BIN " unmask wpa_supplicant"); // TODO: Do we need this now we have no_hook line.
sysExec(SYSTEMCTL_BIN " enable wpa_supplicant");
sysExec(SYSTEMCTL_BIN " start wpa_supplicant");
}
restoreApdDhcpdConfFile();
restoreApdDnsmasqConfFile();
sysExec(SYSTEMCTL_BIN " unmask wpa_supplicant"); // TODO: Do we need this now we have no_hook line.
sysExec(SYSTEMCTL_BIN " enable wpa_supplicant");
sysExec(SYSTEMCTL_BIN " start wpa_supplicant");
}
}
static void UninstallP2p();
@@ -327,29 +323,28 @@ void pipedal::SetWifiConfig(const WifiConfigSettings &settings)
sysExec("rfkill unblock wlan");
sysExec(SYSTEMCTL_BIN " daemon-reload");
// sysExec(SYSTEMCTL_BIN " mask wpa_supplicant");
// sysExec(SYSTEMCTL_BIN " mask wpa_supplicant");
sysExec(SYSTEMCTL_BIN " stop wpa_supplicant");
sysExec(SYSTEMCTL_BIN " unmask hostapd");
if (sysExec(SYSTEMCTL_BIN " restart hostapd") != 0)
{
throw PiPedalException("Unable to start the access point.");
}
if (sysExec("systemctl is-active --quiet hostapd") != 0)
{
throw PiPedalException("Unable to start the access point.");
}
sysExec(SYSTEMCTL_BIN " enable hostapd");
// sysExec(SYSTEMCTL_BIN " unmask hostapd");
// if (sysExec(SYSTEMCTL_BIN " restart hostapd") != 0)
// {
// throw PiPedalException("Unable to start the access point.");
// }
// if (sysExec("systemctl is-active --quiet hostapd") != 0)
// {
// throw PiPedalException("Unable to start the access point.");
// }
// sysExec(SYSTEMCTL_BIN " enable hostapd");
sysExec(SYSTEMCTL_BIN " stop wpa_supplicant");
// sysExec(SYSTEMCTL_BIN " mask wpa_supplicant");
// sysExec(SYSTEMCTL_BIN " mask wpa_supplicant");
sysExec(SYSTEMCTL_BIN " restart dnsmasq");
sysExec(SYSTEMCTL_BIN " enable dnsmasq");
}
}
/*********************************************************************************
p2p configuration:
@@ -359,9 +354,9 @@ dnsmaqsq.d/30-pipedal-p2p.conf:
interface=p2p-wlan0-0
dhcp-range=p2p-wlan0,173.24.0.3,172.23.0.127,1h
domain=local
address=/pipedal.local/172.23.0.2
domain=local
address=/pipedal.local/172.23.0.2
except-interface=eth0
except-interface=wlan0
except-interface=lo
@@ -376,7 +371,6 @@ interface p2p-wlan0-0
Watch resolv.conf to make sure we don't lose DNS servers.
************************************************************************************/
void UninstallP2p()
{
if (IsP2pInstalled())
@@ -390,141 +384,143 @@ void UninstallP2p()
restoreP2pDhcpdConfFile();
restoreP2pDnsmasqConfFile();
sysExec(SYSTEMCTL_BIN " restart dhcpcd");
WifiDirectConfigSettings wifiDirectConfigSettings;
wifiDirectConfigSettings.Load();
wifiDirectConfigSettings.enable_ = false;
wifiDirectConfigSettings.Save();
}
}
void pipedal::SetWifiDirectConfig(const WifiDirectConfigSettings &settings)
{
char band;
if (!settings.enable_)
try
{
cout << "Disabling P2P" << endl;
UninstallP2p();
ServiceConfiguration deviceIdFile;
deviceIdFile.Load();
deviceIdFile.deviceName = settings.hotspotName_;
deviceIdFile.Save();
// Announce new mDNS service with potentially new deviceName.
sysExec(SYSTEMCTL_BIN " restart pipedald");
}
else
{
settings.Save();
// ******************* device_uuid
ServiceConfiguration deviceIdFile;
deviceIdFile.Load();
deviceIdFile.deviceName = settings.hotspotName_;
deviceIdFile.Save();
// ******************** dsnmasq ******
std::filesystem::remove(DNSMASQ_P2P_PATH);
std::filesystem::copy_file(DNSMASQ_P2P_SOURCE_PATH, DNSMASQ_P2P_PATH);
// ****** dhcpd.conf ***/
std::filesystem::path dhcpcdConfig("/etc/dhcpcd.conf");
if (std::filesystem::exists(dhcpcdConfig))
char band;
if (!settings.enable_)
{
SystemConfigFile dhcpcd(dhcpcdConfig);
cout << "Disabling P2P" << endl;
UninstallP2p();
// dhcpcd.conf:
// ======
// interface p2p-wlan0-0
// static ip_address=172.24.0.1/24
// domain_name_server=172.24.0.1
ServiceConfiguration deviceIdFile;
deviceIdFile.Load();
deviceIdFile.deviceName = settings.hotspotName_;
deviceIdFile.Save();
// Announce new mDNS service with potentially new deviceName.
sysExec(SYSTEMCTL_BIN " restart pipedald");
}
else
{
cout << "Enabling P2P" << endl;
int line = dhcpcd.GetLineThatStartsWith("hostname");
std::string hostNameLine;
if (false)
{
// hostNameLine = "hostname " + settings.mdnsName_;
}
else
{
hostNameLine = "hostname"; // the default value.
}
if (line != -1)
{
dhcpcd.SetLineValue(line, hostNameLine);
}
else
{
dhcpcd.AppendLine(hostNameLine);
}
settings.Save();
// ******************* device_uuid
// erase any existing interface for p2p-wlan0-0
line = dhcpcd.GetLineNumber("interface p2p-wlan0-0");
if (line != -1)
ServiceConfiguration deviceIdFile;
deviceIdFile.Load();
deviceIdFile.deviceName = settings.hotspotName_;
deviceIdFile.Save();
// ******************** dsnmasq ******
std::filesystem::remove(DNSMASQ_P2P_PATH);
std::filesystem::copy_file(DNSMASQ_P2P_SOURCE_PATH, DNSMASQ_P2P_PATH);
// ****** dhcpd.conf ***/
std::filesystem::path dhcpcdConfig("/etc/dhcpcd.conf");
if (std::filesystem::exists(dhcpcdConfig))
{
dhcpcd.EraseLine(line);
while (line < dhcpcd.GetLineCount())
cout << "Updating /etc/dhcpcd.conf" << endl;
SystemConfigFile dhcpcd(dhcpcdConfig);
// dhcpcd.conf:
// ======
// interface p2p-wlan0-0
// static ip_address=172.24.0.1/24
// domain_name_server=172.24.0.1
int line = dhcpcd.GetLineThatStartsWith("hostname");
std::string hostNameLine;
if (false)
{
const std::string &lineValue = dhcpcd.GetLineValue(line);
if (lineValue.length() > 0 && (lineValue[0] == ' ' || lineValue[0] == '\t'))
// hostNameLine = "hostname " + settings.mdnsName_;
}
else
{
hostNameLine = "hostname"; // the default value.
}
if (line != -1)
{
dhcpcd.SetLineValue(line, hostNameLine);
}
else
{
dhcpcd.AppendLine(hostNameLine);
}
// erase any existing interface for p2p-wlan0-0
line = dhcpcd.GetLineNumber("interface p2p-wlan0-0");
if (line != -1)
{
dhcpcd.EraseLine(line);
while (line < dhcpcd.GetLineCount())
{
dhcpcd.EraseLine(line);
}
else
{
break;
const std::string &lineValue = dhcpcd.GetLineValue(line);
if (lineValue.length() > 0 && (lineValue[0] == ' ' || lineValue[0] == '\t'))
{
dhcpcd.EraseLine(line);
}
else
{
break;
}
}
}
if (line == -1)
{
dhcpcd.AppendLine("");
line = dhcpcd.GetLineCount();
}
// interface p2p-wlan0-0
// static ip_address=172.24.0.1/16 (trying int on .1.)
// domain_name_server=172.24.0.1
dhcpcd.InsertLine(line++, "interface p2p-wlan0-0");
dhcpcd.InsertLine(line++, " static ip_address=" P2P_INTERFACE_ADDR);
dhcpcd.InsertLine(line++, " nohook wpa_supplicant");
// dhcpcd.InsertLine(line++, " domain_name_servers=" P2P_IP_ADDRESS);
dhcpcd.Save(dhcpcdConfig);
}
if (line == -1)
// **************** start services ************
cout << "Starting P2P services." << endl;
sysExec("rfkill unblock wlan");
sysExec(SYSTEMCTL_BIN " daemon-reload");
sysExec(SYSTEMCTL_BIN " stop pipedal_p2pd");
sysExec(SYSTEMCTL_BIN " restart dhcpcd");
sysExec(SYSTEMCTL_BIN " start wpa_supplicant");
sysExec(SYSTEMCTL_BIN " enable wpa_supplicant"); // ?? Not sure that's still right. :-/
sysExec(SYSTEMCTL_BIN " start dnsmasq");
sysExec(SYSTEMCTL_BIN " enable dnsmasq");
sysExec(SYSTEMCTL_BIN " start pipedal_p2pd");
if (sysExec(SYSTEMCTL_BIN " start pipedal_p2pd") != 0)
{
dhcpcd.AppendLine("");
line = dhcpcd.GetLineCount();
throw PiPedalException("Unable to start the Wi-Fi Direct access point.");
}
// interface p2p-wlan0-0
// static ip_address=172.24.0.1/16 (trying int on .1.)
// domain_name_server=172.24.0.1
dhcpcd.InsertLine(line++, "interface p2p-wlan0-0");
dhcpcd.InsertLine(line++, " static ip_address=" P2P_INTERFACE_ADDR);
dhcpcd.InsertLine(line++, " nohook wpa_supplicant");
//dhcpcd.InsertLine(line++, " domain_name_servers=" P2P_IP_ADDRESS);
dhcpcd.Save(dhcpcdConfig);
sysExec(SYSTEMCTL_BIN " enable pipedal_p2pd");
sysExec(SYSTEMCTL_BIN " restart pipedald");
}
// **************** start services ************
cout << "Starting services." << endl;
sysExec("rfkill unblock wlan");
sysExec(SYSTEMCTL_BIN " daemon-reload");
sysExec(SYSTEMCTL_BIN " stop pipedal_p2pd");
sysExec(SYSTEMCTL_BIN " restart dhcpcd");
sysExec(SYSTEMCTL_BIN " start wpa_supplicant");
sysExec(SYSTEMCTL_BIN " enable wpa_supplicant"); // ?? Not sure that's still right. :-/
sysExec(SYSTEMCTL_BIN " start dnsmasq");
sysExec(SYSTEMCTL_BIN " enable dnsmasq");
sysExec(SYSTEMCTL_BIN " start pipedal_p2pd");
if (sysExec(SYSTEMCTL_BIN " start pipedal_p2pd") != 0)
{
throw PiPedalException("Unable to start the Wi-Fi Direct access point.");
}
sysExec(SYSTEMCTL_BIN " enable pipedal_p2pd");
sysExec(SYSTEMCTL_BIN " restart pipedald");
}
catch (const std::exception &e)
{
cout << e.what() << endl;
}
}
@@ -534,11 +530,11 @@ void pipedal::OnWifiUninstall()
if (IsApdInstalled())
{
UninstallHostApd();
} else if (IsP2pInstalled())
}
else if (IsP2pInstalled())
{
UninstallP2p();
}
}
void pipedal::OnWifiInstallComplete()
{
@@ -551,5 +547,4 @@ void pipedal::OnWifiInstallComplete()
// {
// sysExec(SYSTEMCTL_BIN " daemon-reload");
// }
}
+3 -1
View File
@@ -825,11 +825,13 @@ int main(int argc, char *argv[])
}
}
Lv2Log::info("Shutting down gracefully.");
Lv2Log::info("Closing audio session.");
model.Close();
Lv2Log::info("Stopping web server.");
server->ShutDown(5000);
server->Join();
Lv2Log::info("Shutdown complete.");
}
catch (const std::exception &e)
-24
View File
@@ -1,24 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2022 Robin E. R. Davies
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-1
View File
@@ -3,7 +3,6 @@ Description=${DESCRIPTION}
After=network.target
After=sound.target
After=local-fs.target
After=avahi-daemon