WavePi: Use Raspberry pi (2/3/4) as a AIO MIDI synth

Discussion about old sound cards, MIDI devices and sound related accessories.

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby t9999clint » 2019-6-19 @ 06:11

gdjacobs wrote:I have other motives. It's handy for making one of my USB PCM/MIDI interfaces work. It only takes a single PCM format as input. JACK looks after format conversion, brilliantly at that.


I can certainly add jack support later, only problem is I don't know if Munt has jack support.
I think there's a ALSA to jack bridge I can use to get those to work. Might be worth a look after I get the SYSEX messaging figured out. I just got MUNT working so SYSEX triggered profile switching is the only bit left before I can start making tutorial youtube videos about it and start trying to make this project public.
I guess I'm also gonna have to figure out how to make a Ras Pi image, for those that don't want to compile all the code...
Not looking forward to dealing with having to host a 8gb img file. (Bittorrent maybe??)

Here's another quick brain dump for compilation notes for MUNT.
Code: Select all
## Setup development enviroment
sudo apt update
sudo apt install build-essential cmake libasound-dev libx11-dev libxpm-dev libxt-dev -yy

## Download mt32emu, replace link with latest version...
cd /usr/src
sudo wget https://github.com/munt/munt/archive/munt_2_3_0.tar.gz
sudo tar xzf munt_2_3_0.tar.gz
cd munt-munt_2_3_0

## Compile and install mt32emu
sudo -s
cd mt32emu
cmake -DCMAKE_BUILD_TYPE:STRING=Release .
make -j 4
make install
cd ..
exit

## Compile and install mt32emu alsa driver
sudo -s
cd mt32emu_alsadrv
make -j 4
make install
cd ..
exit

Using the -j 4 option I've managed to cut down the compilation time quite considerably, but it'll makes scripting the install script a bit harder when I get there.
maybe I'll just use a simple...
CPU_THREADS = $(nproc)
to the beginning of all the compile scripts and replace -j 4 with -j $CPU_THREADS
User avatar
t9999clint
Member
 
Posts: 147
Joined: 2014-10-07 @ 14:08
Location: Edmonton, Canada

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby gdjacobs » 2019-6-19 @ 13:25

t9999clint wrote:
gdjacobs wrote:I have other motives. It's handy for making one of my USB PCM/MIDI interfaces work. It only takes a single PCM format as input. JACK looks after format conversion, brilliantly at that.


I can certainly add jack support later, only problem is I don't know if Munt has jack support.


I can't remember if I use the ALSA bridge for this. I'll check.
User avatar
gdjacobs
l33t++
 
Posts: 6353
Joined: 2015-11-03 @ 05:51
Location: The Great White North

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby t9999clint » 2019-6-20 @ 08:57

I've been running some more tests to make sure munt is working properly and it seems to be stuttering with everything I try it with. My pi doesn't seem fast enough, I wonder if I'm running into a issue with amperage...
Or maybe I need to roll back to an earlier build of munt.
Looks like more testing is required... -_-
Is Silpheed just a really demanding game or am I doing something wrong here...
User avatar
t9999clint
Member
 
Posts: 147
Joined: 2014-10-07 @ 14:08
Location: Edmonton, Canada

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby gdjacobs » 2019-6-20 @ 09:34

What version of Pi? What C flags are you using? Also, under voltage can definitely be an issue with inadequate supplies.

Loom is the most demanding game I'm aware of, although I haven't tested Silpheed.
User avatar
gdjacobs
l33t++
 
Posts: 6353
Joined: 2015-11-03 @ 05:51
Location: The Great White North

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby t9999clint » 2019-6-20 @ 15:37

gdjacobs wrote:What version of Pi? What C flags are you using? Also, under voltage can definitely be an issue with inadequate supplies.

Loom is the most demanding game I'm aware of, although I haven't tested Silpheed.

OK, I'll start testing with Loom if I ever get Silpheed running.
It's a Ras Pi 3 B+
optimizations are...
export CCFLAGS="-Ofast -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -ftree-vectorize -funsafe-math-optimizations"
export CXXFLAGS="-Ofast -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -ftree-vectorize -funsafe-math-optimizations"

I've tried to use the same version of munt that you used in your project and it didn't make a difference so it's not a munt performance regression issue.

