* Valid values for the audio device property are 'jack', 'hdmi0', 'hdmi1',
and 'dac'.
* If 'jack' is selected, first PCM card with name 'Headphones' is used.
If 'dac' is selected, first PCM card that doesn't match the name for 3.5mm
or HDMI devices is used. HDMI audio uses virtual ALSA devices instead of
using tinyalsa to open a PCM card directly.
* Allow forcing specific PCM card for debugging/development purposes.
* PCM card numbers are different between Pi 4 and Pi 5 and order can change
depending on the DAC driver that's enabled.
Pi 4:
console:/ # cat /proc/asound/cards
0 [Headphones ]: bcm2835_headpho - bcm2835 Headphones
bcm2835 Headphones
1 [vc4hdmi0 ]: vc4-hdmi - vc4-hdmi-0
vc4-hdmi-0
2 [vc4hdmi1 ]: vc4-hdmi - vc4-hdmi-1
vc4-hdmi-1
Pi 5 with DAC:
console:/ # cat /proc/asound/cards
0 [vc4hdmi0 ]: vc4-hdmi - vc4-hdmi-0
vc4-hdmi-0
1 [vc4hdmi1 ]: vc4-hdmi - vc4-hdmi-1
vc4-hdmi-1
2 [sndrpihifiberry]: HifiberryDacp - snd_rpi_hifiberry_dacplus
snd_rpi_hifiberry_dacplus
* ALSA HDMI audio needs to be disabled when 3.5mm jack, DAC, or external
USB audio cards is used. Enable HDMI audio path based on system property
and the set the vc4 audio device name accordingly.
* For some reason underruns are often observed when using the default
parameters. Workaround this by increasing start threshold by 20 ms
(i.e. at 48000Hz there's 960 additional frames in the ring buffer before
the playback starts). Buffer size also needs to be increased to allow
larger start threshold. Balance between avoiding underruns and adding
latency.
* Add logging for the ALSA parameters.
* HDMI audio devices on Raspberry Pi use FORMAT_IEC958_SUBFRAME_LE which
is not supported by tinyalsa used on Android. Use ALSA library and its
virtual vc4 audio devices that use IEC958 plugin to manage the subframe
conversion.
* 48000Hz sample rate is set for output devices in audio policy
configuration. Set the same default sample rate for sanity though this
should not get used for valid profiles.
Default policy don't work with TI sound card due to some limitation.
Create and add usb audio policy xml file instead of copy default config
file.
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
We compile source code to support USB audio devices but manifest not
enable it.
Uncomment usb module part to have USB audio device support.
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
* Restructure to remove dependencies elsewhere in the AOSP tree, move APEX
definition from subdirectory, 'bpfmt -s -w Andoid.bp', etc.
* Remove package license definitions that are not visible in this context.
* It's always been intended that changing audio output devices requires
a reboot. Get the PCM card and device once when the HAL is initialized.
Might save a few ms on start_output_stream.
* It's always been intended that changing audio output devices requires
a reboot. Get the ALSA device once when the HAL is initialized.
Might save a few ms on start_output_stream.
* Audio
- Based on AOSP hikey audio HAL:
https://android.googlesource.com/device/linaro/hikey/+/refs/heads/master/audio/
- ALSA based on Android-x86
- ALSA loop is used to support HDMI audio on Pi 4 because VC4 HDMI
audio devices use SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE that is not
supported on Android
https://github.com/raspberrypi/linux/issues/4651https://github.com/raspberrypi/linux/issues/4654
* Bluetooth
- AOSP Broadcom vendor stack with some additional fixes from android-rpi
* Camera
- libcamera for official Raspberry Pi CSI camera modules based on GloDroid
- AOSP external camera HAL for UVC USB webcams:
https://source.android.com/docs/core/camera/external-usb-cameras
* Graphics
- OpenGL & Vulkan: upstream Mesa with GloDroid patches
- Upstream drm_hwcomposer with force resolution patch from Android-x86 and
my additional fixes
- minigbm based on GloDroid
* Health
- Based on AOSP cuttlefish health HAL
* Kernel
- Merge of Raspberry Pi and AOSP common kernel with my additional fixes
and configurations
https://github.com/raspberrypi/linuxhttps://android.googlesource.com/kernel/common/
* Lights
- Based on LineageOS Xiaomi msm8996-common lights HAL
* suspend_blocker
- Based on AOSP cuttlefish
* v4l2_codec2
- Based on AOSP with my Raspberry Pi 4 specific fixes
* Wifi
- AOSP Broadcom vendor stack with my additional fixes