-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a Raspberry Pi 2 #11
Comments
Hi Dan - thanks, this would be really helpful! Today I switched on Pi 2 builds in GitHub Actions, so whilst the current release (0.2.1) doesn't have a Pi 2 kernel inside the archive, they are available if you take a look in Actions, find the latest build, and download the We're still trying to figure out what the best test would be - we've found that the mapmaker's theme in Monkey Island 2 can reveal stutters/pops as it has some nice sustained chords - but feel free to try anything! I've had some feedback from @nswaldman about the Pi 2 and it looks like it can work, albeit with reduced samplerate and/or increased audio chunk size to avoid stuttering (at the cost of reduced quality and increased latency respectively). You can set these options in the I don't think we've done any testing with overclocking yet though, so if you're feeling adventurous, it'd be great to see if a mild overclock could let the Pi 2 run with the same defaults as what we use on the Pi 3/4 (512 chunk size, 96000Hz, 'good' resampler quality). |
Hey @danbee - I think @dwhinham already covered all important things with his reply, but I the least I can do is share my fiddling. I've been getting some good results by changing the vanilla cfg with the following three changes:
This is on a regular Raspberry Pi 2 Model B with no overclocking whatsoever and it does have the occasional crackle/pop on the MI2 theme discussed above (again, a better benchmark is definitely welcome!) I have to admit that I found no significant performance change between |
Now that 0.7.0 is out, we have multi-core and ARM NEON optimizations enabled. It may be possible that Raspberry Pi 2 performs better now and it definitely deserves re-testing. We also have FluidSynth to try too, which should definitely work on slower hardware (as long as polyphony and SoundFont complexity aren't too high). Perhaps start with completely stock settings and see how it fares. |
I can certainly look into this again. Now I have the Pi-MIDI hat it should be much easier to test. I'll find some time to try it this week and let you know. |
Finally got my MiSTer outputting MIDI to the Pi. First test with the Pi2 was Speedball 2 (which I didn't even realise had MT-32 support). So far everything is working perfectly! No dropouts or stuttering. Sample rate is set to 32,000hz and resampling is set to none. This is with mt32-pi 0.7.1. I'll figure out how to get Monkey Island 2 working. |
48,000hz and "good" resampling also works with no dropouts or stutters for Speedball 2 |
I'm hearing some crackles in the mapmakers theme on MI2 at 48,000hz and "good" resampling. I'll try and get a recording of it this weekend and see if overclocking helps. |
No crackles or pops at 32,000hz with resampling turned off. Been listening to the mapmakers theme for the last five minutes... |
Sorry for not replying to this, just revisiting some old issues. Your testing sounds pretty positive; perhaps the Pi 2 can be upgraded to "compatible, but change xyz settings" status. It sounds like mapmaker causes stuttering on Pi 2 with all audio-related options at defaults. What if we apply an overclock in [pi2]
arm_freq=1000
core_freq=500
sdram_freq=500
over_voltage=2 Also, is your Pi 2 the original, or a v1.2? The original has Cortex A7s at 900MHz, the v1.2 has Cortex A53s at 900Mhz (more like a Pi 3). This may have a significant impact; the A53 may be able to get away without an overclock. From https://www.raspberrypi.org/forums/viewtopic.php?t=163856#p1058809:
We definitely use NEON SIMD instructions. IMHO, the goal is to find the minimum steps required to get Pi 2 stutter-free from a completely stock install. Otherwise, I can amend the docs to instruct the user to relax the samplerate, though this isn't very desirable - we have FluidSynth now and it'd be good to stay at 44100 or 48000. |
Hi, Setup:
No overclocking
“Default” - Crackle on mapmaker, ~ every 4th second
“Increase Cunk / latency” - Some crackle on mapmaker, around 16th beat”
Overclocking
“High” - Crackle on mapmaker all the time
“Resampler quality” - Some crackle on mapmaker, transitioning between indoor / outdoor
“Default on overclocked - Crackles around 16th beat”
“Increase Chunk / latency overclocked” - No issues”
The test feels a bit arbitrary; anything on low enough latency will crackle... But then again, half of the reason I wanted a MT32 was for MI2, so I shouldn't be complaining :P Anything else you’d like tested before I swap it out for a Rbp3? Is there any benefit or downside from running 48000 on both mister and Mt32-pi, such as aliasing or noise? |
Thanks for taking the time to test the Pi 2! If I remember correctly, I was talking to @danbee in private some time ago and we worked out that everything in mt32-pi.cfg can be left at defaults except:
IMO it's probably not worth messing with any of the samplerate stuff unless you're trying to increase quality on a faster Pi - it doesn't seem to be hugely beneficial for performance. If you reduce the samplerate to 32000, you don't lose much on the MT-32 synth but I think you'll potentially lower the quality on FluidSynth depending on the SoundFonts used. This MIDI is a good test case SoundFont mode - use GeneralUser GS (Chun-Li theme from X68000 SF2): When there's not enough CPU cycles you'll get stuttering in this MIDI almost instantly. Lowering the polyphony should fix it. |
Hey, Dave. I'm not directly involved in your project nor am I building an MT32-pi at the moment, but I did have some early skin in this game, in particular with the Pi 2 (although you've definitely taken things much further). For what little it's worth I created original Vogons thread concerning Munt implementation on the Pi (which then spread to Retropie among others). If you have the time, I've got a few questions I hope help me contrast MT32-pi's requirements and behavior with my experience. I never tested MI2 as a load score. My go-to is Loom, specifically the Overture section starting at 0:50. The demand on Munt was substantial (much more than any of the other MIDI dumps I have on hand) and quickly apparent even when piping directly from the Pi CLI. As a point of reference, I was typically seeing 65-70% max load on one of the cores of the Pi 2 at stock clocks running Loom under Linux. I hope there's more efficiency to be extracted on this platform (which can be passed on elsewhere), but I want to replicate the testing parameters you use to make sure I'm looking at comparable results first. I'll make a point of testing MI2 myself, but, in your informed opinion, is MI2 more punishing in the more demanding sections than the Loom overture or is it comparable? Noticing the issues you're having with Pi 2 performance, does your build resample in the mt32emu process or is it resampling via an external thread? Also, a quick comment. The SC-55 line topped out at 28 voice polyphony. XG Level 2 implemented in the MU80 required 64. While a reduction to 128 voices or even less is generally considered noticeable, I don't believe it to be a big sacrifice for retro gaming given the synth hardware commonly used in the pre-Windows gaming era. Slightly lower levels of polyphony will still sound really good and operate similar to period equipment. YMMV, etc. Lastly, the Pi Zero 2 appears to be more robust CPU wise with slightly higher clock and higher IPC compared to the Pi 2. Assuming no power management and firmware issues, it should perform favourably even at stock clocks. If performance on the Pi 2 can be sorted without an overclock, that in principle will lead to an MT32-Pi solution without any further stress on the PZ2's thermals. The RAM pool is another limitation in particular for Fluidsynth, but good GM, GS, and Emu sound fonts are available at <100MiB and likely cover the needs of a large swath of users. Do you disagree with or have anything you'd like to add to this line of thought? |
I've no idea, I haven't tried Loom. MI2/mapmaker theme will overwhelm the CPU and cause underruns at stock clocks on Pi 2, though remember mt32-pi is running with extremely small buffers and therefore tighter deadlines than what might be the case with Linux.
mt32-pi's baremetal environment does not have a concept of OS-level threads or processes, only cores. That said, all audio rendering, including any resampling, happens on the same core. Nothing else is allowed to happen on that core; it is 100% dedicated to the audio.
Yes, I'm aware of this and agree. For the latest release I lowered the default FluidSynth polyphony value to 200 so that the new Pi Zero 2W (which is same silicon as Pi 3 minus 200MHz) passes my tests. Honestly though, it could probably be a lot lower and no-one would notice.
Yes, it's similar to comparing Pi 2 vs Pi 3 - it's a huge step up.
Pi Zero 2W is a solved problem; as it's in the same performance ballpark as the Pi 3 there wasn't much to do. Like I say, there is a pretty big performance gap between Pi 2, with its 32bit 900MHz ARM v7 CPU (at least in the original model) versus the 64bit ARMv8 in the later models. mt32-pi is compiled as a native 64bit kernel for everything except Pi 2, which also helps. I don't have exact numbers but that alone gave me more headroom on the same target when it came to polyphony.
Agreed. I (and others who I've talked to about this) am of the opinion that some of these SoundFonts that are hundreds and hundreds of megabytes large are simply mashups of sound sets that just seem to contain tons of samples for the sake of it. Without naming any of them in particular, they tend to be quite unbalanced and have some instruments that sound really out of place, etc. Whereas something like GeneralUser GS is only ~35MB, and sounds fantastic, because it has been carefully crafted by a musician. But, that's just like, my opinion, man. 🙂 |
Indeed, low latency can have it's costs. I'll do a comparison and see if the two scores have sections which can be compared apples to apples. I'll also look at tuning the sound stack on the Linux side for comparable test conditions vis-a-vis buffers.
Which gives you instant processor affinity. I'll have a look at the compute cost of resampling to see how much it's hogging. Might run it by Serge as well.
I suspect 128 voice would be largely adequate given the XV5080 and MU2000EX operate with that limit, although there's certainly no harm in operating to the limit of the rendering hardware. The actual issue is the SF2 format. You need to stack multiple sound fonts to approach the sample selection commercial modules offer, which is actually what Zoltan (Falcosoft) did for FSMP. Of course, what's really far overdue is a more capable standard.
I estimated roughly 30% improved performance from IPC which is no joke.
Excellent news! I take it Munt didn't require any OC?
In more ways than one. They definitely rationalized the uarch in terms of required execution units with ARMv8. Optimized compiling for the BCM2836 is a real flag soup.
The Katamari Damacy of wavetable synthesis. |
I was looking for something useful to do with my old PI2 B+ 1.1. So I tried the sdcard.zip from the latest build as mentioned above. I connected a Win10 PC via CP2102 USBtoSerial to the Pi, a 16x2LCD with the I2C backpack and added the "standard" PI2 overclock to it: [pi2] I also set the FluidSynth polyphony to 128 in the mt32-pi.cfg as mentioned above. And it runs and sounds abolutely great with every File I threw at it so far (MidiPlay->loopMIDI->HairLess Midi->CP2102->RPI2 GPIO). I tried MT32 mode and FluidSynth with the various SC55 soundfonts. But there must be a reason why the PI2 is not officially supported? Is there anything known to not work or have sound issues? I'd like to hear that myself. I'm very happy as it works right now. Tomorrow, I'll try one of those cheap PCM5102 DAC modules that have been collecting dust here. And a rotary encoder module. Once I've boxed this all up this is going to be a great MIDI synth for my retro PC builds. |
Read the thread above, mapmaker's theme in Monkey Island 2 is the test I keep using... Pi 2 is not officially supported simply because I don't have one to test the project with. I provide binaries that will run on the Pi 2 as part of every release, but the point of this thread is to try to establish what the best overclock settings are that work in all common scenarios. I am not comfortable calling it "supported" until this is known and verified. |
I looked into various MI2 midi packages, but it seems there is nothing called "mapmaker's theme". Any hints? |
Thanks! I'll try installing it. Which romset should I use to test? I'm asking because https://en.wikipedia.org/wiki/List_of_MT-32-compatible_computer_games says "Distorted/incorrect sounds on MT-32 'old'" for MI2 |
Don't worry about that too much, I don't notice any distortion on this song with 'old' at least. The distortion you get from a CPU being too slow is different and unrelated. |
I installed it in Dosbox and configured it to use the loopMidi device. Pretty simple. I still have this 5m USB cable with a CP2102 connected to the RPI GPIO and PWM sound from the 3.5mm jack. I'm using the "old" 1.07 romset. Wow I don't think I've ever heard such beautiful tunes. I am speechless. I remember having played this game on the Amiga back in the 90s. But these MT32 tunes really add so much to the atmosphere of this game. In the "mapmaker" room I don't hear anything unusual. Beautiful tune, no crackling or noise (besides the hissing/white noise of the PWM output). I need to figure out how to do a recording so one of you can confirm that it indeed sounds right. Edit: OK I know what you're talking of now. Without the overclock, there is clearly a popping/crackling noise around every 15-20 seconds in this tune. It is reproducably gone with the overclock. Anyway, this is a beautiful application for my old PI2. I just have to make myself a case. |
Thanks for reporting back. So 1000MHz is probably good for MT-32 mode. If you hear stuttering, lower the |
Hello everyone! |
This looks like an awesome project, and I'd love to help you test it on my Raspberry Pi 2. Can I just download a regular release or do I need to do anything special?
The text was updated successfully, but these errors were encountered: