EYESY on RasPi4 w/ Pisound (step-by-step guide)

hi there, really nice of you to compile information together. I don’t own a pisound, but I’m would like to try this out. I have a behringer audio interface UCA222 and a miditech midi link.
So I was just wondering if you have any idea if your instructions would work with these?

The Pisound’s potentiometers are in the analog signal path to control the volumes, they’re not accessible digitally.

Hi Idek, if you want to install Eyesy on a RasPi with a USB sound card, I suggest you follow the entire Mads Kjeldgaard tutorial (minus the SuperCollider parts)
Notes for setting up a Raspberry Pi 4 for audio work :: Mads Kjeldgaard — Composer and developer
In my guide Jack is set for PiSound, not for a USB sound card.

When you finish Mads’ tutorial, follow Step 16 & 17 and I guess you’ll have Okyeron’s Eyesy on your system.
I don’t know how to set Midi over Usb, but probably amidiauto will sort it out.

If you want to use VNC and a Graphical Desktop, then follow also Step 5 & 15 (those are not covered by Mads).

I hope that will work for you, have fun!

1 Like

cool, thanks, I look into that!

I think I followed the steps correctly.
I’m working with a RPI 4B, Focusrite 2i2 audio interface (1st gen) and AKAI MPK mini MIDI controller.
When the RPI is booted up, I just get the homescreen. Running ~/Eyesy/start_web.sh via SSH or in the RPI Terminal gives no result.
Going into the RPI folders, clicking EYESY, there is a file called “run.sh”. Clicking this and filling in my password, it seems that the EYESY program starts. I see a graphic which responds to the inputted audio from my interface.
My MIDI controller does not seem to affect it. And after a few seconds of EYESY running, it seems to crash.

Can someone help me with this. I am completely new to the RPI-world.

Hi, I’m not sure I got your workflow.
Eyesy won’t start at startup and running ~/Eyesy/start_web.sh via SSH will give no result in the terminal or on the Pi desktop, it’ll only start the web editor.

Then with both the RasPi and another computer (or your phone) connected to the the same network, use a browser (not the RasPi) to go to http://raspberrypi.local:8080 or [your RasPi IP]:8080
Then click on “Start Python” and Eyesy should start.
“Start ofLua” won’t work, so focus on Python for now :slight_smile:

About Midi over USB, try to modify amidiauto as explained here → Patchbox and ORAC - #11 by Giedrius
Just to be sure, are the CC set correctly on the MPK?

Oh ok. So the webeditor can be opened on my macbook. I can click on “Start Python”, and it starts EYESY on the RPI with mode S - Football Scope. But, after a few seconds it seems like it crashes and this shows up in the web editor:

Traceback (most recent call last):
File “main.py”, line 173, in
sound.recv()
File “/home/pi/Eyesy/engines/python/sound.py”, line 76, in recv
avg_l +=audioop.getsample(ldata, 2, (i * 3) + j)
audioop.error: Index out of range
eyesy-python.service: Main process exited, code=exited, status=1/FAILURE
eyesy-python.service: Failed with result ‘exit-code’.

About MIDI, I’m not really sure what you mean by setting CC correctly.

Did you entirely follow my guide to set your RasPi?
As I previously wrote to Idek (check the post number 14)

if you want to install Eyesy on a RasPi with a USB sound card, I suggest you follow the entire Mads Kjeldgaard tutorial (minus the SuperCollider parts)
Notes for setting up a Raspberry Pi 4 for audio work :: Mads Kjeldgaard — Composer and developer
In my guide Jack is set for PiSound, not for a USB sound card.

About Midi, I just wanted to ask if you programmed the pots of the MPK to send the right CC (21-22-23-24-25 to modify the parameters)

About the crash - it’s likely your audio config/settings

That might be the problem!
Now I already dit a full reset (formatted SD etc…) and started all over.
When I opened the web editor and started Python, I got this error:

Hello from the pygame community. Contribute - pygame wiki
starting…
[‘main.py’]
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
Traceback (most recent call last):
File “main.py”, line 36, in
sound.init(etc, AOUT_JACK)
File “/home/pi/Eyesy/engines/python/sound.py”, line 41, in init
inp = alsaaudio.PCM(alsaaudio.PCM_CAPTURE,alsaaudio.PCM_NONBLOCK)
alsaaudio.ALSAAudioError: No such file or directory [default]
eyesy-python.service: Main process exited, code=exited, status=1/FAILURE
eyesy-python.service: Failed with result ‘exit-code’.

A different error than before.
I found a TASCAM RD40X laying around and used it as audio interface (at 16bit). So that shouldn’t be a problem anymore?

