Open bjoernbusch opened 5 months ago
I'd guess the issue with audio playback is that all instructions/install scripts put stuff in /boot/config.txt
which is now just a file that reads:
DO NOT EDIT THIS FILE
The file you are looking for has moved to /boot/firmware/config.txt
Which is rather unhelpful.
I'm reasonably sure you can just add dtoverlay=hifiberry-dac
to /boot/firmware/config.txt
and at least the audio side of pHAT BEAT will work fine.
For user control of the LEDs you'll eventually be able to use https://github.com/pimoroni/apa102-python/pull/9
That APA102 library (which is what the LEDs on pHAT BEAT are, fundamentally) needs some updates with all the stuff I've learned over the last few months before it's ready for prime time though.
These are just regular GPIOs on the following pins:
BTN_FASTFWD = 5
BTN_REWIND = 13
BTN_PLAYPAUSE = 6
BTN_VOLUP = 16
BTN_VOLDN = 26
BTN_ONOFF = 12
They're active-low, with a pull-up so you can probably just try the following in /boot/firmware/config.txt
to see if it works:
dtoverlay=gpio-key,gpio=5,keycode=163
dtoverlay=gpio-key,gpio=13,keycode=165
dtoverlay=gpio-key,gpio=6,keycode=119
dtoverlay=gpio-key,gpio=16,keycode=114
dtoverlay=gpio-key,gpio=26,keycode=115
dtoverlay=gpio-key,gpio=12,keycode=166
With the expectation that this will make those buttons behave like volume up/down, prev/next, play/pause and stop keyboard media keys. (I haven't tested this!)
The event codes header, that serves as a lookup table for the keycode
, value is here: https://github.com/torvalds/linux/blob/e67572cd2204894179d89bd7b984072f19313b03/include/uapi/linux/input-event-codes.h#L189-L190
Adding dtoverlay=hifiberry-dac
to /boot/firmware/config.txt
get me passed the GPIO errors, but the errors about the profile persist and there is no sound yet. Any further ideas?
Apr 29 14:37:10 audiopi pulseaudio[645]: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
Apr 29 14:37:13 audiopi pulseaudio[645]: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
Apr 29 14:37:13 audiopi pulseaudio[645]: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="2" name="platform-fef00700.hdmi" card_name="alsa_card.platform-fef00700.hdmi" namereg_fail=false tsched=no fixed_latency_r>
Apr 29 14:37:13 audiopi pulseaudio[645]: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
Apr 29 14:37:13 audiopi pulseaudio[645]: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="3" name="platform-fef05700.hdmi" card_name="alsa_card.platform-fef05700.hdmi" namereg_fail=false tsched=no fixed_latency_r>
Apr 29 14:37:14 audiopi pulseaudio[645]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Apr 29 14:37:14 audiopi pulseaudio[645]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Apr 29 14:37:32 audiopi pulseaudio[991]: E: [pulseaudio] main.c: Failed to kill daemon: No such process
Apr 29 14:37:32 audiopi systemd[1]: pulseaudio.service: Control process exited, code=exited, status=1/FAILURE
Apr 29 14:37:32 audiopi systemd[1]: pulseaudio.service: Failed with result 'exit-code'.
Apr 29 14:37:32 audiopi systemd[1]: pulseaudio.service: Scheduled restart job, restart counter is at 1.
I can't believe I'm writing these words, but Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
suggests audio wont work without booting up into Raspberry Pi Desktop...
Are you running the full desktop or Lite flavour of Pi OS?
What are you launching to try and get audio playing?
yeah, I guess I should have read all the way to the right :)
No, it's just the Lite version of Pi OS. I'm using it as a headless radio player. I've added some MQTT subscription in the phatbeatd code, so that I could remotely turn on the radio, that's why I don't need the buttons and the LEDs.
Let me try to through the desktop onto this machine then
Do you have any luck running something simple like: speaker-test -c2 -twav
?
hm, I guess a little bit of UI didn't help.
sudo apt install xserver-xorg raspberrypi-ui-mods xinit
+ raspi-config boot options
Apr 29 17:50:46 audiopi systemd[1]: Started pulseaudio.service - PulseAudio Daemon.
Apr 29 17:50:47 audiopi pulseaudio[546]: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
Apr 29 17:50:52 audiopi pulseaudio[546]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Apr 29 17:50:52 audiopi pulseaudio[546]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Apr 29 17:50:52 audiopi pulseaudio[546]: [pulseaudio] bluez5-util.c: Could not find org.bluez.BatteryProviderManager1.RegisterBatteryProvider(), is bluetoothd started with experimental features enabled (-E flag)?
Apr 29 17:50:55 audiopi pulseaudio[546]: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
Apr 29 17:50:55 audiopi pulseaudio[546]: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="platform-fef05700.hdmi" card_name="alsa_card.platform-fef05700.hdmi" namereg_fail=false tsched=no fixed_latency_r>
Apr 29 17:50:55 audiopi pulseaudio[894]: E: [pulseaudio] main.c: Failed to kill daemon: No such process
Apr 29 17:50:55 audiopi systemd[1]: pulseaudio.service: Control process exited, code=exited, status=1/FAILURE
Apr 29 17:50:55 audiopi systemd[1]: pulseaudio.service: Failed with result 'exit-code'.
Apr 29 17:50:55 audiopi systemd[1]: pulseaudio.service: Scheduled restart job, restart counter is at 1.
Apr 29 17:50:55 audiopi systemd[1]: Stopped pulseaudio.service - PulseAudio Daemon.
speaker-test -c2 -twav
speaker-test 1.2.8
Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Playback open error: -524,Unknown error 524
@bjoernbusch I went into the same errors as you. I tried the easy way and slapped a Pi OS Desktop on the Pi Zero WH. With the usual tweaking of /boot/firmware/config.txt
I got speaker-test -c2 -twav
playing some white noise out of the speaker. I have set the default sink with a mouse because I was to lazy investigating why pwctl
was giving some errors.
Now I have some issues with mopidy
(no sound) but I at least it is getting somewhere.
Hello void,
I know that this is completely unmaintained, but maybe someone is still listening in on this and has some ideas. I really like the phat-beat hat and it's still working fine, but I wanted to upgrade the RaspberryPi underneath for different reasons. I started the old install scripts on a brand new bookworm 64bit.
The phatbeat Python library doesn't properly connect to the board, when doing
phatbeat.set_all(0,128,0,0.1)
it crashes due toI can live without the actual phatbeat LED stuff, I only care about audio output, so I removed the
GPIO.add_event_detect
call from the python library.Now my last hurdle seems to be that pulseaudio can't connect to the actual board.
I guess both the Python issue and the pulseaudio issue are due to some GPIO changes, but here I'm a little but clueless. Any further hints would be appreciated.
Maybe @Gadgetoid, I saw you commenting on these things in the past.