Pd crashes at startup (after working fine for days)
Hey,
Since today I have strange crashes on Windows 7 64bit.
Either pd.exe or pd.com crashes when executed.
I had Pd-extended 0.43.4 installed and it worked for days without problem. Today I've tried to load a .pd which I worked on at another computer (same version): pd.com crashed. I've tried to start Pd normal: pd.exe crashed.
I tried an uninstall and re-install, it's installing without problems, but doesn't create shortcuts.
I've tried running it as administrator, rebooted computer.
What's wrong here?!
"Problem details" by Windows:
Problem signature:
Problem Event Name: APPCRASH
Application Name: pd.exe
Application Version: 0.43.0.0
Application Timestamp: 5100f299
Fault Module Name: pd.dll
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 5100f298
Exception Code: c0000005
Exception Offset: 0005300a
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 1031
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Pure Data / Raspberry Pi / Realtime Audio / Permissions
THE GOAL:
I want my Raspberry Pi 2 to automatically start up the Jack server with realtime scheduling, and subsequently start Pure Data with realtime scheduling, load a patch &c. without any user intervention from a login shell.
As a performance artist working primarily with psychodrama (the technology is definitely NOT the important part here), fiddling around at a terminal right before or during a performance is kind of... psychically inconvenient. I need a box that I can plug in, give the audio output to the sound guy, and be ready to go.
PREREQUISITES:
I use Raspbian with a Linux kernel compiled with realtime goodness. I have hand-compiled Jack2 and Pure Data with realtime support in order to take advantage of this. Running a process with realtime priority requires the proper PAM directives set in /etc/security/limits.conf and related places, but that is beyond the scope of this little write-up.
Also somewhat relevant: I use a M-Audio MobilePre USB soundcard (sounds pretty awful by today's standards, but it's an extremely USEFUL box and sounds good enough for the work I do). For full-duplex sound, this requires the RasPi's USB to be set to single speed. In this configuration, I can get just under 2.9ms latency with good CPU overhead for Pure Data to run a few of my 64-voice wavetable and delay line granulators. Yeah!
THE PROBLEM:
Purely by happenstance, I had given the jackd command in my startup script the option “-s” which allows the server to ignore overruns and so on. So things seemed to be working as expected, but I noticed a lot more glitches than when I manually started up Jack and Pd from the terminal without the “-s” option. Upon removing it from my startup script, everything failed! WAH.
So I started piping STDERR and STDOUT to text files so I could read what either Jack or Pd were complaining about. As it turns out, Jack was unable to start with realtime priority due to a permissions problem. (I assume this is one of the things the “-s” options allows jackd to ignore, and thus start up with non-realtime priority. Problem is that Pure Data can’t connect to a non-realtime Jack server when its “-rt” option specified.)
Now, I had already been through the whole rigamarole of setting proper memory and priority limits for the “audio” group, to which the user “pi” belongs. So I thought, okay, I have to execute these commands as “pi”, and while simulating a login shell because the security limits in question are only set during login.
So I did this:
su -l pi -c "/usr/local/bin/jackd -R -dalsa -dhw:1,0 -p128 -n3 -r44100 -S >> /home/pi/jackd.log 2>&1 &"
This says “login as user ‘pi’ and then run the jackd command with these options, piping the outputs to this log file and run it in the background”. Well, I still got all the same errors about not being able to set realtime priority. WHYYYYYYYYY?
THE SOLUTION:
I hunted and hunted and hunted on a Very Popular Search Engine til I decided to try searching “security limits not loaded with su -l” and found this.
(Makes me think of that Talking Heads lyric, “Isn’t it weird / Looks too obscure to me”.)
So by uncommenting the line # session required pam_limits.so
in /etc/pam.d/su
everything started working as expected.
CONCLUSION:
I now know a LOT MORE about PAM and how important it is to keep in mind when and in what order scripts and other little subsystems are executed; but also that sometimes the problem is EXTREMELY OBSCURE and is to be found in some seemingly far-flung config file.
I hope this helps anybody out there working with Pure Data and the RasPi. The second generation board really packs quite a punch and can run several hundred audio grains (run by vline~ and enveloped by vline~ and cos~) simultaneously without a problem. And I'm pretty sure this is just using ONE of the 4 cores!
I'm by no means an expert Linux sysadmin, so if you have any other suggestions or corrections, please let me know! I wouldn't have been able to get this far without all the generous and helpful writeups everybody else has contributed, both within the RasPi and Pure Data communities. If you have any questions about anything I glossed over here, I'll do my best to answer them.
PD-Jack synchronization
@ALON said:
After searching for a while I found a very interesting PD object:
jack_transport~
(The code is available at http://artdent.homelinux.net/svn/jack_transport~/ )
it's very useful for my application. It can have in PD information about the jack transport like:
BPM
Ticks
beat
measureI use the command line application jack_transport as master control to set the BPM and other tempo settings for the jack transport.
Then i can finally synchronize PD and Hydrogen.
Today this link: http://artdent.homelinux.net/svn/jack_transport~/ is dead. Where I can found jack_transport~ in another place? Thanks.
PD under jack OSX
i'm having trouble running PD under jack on OSX.
the patch i'm working with is very cpu intensive, but i optimized it as far as possible. when i run it with portaudio now, things are fine. i have to use high delay times of about 90ms to have things running smooth, but that's fine for me because it's more like soundscapeish stuff that don't need fast control response.
but when i use jack to route the outputs into ardour i get the typical audio cut-outs from too low latency (at 2048 buffersize maximum), and there seems to be no way to increase latency to the point where things work out under jack. at the same time though, cpu goes significantly down with jack, but still i get the clicks. very strange.
i've been told that the maximum latency is hardwired by the audio interface, but why can i increase the delay under portaudio to whatever amount i wish to have things working, but not under jack?
i hear that jack is supposed to be a "low latency audio driver" but for some reason it ruins the performance of my patch.
is there an alternative way to route 8 to 10 channels of audio into ardour?
thanks for any advice!
Set up the path for abstractions
hey,
I don't know but I wonder if maybe there isn't a more general problem going on right now (though it seems simple and wierd so I dont get it)
I am also having trouble loading abstractions even though I have done it quite a lot before, in particular (I posted this problem a few days ago but am posting in response to your problem in hopes that it might be a more global problem - though my abstractions, other than the ones mentioned below, load so I dont understand)
specifically, was the problem with the path not being recognised?
anyway -
Hello everyone,
This is a strange problem because I have loaded libraries and things with the 'Paths' dialog under the file menu before and had no problems.
I am trying to get Chris McCormick's s-abstractions to load. The folder is in the same folder as my other libraries and it is listed in both the "paths" and "startup" areas. It wasn't before but I added it.
I am running windows 7 64 bit. Another oddity that I noticed is that in my Program Files (x86) which is where the 64 bit programs live, I have pd installed and the folder is simply called pd. However in the Program Files folder (missing the x86, where the non-64 bit programs live) I have a folder called "Pd-0.42.5-extended"
I wonder if that couldn't be the problem. The s-abstractions folder is included in both though...
Hopefully somebody has some idea about this...
((anyway sorry to post twice but I hoped maybe there was some common problem there))
PD cuts off other sound on the computer
I did.
For command jackd I get this terminal output:
matjaz@matjaz-NV59C:~$ jackd
jackdmp 1.9.6
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2010 Grame.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
Cannot create thread 1 Operation not permitted
Cannot create thread 1 Operation not permitted
usage: jackdmp [ --no-realtime OR -r ]
[ --realtime OR -R [ --realtime-priority OR -P priority ] ]
(the two previous arguments are mutually exclusive. The default is --realtime)
[ --name OR -n server-name ]
[ --timeout OR -t client-timeout-in-msecs ]
[ --loopback OR -L loopback-port-number ]
[ --port-max OR -p maximum-number-of-ports]
[ --midi OR -X midi-driver ]
[ --verbose OR -v ]
[ --clocksource OR -c [ c(ycle) | h(pet) | s(ystem) ]
[ --replace-registry ]
[ --silent OR -s ]
[ --sync OR -S ]
[ --temporary OR -T ]
[ --version OR -V ]
-d backend [ ... backend args ... ]
Available backends may include: alsa, dummy, freebob, firewire or net
jackdmp -d backend --help
to display options for each backend
and for qjackctl:
The same control GUI opened where I clicked start.
15:38:11.262 Patchbay deactivated.
15:38:11.263 Statistics reset.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
15:38:11.286 ALSA connection graph change.
15:38:11.482 ALSA connection change.
15:38:19.241 Startup script...
15:38:19.242 artsshell -q terminate
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
sh: artsshell: not found
15:38:19.646 Startup script terminated with exit status=32512.
15:38:19.646 JACK is starting...
15:38:19.646 /usr/bin/jackd -dalsa -d/dev/dsp -r44100 -p256 -n2 -Xseq
15:38:19.649 JACK was started with PID=2544.
Cannot create thread 1 Operation not permitted
Cannot create thread 1 Operation not permitted
jackdmp 1.9.6
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2010 Grame.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
Cannot lock down memory area (Cannot allocate memory)
ALSA lib control.c:882:(snd_ctl_open_noupdate) Invalid CTL /dev/dsp
control open "/dev/dsp" (No such file or directory)
ALSA lib control.c:882:(snd_ctl_open_noupdate) Invalid CTL /dev/dsp
control open "/dev/dsp" (No such file or directory)
audio_reservation_init
Acquire audio card Audio-1
creating alsa driver ... /dev/dsp|/dev/dsp|256|2|44100|0|0|nomon|swmeter|-|32bit
ALSA lib control.c:882:(snd_ctl_open_noupdate) Invalid CTL /dev/dsp
control open "/dev/dsp" (No such file or directory)
Cannot initialize driver
JackServer::Open() failed with -1
Failed to start server
15:38:19.743 JACK was stopped with exit status=255.
15:38:19.745 Post-shutdown script...
15:38:19.746 killall jackd
jackd: no process found
15:38:20.153 Post-shutdown script terminated with exit status=256.
15:38:21.703 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
15:38:31.152 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
15:38:42.143 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
15:39:02.300 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
I'm lost.
PD cuts off other sound on the computer
Thanks!
There seems to be similar thread going on with sonsofsol.
i installed jackd, when typing this command:
pacmd load-module module-jack-source channels=2; pacmd load-module module-jack-sink channels=2;
i get the following error
Welcome to PulseAudio! Use "help" for usage information.
>>> Module load failed.
>>> Welcome to PulseAudio! Use "help" for usage information.
>>> Module load failed.
when trying to connect pd with jack i get
error: JACK: unable to connect to JACK server
JACK: jack returned status 17
How to fix this?
Also in PD, when I choose ALSA midi, not Jack, then PD appears in Jack control.
Does this mean alsa-midi is the way to connect Pd to Jack? Not by choosing "Jack" in "media"?
M
Pd disables media players on ubuntu 10.10
thanx for your help guys.
i installed jackd, when typing this command:
pacmd load-module module-jack-source channels=2; pacmd load-module module-jack-sink channels=2;
i get the following error
Welcome to PulseAudio! Use "help" for usage information.
>>> Module load failed.
>>> Welcome to PulseAudio! Use "help" for usage information.
>>> Module load failed.
when trying to connect pd with jack i get
error: JACK: unable to connect to JACK server
JACK: jack returned status 17
anybody know how to fix this?
MIDI and recording
In Linux the JACK 'system' inputs and outputs are limited to what you physically have on your soundcard, but inputs and outputs of the software that connects to JACK are controlled by said software.
In the preferences in PD you can specify how many input and output channels you want PD to use.These channels will show up in the JACK patchbay under 'puredata'.
The DAW that I use is Ardour, and when you add tracks in the program, those channels show up in the JACK patchbay. Each track will get an input and an output that can be connected to the input or output of another program. In this case you want your outputs from puredata to connect to the inputs of the individual tracks in Ardour.
If you don't see the inputs and outputs from puredata or your DAW in the JACK patchbay then:
- your software is not connecting to JACK...it's probably connecting directly to ALSA
or - you are starting the software before you start JACK, in which the software isn't getting registered with JACK, and JACK can't manage the connections.
I'll make some screenshots for you if that will help
PD freezes&crashes all the time, am I the only one that's sick of it?
I'm on Mac, and I don't really experience crashes much at all. In fact, I also use Max/MSP, and I've found Pd-extended to be considerably more stable. I can understand feeling put off when this is constantly happening, but given that I'm having no problems, and that this doesn't seem all that common, I'm wondering if it's actually Pd-extended's fault. Have you tried vanilla and had these problems?
Also, the users of Pd-extended (and vanilla) ARE its testers, and it does go through several release candidates before an official one comes out. If you experience problems like this, the best thing you can do is bring it up with the Pd-list and talk to the developers directly. They may just have you file a bug report, but they'll at least know about the problem. Just because it works for them obviously doesn't mean it will work for everybody, so there are certain things they just won't find out about unless you tell them.
Edit: I just remembered that you've been doing some video stuff. I have found that the pdp objects tend to cause crashes on my system. Do these crashes occur when not using them?