I don't have a proper raspi psu, I'm just plugging it into my powered USB hub so I'm guessing that's the issue. I'm going to see if I can jerryrig something today by tying it into the 5v rail on the computer's PSU, as I was planning on doing this anyway when I mount it to the soundcard.
User avatar
t9999clint
Member
 
Posts: 147
Joined: 2014-10-07 @ 14:08
Location: Edmonton, Canada

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby gdjacobs » 2019-6-20 @ 16:38

Yes, if you're undervolting, you'll get all kinds of buffer under runs. Everything else looks good (enabling neon math being most important) so I agree, that's most likely the issue.

I just got a beefy USB wall charger and that worked fine. Be cautious if you're feeding 5V directly to the GPIO supply pin as that bypasses the protection circuit onboard.
User avatar
gdjacobs
l33t++
 
Posts: 6353
Joined: 2015-11-03 @ 05:51
Location: The Great White North

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby t9999clint » 2019-6-20 @ 19:11

gdjacobs wrote:Yes, if you're undervolting, you'll get all kinds of buffer under runs. Everything else looks good (enabling neon math being most important) so I agree, that's most likely the issue.

I just got a beefy USB wall charger and that worked fine. Be cautious if you're feeding 5V directly to the GPIO supply pin as that bypasses the protection circuit onboard.


Thanks for the warning, I'll keep that in mind, it's a fairly new corsair 80plus silver rated psu so it should be stable enough for me not to worry about it.
User avatar
t9999clint
Member
 
Posts: 147
Joined: 2014-10-07 @ 14:08
Location: Edmonton, Canada

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby t9999clint » 2019-6-20 @ 21:50

Nope, still doing it, even after making sure it's properly powered. Although it does seem to behave slightly better now.
I'm going to test with loom and see if it's just something that Silpheed does.
*edit* Monkey's Island 2 and Loom both do it.
I wonder if I'm using the right compilation settings...
User avatar
t9999clint
Member
 
Posts: 147
Joined: 2014-10-07 @ 14:08
Location: Edmonton, Canada

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby gdjacobs » 2019-6-20 @ 22:40

Specifying -mcpu=cortex-a53 is enough to select appropriate options for registers and the neon unit on a Raspi 3. I believe -Ofast specifies unsafe optimizations implicitly as well (compared to more conservative settings, it does break IEEE floating point).

Does one CPU core peg when you're running Loom?
User avatar
gdjacobs
l33t++
 
Posts: 6353
Joined: 2015-11-03 @ 05:51
Location: The Great White North

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby t9999clint » 2019-6-21 @ 00:23

gdjacobs wrote:Specifying -mcpu=cortex-a53 is enough to select appropriate options for registers and the neon unit on a Raspi 3. I believe -Ofast specifies unsafe optimizations implicitly as well (compared to more conservative settings, it does break IEEE floating point).

Does one CPU core peg when you're running Loom?

yeah one core is pegged basically as soon as I start any game.
Sometimes it plays fine for a few seconds, but then it starts to stutter and play in slow motion, then it just starts cutting out.
I tried the -mcpu=cortex-a53 option already. I'm wondering if I should try an older version of rasbian. What version were you on when you had it running on your board?
User avatar
t9999clint
Member
 
Posts: 147
Joined: 2014-10-07 @ 14:08
Location: Edmonton, Canada

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby gdjacobs » 2019-6-21 @ 02:02

I was tracking Debian Jessie.
User avatar
gdjacobs
l33t++
 
Posts: 6353
Joined: 2015-11-03 @ 05:51
Location: The Great White North

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby t9999clint » 2019-6-21 @ 05:08

gdjacobs wrote:I was tracking Debian Jessie.

That could be something, maybe raspbian has some sort of service or driver running in the background that's preventing mt32d from running properly...
or it could be something I did... that's still possible.

Time to switch to debian
User avatar
t9999clint
Member
 
Posts: 147
Joined: 2014-10-07 @ 14:08
Location: Edmonton, Canada

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby t9999clint » 2019-6-22 @ 07:37

Still the same in debian. I've been checking the logs and whatnot, and raspbian is still reporting power issues, so somehow my molex adapter isn't giving enough power... I always thought the 5v rail had something like a 16a limit on a PSU, but I guess I'm wrong. Anyways I ordered in a proper PSU for testing, and I guess I'll have to add a 7805 or something to the BOM and start using the 12v rail instead on the final design.
User avatar
t9999clint
Member
 
