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

Very strange!
Now I started the web editor again, started Python, and for a second I got the Football scope again. Until it crashed wit this as the error:

 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'.

Later i tried it again, and it still is running the Football Scope. But not responding to the MIDI (which I thought I mapped correctly).

ALSA <-> PulseAudio PCM I/O Plugin

it may be something to do with PulseAudio being used as the default audio system on newer versions of RasPiOS (since January I think).

You might look up and see if you can uninstall pulseaudio

If I’m honest, I don’t understand what I’m doing wrong.
Yesterday the Football Scope seemed to work and didn’t crash. After trying it again today, it doesn’t work anymore.

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'.

Getting this error. Tried going to the files (main.py and /home/pi/Eyesy/engines/python/sound.py) as seen in the error. Have no idea what to do with it.
What do you mean with
ALSA <-> PulseAudio PCM I/O Plugin ?

Again, lots of thanks for helping me!

Hi,
I finally got a new pi4 after going getting and returning a used pi4.
I tried using the lite version, but strangely ethernet doesn’t work both on the used pi and this new pi. Only installing the desktop version works for me, to access wlan. I’m going thru the steps again and will report back with progress. But need to find out what is wrong with the ethernet port.
Do i need a special cable for the ethernet? I’m using a Cat5 cable.

I mean that pulseaudio could be the problem


Alternately - start over with the 2020-08-24 RasPiOS image
https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2020-08-24/

did you manage to install amidiauto?

well i also had the error of not able to install amidiauto, then I tried the link

" 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 just click on that and paste everything except the 1st starting with # then enter. then update and install amidiauto.
that way works for me.

regarding this part,

If I’m using a usb interface, card 1, do i add this instead?

Hi Idek, about ethernet: did you connect the RasPi directly to the router or to the ethernet port of your Mac/Win pc?

My Pi didn’t work when I used the “Sharing Ethernet” of my Mac (the Mac was connected wifi to the WLAN, and the Pi was connected to the Mac via ethernet). I read on some forum that was a DHCP problem.
But if you plug the Pi directly to the router than it gets an automatic IP and you can ssh into it.

I used the normal Cat5 cable that came with the router.

About amidiauto: any Midi signal should be already connected to PD by default.
puredata <-> pisound is probably a redundancy from my side, and pisound <-> pisound is needed if you want to use Pisound midi out as midi thru.

Hi jqrsound, with ethernet, I’m plug straight into the junction box built into my home. It works totally fine with the mac only not the pi. I’ve check around and everyone says it a 0.01% that it’s a pi problem, since this is my 2nd pi4 I’ve tried on. But wlan works for now, so I’ll find out later what’s the problem.

ok noted on the amidiauto.

I went through all the steps in Mads Kjeldgaard tutorial except for the part of installing the real-time kernel. I’ve tried that but after that my interface is not recognized and doesn’t light up, so I skipped that step and did step 16 & 19 of your tutorial. I didn’t manage to even start eyesy on the webbrowser on my mac. Got stuck there. I’ll try again when I’ve time and report back.

So I managed to get my MIDI working. In PD i can see MIDI IN light up when testing MIDI and AUDIO. When starting the webbrowser for EYESY, I still get ther error I mentioned before.

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]

These lines look most important to me. But I don’t know what to do with it.

Your sound card needs to be setup as “default”

I’ve done this with my sound card as follows:

# create asound.conf if it does not exist
sudo nano /etc/asound.conf

#add
pcm.!default  {
  type hw card 0
}

ctl.!default {
  type hw card 0
}

Do I need do edit that code?
When I entered this code: sudo nano /etc/asound.conf
It gave me the exact code you wrote.

#add
pcm.!default  {
  type hw card 0
}

ctl.!default {
  type hw card 0
}

Then just press ^X to exit? That didn’t work when I tried the webeditor again.

What do you get from aplay -l?

card 1: Series [TASCAM DR Series], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

The external sound card (fieldrecorder) I’m using. Set to 16bit.

So you would want to try changing asound.conf details from
type hw card 0
to
type hw card 1
(and reboot or restart alsa)

Where do I change that? Where can I find the .conf file?
I did find asound.conf in terminal, and it told me there was no file.

Do what you did above. Then control-o to save and control-x to exit

There are many many web resources on how to create/edit files in raspberry pi. So a search on how to use the nano editor.

I saw the Football Scope mode for a second. Then it crashed again and gave me this (different) error:

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: Device or resource busy [default]
eyesy-python.service: Main process exited, code=exited, status=1/FAILURE
eyesy-python.service: Failed with result 'exit-code'.

So I found out, that wen PureData is opened on the PI, the web editor does not start (hence the error before?). But when I close PD on the RPI, my MIDI does not stay connected to PD.
Also when I open the webeditor and start Python when PD is closed, it does not crash, but the football scope seems to be flipping out, even with no sound input.
It also seems like Aconnectgui (the ALSA Sequencer) has to be opened on the RPI, for Python not to crash.

Edit: Even with the ALSA opened, I get a different Error…:

Traceback (most recent call last):
  File "main.py", line 173, in 
    sound.recv()
  File "/home/pi/Eyesy/engines/python/sound.py", line 63, in recv
    ldata = audioop.tomono(data, 2, 1, 0)
audioop.error: not a whole number of frames
eyesy-python.service: Main process exited, code=exited, status=1/FAILURE
eyesy-python.service: Failed with result 'exit-code'.

Just finished the installation - thanks for the great guide and work @jqrsound and @okyeron.

I’m now failing at the last step :pensive:

I have touchOSC on both iPad & iPhone and in both cases the latency is so bad as to make it unusable. Parameter knobs appear to work (with this delay) but mode/scene selection does not. I’ve followed everything in this guide to the letter… Are there maybe some parameters on touchOSC that I’m missing (never used it before)?

I guess I’m going to buy a MIDI controller anyway but it would be nice to figure out how to get this working.