Add authbind dependency.
Fix crash when number of input channels < number of output channels.
Add onboarding dialog for initial configuration.
This commit is contained in:
Robin Davies
2022-10-11 14:50:08 -04:00
parent 6f6f33573b
commit 77e3b64736
14 changed files with 221 additions and 131 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.16.0)
project(pipedal
VERSION 1.0.15
VERSION 1.0.16
DESCRIPTION "PiPedal Guitar Effect Pedal For Raspberry Pi"
HOMEPAGE_URL "https://rerdavies.github.io/pipedal"
)
set (DISPLAY_VERSION "v1.0.15")
set (DISPLAY_VERSION "v1.0.16")
set (CMAKE_INSTALL_PREFIX "/usr/")
@@ -86,7 +86,7 @@ set(CPACK_DEBIAN_PACKAGE_SECTION sound)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
#set(CPACK_DEBIAN_PACKAGE_DEPENDS "jackd2, hostapd, dnsmasq" )
set(CPACK_DEBIAN_PACKAGE_DEPENDS "hostapd, dnsmasq" )
set(CPACK_DEBIAN_PACKAGE_DEPENDS "hostapd, dnsmasq authbind" )
#set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
set(CPACK_PACKAGING_INSTALL_PREFIX /usr)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
+1 -1
View File
@@ -1,7 +1,7 @@
<img src='docs/GithubBanner.png' width="100%" />
Download: <a href='docs/download.md'>v1.0.15</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Website: [https://rerdavies.github.io/pipedal](https://rerdavies.github.io/pipedal).
Download: <a href='docs/download.md'>v1.0.16</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Website: [https://rerdavies.github.io/pipedal](https://rerdavies.github.io/pipedal).
Use your Raspberry Pi as a guitar effects pedal. Configure and control PiPedal with your phone or tablet.
+1 -1
View File
@@ -9,6 +9,6 @@ Package: pipedal
Pre-Depends: hostapd;authbind
Priority: optional
Section: sound
Version: 1.0.15
Version: 1.0.16
Installed-Size: 15147
+2 -2
View File
@@ -13,14 +13,14 @@ page_icon: img/Install4.jpg
Download the most recent Debian (.deb) package for your platform:
- [Ubuntu/Raspberry Pi OS (64-bit) v1.0.15](https://github.com/rerdavies/pipedal/releases/download/v1.0.15/pipedal_1.0.15_arm64.deb)
- [Ubuntu/Raspberry Pi OS (64-bit) v1.0.16](https://github.com/rerdavies/pipedal/releases/download/v1.0.16/pipedal_1.0.16_arm64.deb)
Install the package by running
```
sudo apt update
cd ~/Downloads
sudo dpkg --install pipedal_1.0.15_arm64.deb
sudo dpkg --install pipedal_1.0.16_arm64.deb
```
On Raspberry Pi OS, if you have a graphical desktop installed, you can also install the package by double-clicking on the downloaded package in the File Manager.
+1 -1
View File
@@ -3,6 +3,6 @@
<img src="{{page.page_icon}}" style="width: 100%;background: #FFF; z-index: -1;
float: right" />
<div>
<p style="font-size: 10px; text-align: right;color: #888">Generated by DALL-E</p>
<p style="font-size: 10px; text-align: right;color: #888">Generated by DALL-E 2</p>
</div>
</div>
+1 -1
View File
@@ -2,6 +2,6 @@
<img src="{{page.page_icon}}" style="width: 100%;background: #FFF; z-index: -1;
float: right" />
<div>
<p style="font-size: 10px; text-align: right; color: #888">Generated by DALL-E</p>
<p style="font-size: 10px; text-align: right; color: #888">Generated by DALL-E 2</p>
</div>
</div>
+2 -2
View File
@@ -4,14 +4,14 @@
Download the most recent Debian (.deb) package for your platform:
- [Ubuntu or Raspberry Pi OS (64-bit)](https://github.com/rerdavies/pipedal/releases/download/v1.0.15/pipedal_1.0.15_arm64.deb) v1.0.15
- [Ubuntu or Raspberry Pi OS (64-bit)](https://github.com/rerdavies/pipedal/releases/download/v1.0.16/pipedal_1.0.16_arm64.deb) v1.0.16
Install the package by running
```
sudo apt update
cd ~/Downloads
sudo apt-get install ./pipedal_1.0.15_arm64.deb
sudo apt-get install ./pipedal_1.0.16_arm64.deb
```
Follow the instructions in [_Configuring PiPedal After Installation_](https://rerdavies.github.io/pipedal/Configuring.html) to complete the installation.
+1 -1
View File
@@ -1,7 +1,7 @@
<img src="GithubBanner.png" width="100%"/>
<a href="Installing.html"><i>v1.0.15</i></a>
<a href="Installing.html"><i>v1.0.16</i></a>
Use your Raspberry Pi as a guitar effects pedal. Configure and control PiPedal with your phone or tablet.
+33 -3
View File
@@ -249,6 +249,7 @@ type AppState = {
alertDialogOpen: boolean;
alertDialogMessage: string;
isSettingsDialogOpen: boolean;
onboarding: boolean;
isDebug: boolean;
renameBankDialogOpen: boolean;
@@ -301,6 +302,7 @@ const AppThemed = withStyles(appStyles)(class extends ResizeResponsiveComponent<
alertDialogMessage: "",
presetName: this.model_.presets.get().getSelectedText(),
isSettingsDialogOpen: false,
onboarding: false,
isDebug: true,
presetChanged: this.model_.presets.get().presetChanged,
banks: this.model_.banks.get(),
@@ -383,13 +385,24 @@ const AppThemed = withStyles(appStyles)(class extends ResizeResponsiveComponent<
}
handleSettingsDialogClose() {
this.setState({
isSettingsDialogOpen: false
isSettingsDialogOpen: false,
onboarding: false
});
}
handleDrawerSettingsClick() {
this.setState({
isDrawerOpen: false,
isSettingsDialogOpen: true
isSettingsDialogOpen: true,
onboarding: false
});
}
handDisplayOnboarding() {
this.setState({
isDrawerOpen: false,
isSettingsDialogOpen: true,
onboarding: true
});
}
@@ -561,6 +574,9 @@ const AppThemed = withStyles(appStyles)(class extends ResizeResponsiveComponent<
setErrorMessage(message: string): void {
this.setState({ errorMessage: message });
}
onboardingShown: boolean = false;
setDisplayState(newState: State): void {
this.updateOverscroll();
@@ -568,6 +584,17 @@ const AppThemed = withStyles(appStyles)(class extends ResizeResponsiveComponent<
displayState: newState,
canFullScreen: supportsFullScreen() && !this.model_.isAndroidHosted()
});
if (newState == State.Ready)
{
if (!this.onboardingShown)
{
this.onboardingShown = true;
if (!this.model_.hasConfiguration())
{
this.handDisplayOnboarding();
}
}
}
}
showDrawer() {
@@ -778,7 +805,10 @@ const AppThemed = withStyles(appStyles)(class extends ResizeResponsiveComponent<
</main>
<BankDialog show={this.state.bankDialogOpen} isEditDialog={this.state.editBankDialogOpen} onDialogClose={() => this.setState({ bankDialogOpen: false })} />
<AboutDialog open={this.state.aboutDialogOpen} onClose={() => this.setState({ aboutDialogOpen: false })} />
<SettingsDialog open={this.state.isSettingsDialogOpen} onClose={() => this.handleSettingsDialogClose()} />
<SettingsDialog
open={this.state.isSettingsDialogOpen}
onboarding={this.state.onboarding}
onClose={() => this.handleSettingsDialogClose()} />
<RenameDialog
open={this.state.renameBankDialogOpen || this.state.saveBankAsDialogOpen}
defaultName={this.model_.banks.get().getSelectedEntryName()}
+6
View File
@@ -451,6 +451,8 @@ export interface PiPedalModel {
showAndroidDonationActivity(): void;
getAndroidHostVersion(): string;
chooseNewDevice(): void;
hasConfiguration(): boolean;
};
class PiPedalModelImpl implements PiPedalModel {
@@ -2315,7 +2317,11 @@ class PiPedalModelImpl implements PiPedalModel {
if (this.androidHost) {
return this.androidHost.chooseNewDevice();
}
}
hasConfiguration(): boolean {
var jackConfig = this.jackConfiguration.get();
return jackConfig.isValid;
}
};
+143 -96
View File
@@ -26,6 +26,7 @@ import Typography from '@mui/material/Typography';
import { PiPedalModel, PiPedalModelFactory, State } from './PiPedalModel';
import ButtonBase from "@mui/material/ButtonBase";
import AppBar from '@mui/material/AppBar';
import Button from '@mui/material/Button';
import Toolbar from '@mui/material/Toolbar';
import ArrowBackIcon from '@mui/icons-material//ArrowBack';
import JackConfiguration, { JackChannelSelection } from './Jack';
@@ -42,7 +43,7 @@ import WifiConfigDialog from './WifiConfigDialog';
import WifiDirectConfigDialog from './WifiDirectConfigDialog';
import DialogEx from './DialogEx'
import GovernorSettings from './GovernorSettings';
import {AlsaMidiDeviceInfo} from './AlsaMidiDeviceInfo';
import { AlsaMidiDeviceInfo } from './AlsaMidiDeviceInfo';
import Slide, { SlideProps } from '@mui/material/Slide';
import { createStyles, Theme } from '@mui/material/styles';
@@ -52,6 +53,7 @@ import { WithStyles, withStyles } from '@mui/styles';
interface SettingsDialogProps extends WithStyles<typeof styles> {
open: boolean;
onboarding: boolean;
onClose: () => void;
@@ -65,6 +67,7 @@ interface SettingsDialogState {
jackServerSettings: JackServerSettings;
jackStatus?: JackHostStatus;
governorSettings: GovernorSettings;
continueDisabled: boolean;
wifiConfigSettings: WifiConfigSettings;
wifiDirectConfigSettings: WifiDirectConfigSettings;
@@ -167,6 +170,7 @@ const SettingsDialog = withStyles(styles, { withTheme: true })(
wifiConfigSettings: this.model.wifiConfigSettings.get(),
wifiDirectConfigSettings: this.model.wifiDirectConfigSettings.get(),
governorSettings: this.model.governorSettings.get(),
continueDisabled: true,
showWifiConfigDialog: false,
showWifiDirectConfigDialog: false,
showGovernorSettingsDialog: false,
@@ -270,7 +274,8 @@ const SettingsDialog = withStyles(styles, { withTheme: true })(
}
handleJackServerSettingsChanged(): void {
this.setState({
jackServerSettings: this.model.jackServerSettings.get()
jackServerSettings: this.model.jackServerSettings.get(),
continueDisabled: !this.model.jackServerSettings.get().valid
});
}
@@ -498,15 +503,30 @@ const SettingsDialog = withStyles(styles, { withTheme: true })(
<div style={{ display: "flex", flexDirection: "column", flexWrap: "nowrap", width: "100%", height: "100%", overflow: "hidden" }}>
<div style={{ flex: "0 0 auto" }}>
<AppBar className={classes.dialogAppBar} >
<Toolbar>
<IconButton edge="start" color="inherit" onClick={this.handleDialogClose} aria-label="back"
>
<ArrowBackIcon />
</IconButton>
<Typography variant="h6" className={classes.dialogTitle}>
Settings
</Typography>
</Toolbar>
{
this.props.onboarding ?
(
<Toolbar>
<Typography variant="h6" className={classes.dialogTitle}>
Initial Configuration
</Typography>
</Toolbar>
)
:
(
<Toolbar>
<IconButton edge="start" color="inherit" onClick={this.handleDialogClose} aria-label="back"
>
<ArrowBackIcon />
</IconButton>
<Typography variant="h6" className={classes.dialogTitle}>
Settings
</Typography>
</Toolbar>
)
}
</AppBar>
</div>
<div style={{
@@ -515,23 +535,39 @@ const SettingsDialog = withStyles(styles, { withTheme: true })(
}}
>
<div >
<Typography className={classes.sectionHead} display="block" variant="caption" color="secondary">
STATUS
</Typography>
{(!isConfigValid) ?
(
<div style={{ paddingLeft: 48, position: "relative", top: -12 }}>
<Typography display="block" variant="caption" color="textSecondary">Status: <span style={{ color: "#F00" }}>Not configured.</span></Typography>
<Typography display="block" variant="caption" color="textSecondary">Governor: </Typography>
</div>
) :
(
<div style={{ paddingLeft: 48, position: "relative", top: -12 }}>
{JackHostStatus.getDisplayView("", this.state.jackStatus)}
{JackHostStatus.getCpuInfo("Governor:\u00A0", this.state.jackStatus)}
</div>
)
}
{this.props.onboarding ?
(
<div>
<Typography display="block" variant="caption" color="textSecondary" style={{paddingLeft: 24,paddingBottom: 8 }}>
Select and configure an audio device. You may optionally configure MIDI inputs, and set up a Wi-Fi Direct Hotspot now as well.
</Typography>
<Typography display="block" variant="caption" color="textSecondary" style={{paddingLeft: 24,paddingBottom: 8 }}>
Access and modify these settings later by selecting the <i>Settings</i> menu item on the main menu.
</Typography>
</div>
):
(
<div>
<Typography className={classes.sectionHead} display="block" variant="caption" color="secondary">
STATUS
</Typography>
{(!isConfigValid) ?
(
<div style={{ paddingLeft: 48, position: "relative", top: -12 }}>
<Typography display="block" variant="caption" color="textSecondary">Status: <span style={{ color: "#F00" }}>Not configured.</span></Typography>
<Typography display="block" variant="caption" color="textSecondary">Governor: </Typography>
</div>
) :
(
<div style={{ paddingLeft: 48, position: "relative", top: -12 }}>
{JackHostStatus.getDisplayView("", this.state.jackStatus)}
{JackHostStatus.getCpuInfo("Governor:\u00A0", this.state.jackStatus)}
</div>
)
}
</div>
)}
{this.state.jackConfiguration.errorState !== "" &&
(
@@ -650,79 +686,90 @@ const SettingsDialog = withStyles(styles, { withTheme: true })(
</div>
</ButtonBase>
</div>
<Divider />
<div >
<Typography className={classes.sectionHead} display="block" variant="caption" color="secondary">SYSTEM</Typography>
{ (!this.props.onboarding) ? (
<div >
<Divider />
<Typography className={classes.sectionHead} display="block" variant="caption" color="secondary">SYSTEM</Typography>
<ButtonBase
style={{ display: "none" }}
className={classes.setting} disabled={!this.state.wifiConfigSettings.valid}
onClick={() => this.handleShowGovernorSettingsDialogDialog()} >
<SelectHoverBackground selected={false} showHover={true} />
<div style={{ width: "100%" }}>
<Typography className={classes.primaryItem} display="block" variant="body2" color="textPrimary" noWrap>
CPU Governor</Typography>
<Typography display="block" variant="caption" noWrap color="textSecondary">
{this.state.governorSettings.governor}
</Typography>
</div>
</ButtonBase>
<ButtonBase
className={classes.setting}
onClick={() => { this.setState({ showStatusMonitorDialog: true }); }} >
<SelectHoverBackground selected={false} showHover={true} />
<div style={{ width: "100%" }}>
<div style={{
width: "100%", display: "flex", flexDirection: "row", flexWrap: "nowrap",
alignItems: "center", maxWidth: 400
}}>
<div style={{ flex: "1 1 auto" }}>
<Typography className={classes.primaryItem} display="block" variant="body2" color="textPrimary" noWrap>
Show status monitor on main screen.</Typography>
</div>
<div style={{ flex: "0 0 auto" }}>
<Switch
checked={this.state.showStatusMonitor}
onChange={
(e) => { this.model.setShowStatusMonitor(e.target.checked); }
}
/>
</div>
<ButtonBase
style={{ display: "none" }}
className={classes.setting} disabled={!this.state.wifiConfigSettings.valid}
onClick={() => this.handleShowGovernorSettingsDialogDialog()} >
<SelectHoverBackground selected={false} showHover={true} />
<div style={{ width: "100%" }}>
<Typography className={classes.primaryItem} display="block" variant="body2" color="textPrimary" noWrap>
CPU Governor</Typography>
<Typography display="block" variant="caption" noWrap color="textSecondary">
{this.state.governorSettings.governor}
</Typography>
</div>
</div>
</ButtonBase>
</ButtonBase>
<ButtonBase className={classes.setting} disabled={disableShutdown}
onClick={() => this.handleRestart()} >
<SelectHoverBackground selected={false} showHover={true} />
<div style={{ width: "100%" }}>
{
this.state.restarting ? (
<Typography className={classes.primaryItem} display="block" variant="body2" color="textSecondary" noWrap>Rebooting...</Typography>
) : (
<Typography className={classes.primaryItem} display="block" variant="body2" noWrap>Reboot PiPedal</Typography>
)
}
</div>
</ButtonBase>
<ButtonBase
className={classes.setting}
onClick={() => { this.setState({ showStatusMonitorDialog: true }); }} >
<SelectHoverBackground selected={false} showHover={true} />
<div style={{ width: "100%" }}>
<div style={{
width: "100%", display: "flex", flexDirection: "row", flexWrap: "nowrap",
alignItems: "center", maxWidth: 400
}}>
<div style={{ flex: "1 1 auto" }}>
<Typography className={classes.primaryItem} display="block" variant="body2" color="textPrimary" noWrap>
Show status monitor on main screen.</Typography>
</div>
<div style={{ flex: "0 0 auto" }}>
<Switch
checked={this.state.showStatusMonitor}
onChange={
(e) => { this.model.setShowStatusMonitor(e.target.checked); }
}
/>
</div>
<ButtonBase className={classes.setting} disabled={disableShutdown}
onClick={() => this.handleShutdown()} >
<SelectHoverBackground selected={false} showHover={true} />
<div style={{ width: "100%" }}>
{
this.state.shuttingDown ? (
<Typography className={classes.primaryItem} display="block" variant="body2" color="textSecondary" noWrap>Shutting down...</Typography>
) : (
<Typography className={classes.primaryItem} display="block" variant="body2" noWrap>Shut down</Typography>
)
}
</div >
</ButtonBase>
</div>
</div>
</div>
</ButtonBase>
<ButtonBase className={classes.setting} disabled={disableShutdown}
onClick={() => this.handleRestart()} >
<SelectHoverBackground selected={false} showHover={true} />
<div style={{ width: "100%" }}>
{
this.state.restarting ? (
<Typography className={classes.primaryItem} display="block" variant="body2" color="textSecondary" noWrap>Rebooting...</Typography>
) : (
<Typography className={classes.primaryItem} display="block" variant="body2" noWrap>Reboot PiPedal</Typography>
)
}
</div>
</ButtonBase>
<ButtonBase className={classes.setting} disabled={disableShutdown}
onClick={() => this.handleShutdown()} >
<SelectHoverBackground selected={false} showHover={true} />
<div style={{ width: "100%" }}>
{
this.state.shuttingDown ? (
<Typography className={classes.primaryItem} display="block" variant="body2" color="textSecondary" noWrap>Shutting down...</Typography>
) : (
<Typography className={classes.primaryItem} display="block" variant="body2" noWrap>Shut down</Typography>
)
}
</div >
</ButtonBase>
</div>
): (
<div>
<Divider/>
<div style={{display: "grid", placeContent: "end", maxWidth: 550, marginLeft: 16,marginRight: 16,
marginTop: 16,marginBottom: 16}}>
<Button variant="outlined" disabled={this.state.continueDisabled} style={{width: 120}}>Continue</Button>
</div>
</div>
)
}
+12 -9
View File
@@ -37,6 +37,7 @@
#include "Lv2Log.hpp"
#include <limits>
#include "ss.hpp"
#undef ALSADRIVER_CONFIG_DBG
@@ -184,7 +185,7 @@ namespace pipedal
private:
void OnShutdown()
{
Lv2Log::info("Jack Audio Server has shut down.");
Lv2Log::info("ALSA Audio Server has shut down.");
}
static void
@@ -1091,9 +1092,10 @@ namespace pipedal
int sourceIndex = IndexFromPortName(x);
if (sourceIndex >= captureBuffers.size())
{
throw PiPedalArgumentException("Invalid input port.");
Lv2Log::error(SS("Invalid audio input port: " << x));
} else {
this->activeCaptureBuffers[ix++] = this->captureBuffers[sourceIndex];
}
this->activeCaptureBuffers[ix++] = this->captureBuffers[sourceIndex];
}
this->activePlaybackBuffers.resize(channelSelection.GetOutputAudioPorts().size());
@@ -1104,9 +1106,10 @@ namespace pipedal
int sourceIndex = IndexFromPortName(x);
if (sourceIndex >= playbackBuffers.size())
{
throw PiPedalArgumentException("Invalid output port.");
Lv2Log::error(SS("Invalid audio output port: " << x));
} else {
this->activePlaybackBuffers[ix++] = this->playbackBuffers[sourceIndex];
}
this->activePlaybackBuffers[ix++] = this->playbackBuffers[sourceIndex];
}
audioThread = new std::jthread([this]()
@@ -1598,15 +1601,15 @@ namespace pipedal
}
inputAudioPorts.clear();
for (unsigned int i = 0; i < playbackChannels; ++i)
for (unsigned int i = 0; i < captureChannels; ++i)
{
inputAudioPorts.push_back(SS("system::playback_" << i));
inputAudioPorts.push_back(SS("system::capture_" << i));
}
outputAudioPorts.clear();
for (unsigned int i = 0; i < captureChannels; ++i)
for (unsigned int i = 0; i < playbackChannels; ++i)
{
outputAudioPorts.push_back(SS("system::capture_" << i));
outputAudioPorts.push_back(SS("system::playback_" << i));
}
result = true;
+4 -4
View File
@@ -122,10 +122,10 @@ void EnableService()
void DisableService()
{
#if INSTALL_JACK_SERVICE || UNINSTALL_JACK_SERVICE
if (sysExec(SYSTEMCTL_BIN " disable " JACK_SERVICE ".service") != EXIT_SUCCESS)
if (silentSysExec(SYSTEMCTL_BIN " disable " JACK_SERVICE ".service") != EXIT_SUCCESS)
{
#if INSTALL_JACK_SERVICE
cout << "Error: Failed to disable the " JACK_SERVICE " service.";
// cout << "Error: Failed to disable the " JACK_SERVICE " service.";
#endif
}
#endif
@@ -165,10 +165,10 @@ void StopService(bool excludeShutdownService = false)
#endif
}
#if INSTALL_JACK_SERVICE || UNINSTALL_JACK_SERVICE
if (sysExec(SYSTEMCTL_BIN " stop " JACK_SERVICE ".service") != EXIT_SUCCESS)
if (silentSysExec(SYSTEMCTL_BIN " stop " JACK_SERVICE ".service") != EXIT_SUCCESS)
{
#if INSTALL_JACK_SERVICE
cout << PiPedalException("Failed to stop the " JACK_SERVICE " service.");
// cout << PiPedalException("Failed to stop the " JACK_SERVICE " service.");
#endif
}
#endif
+11 -7
View File
@@ -227,14 +227,18 @@ void PiPedalModel::Load()
try
{
jackHost->Open(this->jackServerSettings, selection);
std::shared_ptr<Lv2PedalBoard> lv2PedalBoard{this->lv2Host.CreateLv2PedalBoard(this->pedalBoard)};
this->lv2PedalBoard = lv2PedalBoard;
jackHost->SetPedalBoard(lv2PedalBoard);
}
catch (PiPedalException &e)
try {
std::shared_ptr<Lv2PedalBoard> lv2PedalBoard{this->lv2Host.CreateLv2PedalBoard(this->pedalBoard)};
this->lv2PedalBoard = lv2PedalBoard;
jackHost->SetPedalBoard(lv2PedalBoard);
}
catch (const std::exception &e)
{
Lv2Log::error("Failed to load initial plugin. (%s)", e.what());
}
} catch (std::exception &e)
{
Lv2Log::error("Failed to load initial plugin. (%s)", e.what());
Lv2Log::error("Failed to start audio device. %s", e.what());
}
}
else