Patch launching issue via the app


#1

I’ve updated RPi and Pisound and installed the app today. Paired my Samsung S7 with Pi using app (I can restart and shut it down via app).
For some reason no patch from collection will run successfully. All I can see is a quick blink on a Pi’s desktop (probably Pd being loaded) but it terminates instantly.
Last log on the app’s console shows:

Connecting all MIDI ports to and from Pure Data.
invalid destination address Pure Data
invalid sender address Pure Data:1


Major Pisound App Update: Real-Time Controls & MIDI Mapping! Wowza!
#2

Hey, hmm, it looks like Pure Data crashes… Does Pure Data work when launched via the desktop?


#3

Pd works fine (expect for DSP error that switch it off just after initialisation) when I’m starting it using single-clicking button command, but I usually link dsp switch to volume control inside my patches so I can switch it on/off when volume exceed 0 (what is useful when I’m running headless).
When I’m starting Pd from desktop the setting are different and it defaults to ALSA for audio and OSS-MIDI for MIDI what results in fine audio but no MIDI.
I know that single-click command includes arguments such as audio and midi drivers setup, sample rate etc. that is probably why it runs fine (except for DSP) from single-click command.

Sidenote: when starting Pd using single-click command it checks if an instance of Pd is already running and it is suppose to kill it - but it fails to see a running instance if it was started from desktop


#4

The button click and launching via the app share the same script to launch PD. The app should end up executing:

/usr/local/pisound-ctl/puredata/puredata_launch.sh /usr/local/puredata-patches/analog-style/analog-style.pd

and what puredata_launch.sh does, is it loads /usr/local/pisound/scripts/common/start_puredata.sh and uses start_puredata.

What is the output of running these commands:

cd /usr/local/pisound
git status
git log -1 --format=%cd

#5

git status

On branch master
Your branch is up-to-date with ‘origin/master’.
nothing to commit, working directory clean

git log -1 --format=%cd

Fri Jun 15 17:00:08 2018 +0300


#6

What output do you get if you run:

/usr/local/pisound-ctl/puredata/puredata_launch.sh /usr/local/puredata-patches/analog-style/analog-style.pd

?


#7

pi@raspberrypi:~ $ /usr/local/pisound-ctl/puredata/puredata_launch.sh /usr/local/puredata-patches/analog-style/analog-style.pd
Using display :0
/usr/local/puredata-patches/analog-style/analog-style.pd
2018-06-15.23:35:19: Killing all Pure Data instances!
2018-06-15.23:35:19: Giving 3 seconds for Pure Data to start up before connecting MIDI ports.
2018-06-15.23:35:19: Launching Pure Data.
2018-06-15.23:35:19: Pure Data started!
Opened Alsa Client 129 in:1 out:1
GEM: Graphics Environment for Multimedia
GEM: ver: 0.93.3
GEM: compiled: Feb 3 2015
GEM: maintained by IOhannes m zmoelnig
GEM: Authors : Mark Danks (original version)
GEM: Chris Clepper
GEM: Cyrille Henry
GEM: IOhannes m zmoelnig
GEM: with help by Guenter Geiger, Daniel Heckenberg, James Tittle, Hans-Christoph Steiner, et al.
GEM: found a bug? miss a feature? please report it:
GEM: homepage http://gem.iem.at/
GEM: bug-tracker http://sourceforge.net/projects/pd-gem/
GEM: mailing-list http://lists.puredata.info/listinfo/gem-dev/
open: /etc/pd/gem.conf: No such file or directory
open: /home/pi/.pd/gem.conf: No such file or directory
open: ./gem.conf: No such file or directory
GEM: compiled for SIMD architecture: none
KontrolRack: device = kontrol
pi@raspberrypi:~ $ 2018-06-15.23:35:22: Connecting all MIDI ports to and from Pure Data.
invalid destination address Pure Data
invalid sender address Pure Data:1

Basically it is the same thing as via app expect that now Pd loads with GEM (and cyclone) libraries (as it does when starting it from desktop)


#8

As we’re both online at the moment, let’s take this to the chat on https://blokas.io, it should be faster to get to the bottom of this issue. :slight_smile:


#9

Next thing to try would be to run as root, to mimic the environment when executed via the app:

sudo /usr/local/pisound-ctl/puredata/puredata_launch.sh /usr/local/puredata-patches/analog-style/analog-style.pd

