Problem setting up on Pi Zero + Phat DAC

Nimbo77 posted Jan 17 '17, 13:59:

Hey guys.
So I've been spending a lot of time trying to get SampleBox running on a Pi Zero with Phat DAC, and I'm really stumped here.

What I have done:

  1. I have installed the Phat DAC, and the soundtest works (as long as SamplerBox isn't running, as it seems it monopolizes the DAC when running).

  2. I have installed the MIDI DIN circuit.

  3. Checked status of SamplerBox with systemctl (no error messages).

  4. Have tried configuring to load from USB, and also from root (default samples).

  5. Have tried triggering samples through both MIDI DIN and USB.

  6. Have tried both HansEhv's alternative/extended implementation ( and the stock image.

But I simply am not getting any sound out of it. I don't know whether it's failing to load samples, whether MIDI isn't working, or whether it's an audio issue, or some/all of the above. I can't figure out how to test to narrow down the issue.

If anyone can offer advice, it would be appreciated.


Kees posted Jan 18 '17, 00:19:

Did you wire the buttons as in the "Build het electronics parts" section on the homepage?

If so, Pin12 of the Pi conflicts with the PhatDac (Pin 12 = GPIO18 = I2S).

You can connect the button to Pin 16 and in the code at line 344 change

GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)

GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)

More info here:


Kees posted Jan 18 '17, 00:25:

.... and in line 349 change

if not GPIO.input(18) and (now - lastbuttontime) > 0.2:


if not GPIO.input(23) and (now - lastbuttontime) > 0.2:

Nimbo77 posted Jan 18 '17, 17:11:

Thanks for the suggestion. I have not wired up any buttons yet, but I still tried your suggestion, thinking there could be interference between the button code and the PhatDAC.
There was no change. However!:

I had primarily been testing this with my Novation Mininova synth, through both USB and MIDI. I have now retested with my Beatstep Pro sequencer, and it is working through USB only!
So now I am thinking two things:

  1. The Mininova's USB MIDI implementation is wonky, or just has idiosyncrasies that don't play well with the Pi.

  2. The MIDI circuit I wired up for the Pi isn't working.

I'll have to go back and recheck the MIDI wiring.
I'm not sure whether changing the GPIO in code helped with this or not, but now it's correct for button wiring later.

Thanks again!

Kees posted Jan 18 '17, 17:52:

Glad to hear you got dsome sound now ;) Changing the code is good, because the code redefines GPIO18.

I find the manual for the midi circuit not very clear . I used the explanation from Notes and Volts:

Perhaps this helps!


Nimbo77 posted Jan 22 '17, 21:47:

Just an update on this.

I finally got MIDI working by implementing the solution at:

It seems they changed the way the uart works in Pi3/Zero.

Now I have a new problem that may or may not be MIDI related: so this might not be a perfect fix.

HansEhv posted Jan 22 '17, 23:05:

Hi Nimbo,
That's good news, a lot of forum writers had this problem too so they will be pleased as well :-)
Did you also take out the "bcm2708.uart_clock=3000000" parameter from the cmdline.txt?
I don't think this has relation with the new/sound problem.

Nimbo77 posted Jan 23 '17, 13:34:

As far as I can gather, the "bcm2708.uart_clock=3000000" parameter from the cmdline.txt is overridden by the device tree. I didn't remove it, since that guide didn't specify to. I just tried commenting it out now, and it didn't seem to make any difference.

I'm going to make a new post about this, so others can find it more easily through search. Right now, it's kind of buried in not entirely specific topics.

Flo posted Jun 29 '20, 11:12:

Hi, I know this post is quite old but where is the file that I have to modify to remap the GPIO buttons ?


  (not published)
  I want to post as guest