From ee30ad5d4b5588394aa9458badd3f6e20b9a9648 Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Sun, 3 Jul 2022 04:43:22 -0400 Subject: [PATCH] Update Configuring.md Updated for ALSA --- docs/Configuring.md | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/docs/Configuring.md b/docs/Configuring.md index 0246517..b150e27 100644 --- a/docs/Configuring.md +++ b/docs/Configuring.md @@ -48,13 +48,33 @@ If you already have another web server on port 80, see [*How to Change the Web S Once connected, select the Settings menu item on the Hamburger menu at the top left corner of the display. Click on Audio Device Settings to select and configure the audio device you want to use. -
- IMPORTANT NOTE: If you are using a USB audio device, you MUSTMUST set the sample rate to 48,000 - in order to acheive reasonable latency on Linux. For other devices, you probably want to use 2 buffers. -
- You may also need to choose which audio input and output channels you will use for guitar signals, once you have selected and configured -an audio device. Most external USB audio devices that have two inputs provide the guitar signal on the right channel only, so you will set the audio input chanels to "Right Only". If your USB audio adapter has more than two input or output channels, you will be offered a list of channels to choose from. +an audio device. Many external USB audio devices that have two inputs provide the guitar signal on the right channel only, so you will set the audio input chanels to "Right Only". If your USB audio adapter has more than two input or output channels, you will be offered a list of channels to choose from. + +#### Selecting Audio Buffer Sizes + +You may have to experiment to find the buffer size, and buffer count that works best for your. The actual round-trip latency and frequency of audio overruns and underruns depends the the operating system system version, the audio hardware being used, and upon CPU use of the audio patches you are using. Selecting larger buffer sizes or larger buffer counts increase the amount of computing power available for your audio effects, and will reduce the number of dropouts caused by audio overruns/underruns (xruns); smaller buffer sizes and buffer counts improve the overall round-trip latency but will increase the likelihood of xruns. + +Please note that the Raspberry Pi OS is not completely robust with respect to realtime scheduling. Significant display activity, SD-CARD activity or heavy CPU use by programs other than PiPedal may cause audio xruns. For best results, run PiPedal without a display attached, and with no other programs running. Connecting remotely to the PiPedal web interface should not cause problems. + +PiPedal provides the pipedal_latency_test utility to measure actual round-trip audio latency. You must temporarily disable pipedal (`sudo systemctl stop pipedal`), and connect the left audio output of your audio device to the left audio input of your audio device with a guitar cable to use this test. + +The following table shows measured round-trip audio latencies for a MOTU M2 external USB adapter running on Raspbery Pi OS. You can use these figures as a rough guideline; but actual round-trip audio latency will depend on the audio device you are using. + + + + + + + + + + +
Buffers
Size234
16No signal185/3.9ms201/4.2ms
24192/4.0ms213/4.4ms236/4.9ms
32219/4.6ms236/4.9ms272/5.7ms
48253/5.3ms299/6.2ms348/7.2ms
64280/5.8ms346/7.2ms411/8.6ms
128442/9.2ms571/11.9ms699/14.6ms
+ +LINUX Kernel version 5.16 includes fixes to ALSA audio that are supposed to dramatically improve USB audio latency. As of July 2022, these fixes have not yet made it into Raspberry Pi OS, but are probably available on non-LTS versions of Ubuntu. + +PiPedal uses the ALSA audio stack; so (unlike Jack Audio) there is no performance penalty for using 44100Hz sample rates. However, using a 48000Hz sampling rates does provide significant improvements in high-frequency audio quality when performing digital audio signal processing. ### Activating the P2P (Wi-Fi Direct) Hotspot