It’s weird however, the button should launch as root too and use the same command line options as launching by the app. Could you try using instead of “/usr/local/puredata-patches/analog-style/analog-style.pd” the path to the patch that gets launched when you click the button?

Did you try launching other patches than analog-style ?


#10

pi@raspberrypi:~ $ sudo /usr/local/pisound-ctl/puredata/puredata_launch.sh /usr/local/puredata-patches/analog-style/analog-style.pd
Using display :0
/usr/local/puredata-patches/analog-style/analog-style.pd
2018-06-16.15:56:55: Killing all Pure Data instances!
2018-06-16.15:56:55: Giving 3 seconds for Pure Data to start up before connecting MIDI ports.
2018-06-16.15:56:55: Launching Pure Data.
2018-06-16.15:56:55: Pure Data started!
Opened Alsa Client 129 in:1 out:1
KontrolRack: device = kontrol
pi@raspberrypi:~ $
pi@raspberrypi:~ $ 2018-06-16.15:56:58: Connecting all MIDI ports to and from Pure Data.
invalid destination address Pure Data
invalid sender address Pure Data:1


#11


#12

I’m unsure how to modify the pisound.conf file but I’ve add simple ‘pd open’ object in my main.pd patch so it will start the analog-style.pd after single button click. I’ve add a delay so I can see that Pd opens. Unfortunately it closes just after the period of the delay

Sidenote: this exact solution works fine when I’m opening my own Pd patches


#13

Hey, it looks like something causes PD to crash on your system, it would be fastest to debug this issue via the support chat on https://blokas.io, just leave a message there saying when you’re going to be online for ~1 hour, and we can work on this. :slight_smile:


#14

Ok, looks like I found the issue, it only happens if running Raspbian ‘Jessie’ which is one release prior to ‘Stretch’.

MEC and KontrolRack.pd_linux & KontrolModule.pd_linux externals get built with -march=armv7-a which is totally fine, however, on Jessie, system libs are built using -march=armv6-a. These two flags (and resulting code) are normally compatible, however, there’s an issue in g++ 4.9 compiler (most up to date version on Jessie) which makes some certain code, in this case std::thread, to crash.

We will release rebuilt mec-blokas.deb and pd-blokas.deb packages tomorrow with the corrected flags, so that Pisound App and server can run on Jessie successfully.


#15

Ok, new versions are up, running the following should fix the issue:

sudo apt-get update
sudo apt-get install mec-blokas pd-blokas

#16

Pd stays on now, patches from app loads but the ‘control’ tab in the app only shows turning wheel animation (loading)


#17

This can happen if pisound-ctl fails to communicate with MEC, let’s check the versions you have and if it is running, what is the output of these commands:

dpkg-query -l 'pisound*' '*-blokas'

ps -ef | grep mec

Also, are there any errors in the console tab?

It’d be great to see the pisound-ctl log:

sudo journalctl -u pisound-ctl > pisound-ctl.log

could you retrieve the pisound-ctl.log and post it somewhere?


#18

ii pisound 1.03-1
ii pisound-btn 1.05-5
ii pisound-ctl 1.03-2

ii mec-blokas 0.1.1-2
ii pd-blokas 0.1.1-2

root 1151 458 0 22:45 ? 00:00:00 /bin/sh /usr/bin/mec /etc/mec-blokas.json
root 1157 1151 1 22:45 ? 00:00:04 mec-app /etc/mec-blokas.json
pi 1416 1333 0 22:51 pts/0 00:00:00 grep --color=auto mec

I don’t see any errors in console i.e. when loading Analog Style patch.
Last entry is:

Connecting all MIDI ports to and from Pure Data. Connection is already subscribed

pisound-ctl.log:
link


#19

Does the console output after launching the PD patch contain a line saying “Current Values Dump” and a few lines that look like name : value [F] ?

MEC and pisound-ctl seem to run fine. Did you make any modifications to Pisound scripts? What is the output of:

cd /usr/local/pisound
git fetch
git status

#20

Yes it does, “Current Values Dump” and [F] values

edit: all of a sudden when trying to load the Analog Style path once again using the app this time the ‘control’ tap loaded successfully showing five sliders :open_mouth:
Not sure why that happened as I haven’t changed anything since the last few times I’ve tried