The MIDI part is also still not totally clear to me. How do i set the CC? On the RPI I also noticed that Pure Data does not register any MIDI input.
The RPI sees the TASCAM when I type aplay -l and the APK Mini when I use aconnect -l.

When you type aplay is your soundcard the only one in the list? Did you disable HDMI and headphones?

A question, did you flash a Raspbian image or a Patchbox image as OS?
I’m having a similar problem with Patchbox, it’s a work in progress with that OS.
If you used Raspbian then you’d google how to set your soundcard on a RasPi, I cannot help it with it because I’m not really a programmer :smiley:

About Midi, on Okyeron’s Github page you’ll see a list of CC and what they control. So you have to program your MPK to send those exact CC (unless you want to change them in PD, but that’s another story).
I don’t own an MPK but there is an MPK editor on the Akai website, you’d check that one.

Yes the soundcard is the only one in the list after doing #dtparam=audio=on in config.txt.

I’m a total RPI noob, but looking a the code I’m thinking it’s missing something?

With MIDI the problem seems to be that it recognizes the MIDI Keyboard. I get this:
pi@raspberrypi:~ $ aconnect -l
client 0: ‘System’ [type=kernel]
0 'Timer ’
1 'Announce ’
client 14: ‘Midi Through’ [type=kernel]
0 ‘Midi Through Port-0’
client 20: ‘MPK mini’ [type=kernel,card=1]
0 'MPK mini MIDI 1 ’

But when I open PD on the RPI, and test media, it does not register MIDI IN.

In PD/Media did you select ALSA Midi?

amidiauto should connect every midi to PD, but just to be sure, did you edit the amidiauto.conf file?

When doing: sudo apt-get update && sudo apt-get install amidiauto
It gave this: E: Unable to locate package amidiauto
No I haven’t edit the amidi.conf file.
Still need to do that?

In PD on the RPI and the webeditor I keep getting an error about ALSA

Sorry I can’t really help you with that one, amidiauto is made by Blokas, maybe try to add their repository → BlokasLabs repository
and then install amidiauto again.

you may need to do this before you install amidiauto
sudo apt-get --allow-releaseinfo-change update

This is likely because your sound card is not configured properly.

You will probably need to do some googling on how to configure your specific audio device for use on Raspberry Pi (debian linux).


If it’s a USB audio device, you might need to do this

# Comment out options snd-usb-audio so it can load first
sudo nano /lib/modprobe.d/aliases.conf
	# options snd-usb-audio index=-2

you may also need to blacklist onboard audio

# edit or create raspi-blacklist.conf 

sudo nano /etc/modprobe.d/raspi-blacklist.conf
#add
blacklist snd_bcm2835

and then reboot

I tried your step before installing amidiauto again, with no succes. I get the same error.
Somehow the file doesn’t seem to be there…

The USB audiodevice (tascam dr40x) does seem to be recognized. Opening PD and testing audio device, I see it registrates the audio i put in.

In PD ALSA-MIDI is selected. But when i do ‘Test Audio and MIDI…’ it automatically deselects ALSA (not the ALSA-MIDI one) and shows the error: ALSA input error (snd_pcm_open): No such file or directory.
The same as output error.
When I select ALSA again, it shows me the MPK mini (hardware) as input- and output device.

aplay -l from the command line will list your audio devices.

ALSA handles both audio and MIDI so this is sometimes confusing.

Ignoring PD for the moment, you can test your audio card inputs with this

arecord -f dat -vv -V stereo -d 15 ~/audio-test.wav

aplay -vv -V stereo ~/audio-test.wav

First line will record 15 seconds of audio input. The second line will play it back.

arecord will also dump a bunch of information about the card when you record. You should copy that info here in this thread for us to see.

My card does this for example:

Recording WAVE '/home/pi/audio-test.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
Hardware PCM card 0 'snd_rpi_proto' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 24000
  period_size  : 6000
  period_time  : 125000
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 6000
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 24000
  silence_threshold: 0
  silence_size : 0
  boundary     : 1572864000
  appl_ptr     : 0
  hw_ptr       : 0
                                  +00%|00%+                                   

So I tried formatting the SD and installing everything all over again.
Same result.
I also did the extra codes you proposed (thanks for the effort by the way!). No succes.
With arecord I got this as the result:

Recording WAVE '/home/pi/audio-test.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
ALSA <-> PulseAudio PCM I/O Plugin
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 24000
  period_size  : 6000
  period_time  : 125000
  tstamp_mode  : NONE
  tstamp_type  : GETTIMEOFDAY
  period_step  : 1
  avail_min    : 6000
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 24000
  silence_threshold: 0
  silence_size : 0
  boundary     : 1572864000

Again, lots of gratitude for the time investing in this!