Speaker phat and pantilthat


Does anyone face the same problem as me?
I want to use pantilthat and speaker phat on raspberry pi zero. But it is simply not working together (pantilthat works just fine but on speaker phat only leds work). Once I uninstall pantilthat ( sudo apt-get remove python-pantilthat python3-pantilthat), then also sound works.

Any idea how could I have pantilthat and also speaker phat working together?

Many thanks

The Pan tilt pinout is as follows, looks like it only uses i2c.

The speaker phat pinout is as follows, it uses i2c and i2s.

I don’t see any conflicts? They each have different i2c address and i2c is a shared bus so thats fine.
You must have them on a pHat Stack?

The pan tilt shouldn’t affect i2s but I would double check the i2s in enabled in Raspberry Pi configuration, interfaces, or in raspi-config if your running Buster Lite. The LEDs are done via i2c.

Yes, have them on phat stack. I have also IR thermometer usingwhich is using BCM 2 and BCM 3, but that should not be the problem as speaker phat works after I uninstalled pantilthat.

Ok, this is a head scratcher for sure. Once you have everything installed double check that i2s is enabled. And that the pHat Beat is set as the audio device. Maybe sound is getting redirected to HDMI or something. Thats about all I can think of at the moment.

Ok I will check and get back later.

Thanks for now

I have a couple of Pan Tilt Hats. Those setups are Motion Eye OS and no extra DAC for sound. They run headless with no speaker connected.

I enabled dtparam=i2s=on in config.txt but with no success.
However I have found out that the problem is not in speaker-phat and pantilt-hat compatibility.
When I uninstalled pantilthat it has caused that my flask webserver application (since there is a reference to pantilt-hat) stopped and then speaker-phat started to work. But if I remove the reference to pantilt-hat in my webserver application and uninstalled pantilt-hat (so the server is running despite I uninstalled pantilt-hat), speaker-phat did not work.

So the problem is somewhere in my flask webserver app…but do not know where for now

I have never used Flask so I have no idea where to look.