Giter Club home page Giter Club logo

Comments (6)

Gadgetoid avatar Gadgetoid commented on August 11, 2024

Audio

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.

LEDs

For user control of the LEDs you'll eventually be able to use pimoroni/apa102-python#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.

Buttons

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

from phat-beat.

bjoernbusch avatar bjoernbusch commented on August 11, 2024

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.

from phat-beat.

Gadgetoid avatar Gadgetoid commented on August 11, 2024

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?

from phat-beat.

bjoernbusch avatar bjoernbusch commented on August 11, 2024

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

from phat-beat.

Gadgetoid avatar Gadgetoid commented on August 11, 2024

Do you have any luck running something simple like: speaker-test -c2 -twav ?

from phat-beat.

bjoernbusch avatar bjoernbusch commented on August 11, 2024

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

from phat-beat.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.