This balena application runs a pulseaudio server and demonstrates how it can be used for playing and recording audio on a raspberry pi. It also supports playing and recording audio from bluetooth audio devices (bluetooth speakers, bluetooth headsets, ...)
- Raspberry pi (although it is most likely very easy to port this to other devices)
- For playing audio the following can be used:
- headphone, earphone, ... plugged into the headphone jack of the raspberry pi.
- TV, monitor with speaker, ... connected to hdmi port of the raspberry pi.
- bluetooth speaker, bluetooth headset,...
- (DAC) HAT with audio device or speaker connected to it.
- For recording audio the following can be used:
- USB microphone, USB camera with microphone, ...
- bluetooth headset, bluetooth speaker with microphone
- HAT with one or more microphones
The idea is to create a pulseaudio service (= pulseaudio-server
) that can be reused in other balena applications requiring an audio interface. This pulseaudio service is the only service having an interface with the audio hardware (including connected bluetooth devices): all other services requiring audio should do this via this pulseaudio service.
- service
pulseaudio-client-tcp
demonstrates how a service can communicate with thepulseaudio-server
via TCP. - service
pulseaudio-client-unix
demonstrates how a service can communicate with thepulseaudio-server
via a unix socket. - demonstrate how commands
paplay
andparecord
can be used to play and record audio. - Support changing/showing any pulseaudio setting through command
pactl
. - Support scanning/connecting/monitoring of bluetooth devices through command
bluetoothctl
- Supports
pavucontrol
andaudacity
. This requires an X-server (e.g. XQuartz on macbook) that is connected to the same local network.
This balena application consists of following services:
pulseaudio-server
: the core service running the pulseaudio server.- For its documentation and configuration see pulseaudio-server/README.md
pulseaudio-client-tcp
andpulseaudio-client-unix
are 2 test services based on the same docker containerpulseaudio-client-test
.- For its documentation and configuration see pulseaudio-client-test/README.md