envgen does not work with Linux?
@bobpell You can check in /etc/security for limits.conf or limits.d/, grep limits.conf/the files in limits.d/ for audio, grep audio limits.conf
or grep audio limits.d/*
, you should have
@audio - rtprio 95
@audio - memlock unlimited
If you have them but the settings for rtpro or memlock are different, than change them to 95 and unlimited. If you do not have anything for audio then if you have limits.conf, add the lines, if you have limits.d/ then add the file audio.conf
with those lines and restart. If you do have those or adding them does not work than it is a quirk of LinuxMint and you will have to ask in a LinuxMint forum how to set it up or wait for someone more familiar with LinuxMint to show up. LinuxMint is Ubuntu based so this should already be setup and just adding your user to the audio group should work, but LinuxMint may have decided to change this and you will need to ask people well versed in the distro or do some searching to find what you need to do. One thing you can do is install the Ubuntu Studio package, but that is a great deal of software so somewhat overkill.
Edit: looks like I missed an update and duplicated a response, either of our numbers will work. Regarding the niceness line, from what I understand that is a hold over from bygone days and not needed on modern systems, does not hurt to have it but it does not actually accomplish anything.
Raspberry Pi Bluetooth Speaker not showing up in Audio preferences
@eulphean said:
I'm using pure data on a raspberry pi 3+ for a project. I have bluetooth configured properly on it. I can send regular audio to bluetooth speaker connected, but the preferences -> audio in PureData doesn't show the bluetooth speaker. It only shows internal audio card or if I have a USB audio card, that shows too. But no bluetooth device.
How do I configure that? Do I need to use jack or something to route audio to bluetooth for Pd?
My experience with Bluetooth audio in Linux has been:
-
JACK has zero tolerance for the audio driver ever being late -- expect crashes or system lockups if you try to route audio from JACK to Bluetooth. That is, just don't.
-
PulseAudio's support for BT audio is pretty good -- the "regular audio" that you spoke of. Audio production apps typically bypass PulseAudio, in which case BT audio may simply not be supported for them. That is, I expect you'd hit the same problem with SuperCollider, Audacity, Ardour, VCV Rack etc etc etc.
I'm not aware of a solution... That's not to say that there absolutely isn't one, but the Linux audio space is not unified as it is in Mac so audio device support may not be universal.
hjh
Raspberry Pi Audio Output Crackling when Mic enabled
Hello,
I have a USB audio interface (3D Sound Audio Interface see below) plugged into a raspberry pi. When I have it selected for audio input (port audio seems to be the only one that works) along with audio output via the speaker on the GPIO pins I get crackling as if PD can't handle the processing of audio input while outputting on raspberry pi. NOTE: if I turn off audio input the output sounds perfect.
Anyone else encounter this issue?
FYI, I hooked up a nice little speaker to make the Raspberry Pi more portable via the I2S Amp on connected and powered by the GPIO pins (see this link for details
delete object using dynamic patching?
@raynovich I use [switch~] to pause audio playback of a file here...... cart_wav_simple.pd
The audio is muted in 5ms with [line] and at 8ms the audio processing for the patch is turned off.
Other patches will still have their audio running.
Taking the audio output to zero before turning audio off avoids clicks.
A 1 into switch turns audio on and a 0 turns it off.
When it is off there is no cpu load for the patch as there is no audio process running (for that patch).
David.
banging [switch~] performs audio computations offline!
According to block~ help, if you bang [switch~] it runs one block of DSP computations, which is useful for performing computations that are more easily expressed as audio processing. Something I read (which I can't find now) left me with the impression that it runs faster than normal audio computations, i.e. as if it were in control domain. Here are some tests that confirm it, I think: switch~ bang how fast.pd
The key to this test is that all of the bangs sequenced by [t b b b b] run in the same gap between audio block computations. When [switch~] is banged, [osc~] fills array1, but you can see that element 63 of array1 changes after [switch~] is banged. Furthermore, no logical time has elapsed. So it appears that one block of audio processing has occurred between normal audio blocks. [bang~] outputs when that accelerated audio block processing is complete.
This next test takes things further and bangs [switch~] 10 times at control rate. Still, no logical time elapses, and [bang~] only outputs when all 10 bangs of [switch~] are complete. [rzero_rev~ 0] is just an arcane way of delaying by one sample, so this patch rotates the contents of array1 10 samples to the right. switch~ bang how fast2.pd
(There are better ways to rotate a table than this, but I just needed something to test with. Plus I never pass up a chance to use [rzero_rev~ 0] )
Finally, I've seen some code that sends a 1 to [switch~] and then sends 0 after one block of processing. In this test you can see that one block of audio is processed in one block of logical time, i.e. the normal way. switch~ bang how fast3.pd
But that second test suggests how you could embed arbitrary offline audio processing in a patch that's not being run with Pd's -batch flag or fast-forwarded with the fast-forward message introduced in Pd 0.51-1. Maybe it's an answer to two questions I've seen posted here: Offline analysis on a song and Insant pitch shift. Here's a patch that writes 20s of 440 Hz to a file as fast as possible (adapted from @solipp's patch for the first topic). You just compute how many blocks you need and bang away. write440File.zip
Here's another that computes the real FFT of an audio file as fast as possible: loadFFT.zip
But as with any control rate processing, if you try to do too much this way, Pd will fall behind in normal audio processing and stutter (e.g. listen to the output while running that last patch on a >1 minute file). So no free lunch, just a little subsidy.
s~/r~ throw~/catch~ latency and object creation order
I searched through many of the s~/r~ throw~/catch~ hops in my own code for mistakes based on what I've learned, and it looks like ~50% of all my non-local audio connections carry modulation signals that originate from control rate objects, so those aren't affected much. Only a few programs would have been broken had the non-local connections not matched, but because things were created in signal-flow order where it mattered, there was a consistent (and often unnecessary) 1 block delay everywhere. Many of those patches were later converted to use tabsend~/tabreceive~ under a small block size, and a few were converted to use delay lines. I was burned by the creation order side effect of delwrite~/delread~ once, but it wouldn't have happened had I not taken a lazy shortcut. Hilariously, I also found one test patch that I used to declare definitively, once and for all, that s~/r~ always introduces a 1 block delay if the sort order isn't controlled using the G05 technique. To paraphrase Agent K in the movie Men in Black, imagine what I'll "know" tomorrow!
So as a practical issue, I doubt coders are getting tripped up by this frequently. If you're like me you tend to code in signal flow order, and so you are mostly just introducing latency unnecessarily. RE advice, I agree with @Nicolas-Danet: use local audio connections wherever it matters and never mind the clutter. Even my worst spider web isn't so bad. Subpatches and abstractions can help hide the mess.
But when things are broken and showtime is looming, you'd be foolish not to use what you know, especially when you can always go back after curtain calls and adjust things to satisfy the style police. Here is a summary of the sort rules as best as I've been able to figure them out so far:
- A patch orders its constituent audio subpatches and abstractions, but has no influence over their internal ordering. Consequently, these rules are applied starting at the top level patch and recurse into each subpatch and abstraction.
- Audio chain tributaries and independent audio chains are executed in reverse order of their head's creation, except for those created by [clone], which are executed in the order of their creation (i.e. ascending clone index order).
- Audio branches that start from fanout connections are executed in reverse order of their start connection's creation.
- Whenever the rules conflict, the rule that places the tilde object the latest in line takes precidence.
These sort rules can affect your patch because unless s~ and throw~ buffer their data before their corresponding r~ and catch~ are executed, the latter will have to wait a block to access it. Delread~ will have a minimum 1 block delay.
Finally, I thought of this technique if you're absolutely certain you are going to get burned (or are just paranoid): wrap all s~, r~, throw~, catch~, delwrite~, delread~, and audio chain heads in their own subpatches. I noticed that if you modify the contents of a subpatch, it doesn't change its sort order in the containing patch, so you can add test code (e.g. [sig~ <uniqueNr>]->[tabsend~ <sharedArray>]) to subpatch pairs and check their execution order without changing it. If the order is wrong, then you cut and repaste the appropriate subpatches or audio connections according to the rules above until it isn't. That should take 15 mins, not days.
Pd for Windows with Jack support ?
@jyg What do you want Jack to do for you?
Pd asks the OS for a list of audio drivers and their "pins" at startup..... audio connections in and out..... so you can then select the ones you want to use in the audiosettings menu.
If you want low latency and/or to use multiple devices then Asio4All is a good driver...... http://www.asio4all.org/
It will give you the same function as "aggregate device" on osx.
If you want to pass audio between applications then you can use virtual audio cables.... https://vb-audio.com/Cable/
They and Asio4All will all appear in the audiosettings menu (select asio first) and you can route your audio where you wish.
If you choose to use Asio4All as the driver then you will also see the virtual cables in its window.
You can then route Pd audio anywhere you wish using [adc~ x] and [dac~ x]
David.
Pd for audio processing on low-end hardware
Hi all,
I recently dug out an old Eeepc 701 4G from Asus that I bought second-hand in 2008 - 1-core Intel Celeron inside, with 4GB RAM. I have an audio interface Roland UA22 so that the setup can support realtime audio (Debian 10, RT kernel, jack with RT) with no XRuns and latency <10ms at 44100Hz/128/3. However, obviously, as soon as the CPU is expected to do some calculation, it is much less fun!
In particular I want to use a sampler for some instruments, typically a drumkit connected to MIDI pads, so I wrote a small no-gui Pd patch to load one single wav file in each of 16 clones (for 16 pads) responding to 16 midi notes. I want to keep them in separate clones so that I can assign them to different audio output. Right now it is quite CPU intensive, so I will have to add [switch~] and volume ramps to turn on dsp processing only when the midi note is played and hopefully without clicks.
Further in the workflow, Non-Mixer and Non-Timeline work great for a few tracks, but if I try to record several tracks for several of the drums audio outputs at the same time then the poor laptop is struggling.
TL;DR: Long story short, I'm considering using less fancy mixer and audio sequencer, i.e. command line or Pd patches with no or very basic GUI (no live GUI update as I record for example), BUT I would like to be able to occasionally use some audio effects (reverb, delay and such). Before I get into that, do you guys think that such solution would be bearable for the brave eeepc? Would other languages be more efficient than Pd on this machine?
Or (this is not the right place to ask, but I try anyway) do you know terminal-based utilities that could fulfill this otherwise? I'm thinking of a ncurses mixer similar to alsamixer, or an audio sequencer in the style of CuSE, which would be awesome.
Thanks!
Crackled Audio from PD on Raspberry Pi 4
@nicnut said:
I don't know if this helps, but sometimes the audio output level will make the audio sound bad. I have a RPi 4 and I am using a soundcard with a seperate audio output volume knob. And I use the alsamixer.
At first I turned everything up as much as possible. It sounded terrible and sometimes no audio came out. Now I have alsa mixer at about 60% and my soundcard at 80%. I control the volume from my amp and faders in Pd. It sounds way better.
If you are using the 8th inch jack out of the Pi something related to this could be an issue.
@EEight said:
@nicnut A dedicated soundcard is the way to go AFAIK. Also using jack and controlling the buffer (if you don't need low latency then use a big buffer like 1024).
I plugged in a USB audio dongle, and it seemed to stop the crackling but I still get the following audio dropouts
more info on how to set up jack or alsa would be appreciated
[4] error: audio I/O dropout
loading cached help index from ~/.purr-data/search.index
finished loading help index (0.20 secs)
[4] error: audio I/O dropout
Crackled Audio from PD on Raspberry Pi 4
I'm running a Raspberry Pi 4 with "Raspberry Pi OS (32-bit) Lite [August 2020 / 2020-08-20 / Kernel 5.4]" headless and the latest version of Purr-Data, set up the Raspberry using this guide , did the Alsa no audio (glitch) issue Pi 4
fix to get audio working through the 3.5 mm jack.
I'm interfacing the Raspberry Pi through the macOS terminal and with VNC Viewer through ethernet.
I get the following error as soon a starting Purr-Data,
error: audio I/O stuck... closing audio
I open up a patch and turn off and turn on the DSP signals and get the following error
error: audio I/O stuck... closing audio error: audio I/O dropout
Even though if I play sample .wav or bang a sinewave, the audio does get played but it gets glitchy as in the audio sound is crackled.
has anyone experienced it before? any knowledge on how to overcome it?