Using the JamPi as a performance tool for a while got me thinking about ways I could design it better from a hardware perspective. My main thoughts were:

- Improve sound quality
- Expose more USB ports
- Rearrange placement of ports/audio jacks
- Add 5-pin MIDI in/out

The USB sound card produces some background hiss, and takes up a lot of space, even with the plastic housing removed. A DAC hat like the HifiBerry wouldn't fit in the Hammond 1590BB enclosure I wanted to use, and would make it awkward to add LCD and buttons. Then, I found these "GYPCM5102" modules that use the same PCM5102 DAC as the HifiBerry, and work with the same device tree overlay in Raspberry Pi OS, which meant I could connect a sound card directly to GPIO without having to write a bunch of new code.

![JamPi with PCM5102 DAC](/media/blog_images/jampi_gypcm5102.jpg)

For my new build, I oriented the enclosure vertically, with the LCD at the top and the Pi installed horizontally so that the 4 USB ports could be accessed from one side. This made it possible to install the audio jacks on the other side, so they wouldn't get in the way of my feet when I'm using the buttons. I had to desolder the headphone jack from the DAC module to fit it between the Pi and my perfboard. Sound from the new DAC is great - there's no background hiss at all.

I also decided to try to add 5-pin MIDI in/out jacks. I had some keyboards I wanted to connect this way, and I'd already experimented with some projects that included MIDI interfaces and used the serial pins on the Pi's GPIO to send/receive MIDI. I added the components to the perfboard, drilled some holes in the enclosure for MIDI jacks, and spent a lot of time messing with `/boot` files and device tree overlays. I was able to send/receive MIDI signals using ttymidi, but haven't finished setting this feature up in a way that's usable for live performance.

As I use this thing more, I naturally start thinking about ways of improving it that make it a better product for others to use as well. That's why I'm sharing things here, and hopefully others will share ideas that can improve it as well. 

![JamPi Rebuild](/media/blog_images/jampi_rebuild.jpg)