About the crash - it’s likely your audio config/settings
- see this post
PiSound for Video Synth - #34 by moonman157
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
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!
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.