Posts: 147
Joined: 2014-10-07 @ 14:08
Location: Edmonton, Canada

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby gdjacobs » 2019-6-22 @ 07:57

7805 or a buck circuit. The 5V rail might have sagged enough to be below the threshold where the Pi is happy (which in my experience doesn't require much droop to complain).
User avatar
gdjacobs
l33t++
 
Posts: 6353
Joined: 2015-11-03 @ 05:51
Location: The Great White North

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby t9999clint » 2019-6-22 @ 08:12

hmm it being overly picky with voltage drops could explain some things. I did some more testing with my PSU and it's providing WAAY more than the 2.5amps needed, it maxed out my cheap multimeter. (thanks Canadian Tire) Maybe what's needed isn't a 7805 or buck circuit, but just a beefy capacitor.
I might need to ask a engineer buddy of mine to recommend a good/cheap cap to use to smooth out the drops and maybe get back to a solid 5v.
User avatar
t9999clint
Member
 
Posts: 147
Joined: 2014-10-07 @ 14:08
Location: Edmonton, Canada

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby t9999clint » 2019-6-22 @ 12:33

yeah this is getting beyond my knowledge here...
I'm trying to wire a 7805 (That I had laying around already) to provide some 5v using the 12v rail from my computer's PSU, but the 7805's are just overheating and turning itself off.
I ran a cap on to be parallel to the input and the output sides, and it does provide a clean 5v for about 20 sec... I think the 7805 must be drawing too much power from the 12v line. I guess I need a resistor or something between the 12v and my circutboard to limit how much power it's allowed to take.
I'm gonna check out some documentation cause I clearly don't know what I'm doing... (Software guy)

*edit* I figured it out, I had it wired correctly. It's just that Linear converters are far to inefficient to properly power a ras pi 3 b+ without overheating. I also tried running a few of them in parallel, but I started running into the limits of the wiring (*fire*/*loss of magic smoke*).

Yeah, I'm gonna need a buck converter or two... *edit*
User avatar
t9999clint
Member
 
Posts: 147
Joined: 2014-10-07 @ 14:08
Location: Edmonton, Canada

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby jmarsh » 2019-6-22 @ 13:42

Linear convertors like the 7805 don't really like being connected in parallel... but it sounds like you already figured that out. You *can* tie them together with diodes, but then you need another diode on their earth to compensate for the voltage loss.
jmarsh
Member
 
Posts: 184
Joined: 2014-1-04 @ 09:17

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby t9999clint » 2019-6-22 @ 17:37

jmarsh wrote:Linear convertors like the 7805 don't really like being connected in parallel... but it sounds like you already figured that out. You *can* tie them together with diodes, but then you need another diode on their earth to compensate for the voltage loss.


Hmm I do have a few diodes I can try that with. Starting to run out of my jumper wires though...
Image

I'm glad I went with these cheap ones, I'd rather they go than anything important.
User avatar
t9999clint
Member
 
Posts: 147
Joined: 2014-10-07 @ 14:08
Location: Edmonton, Canada

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby t9999clint » 2019-6-22 @ 18:08

k I just tried that, better results the ras pi liked the voltages a little better....
For about 30sec longer than before, still overheated, still dropped voltage. I don't think 7805's are the right tool for the job. No fire though :happy:

Image

Bottom is 12v top is 5v
User avatar
t9999clint
Member
 
Posts: 147
Joined: 2014-10-07 @ 14:08
Location: Edmonton, Canada

Re: WavePi: Use Raspberry pi as a AIO MIDI synth

Postby Tiido » 2019-6-22 @ 22:13

You cannot use 7805 or other linear regulators in parallel fashion without a current sharing mechanism such as resistors (several watt 1ohm things for example) and even then you waste a some power in regulators fighting each other and losses in those resistors. Diodes will not do anything useful either except drop voltage, and such small diodes are gonna drop a whole volt under load while not helping much at all with the load sharing problem.
User avatar
Tiido
Oldbie
 
Posts: 865
Joined: 2018-1-14 @ 04:40
Location: Estonia

PreviousNext

Return to Sound

Who is online

Users browsing this forum: No registered users and 6 guests