Commit Graph

302 Commits

Author SHA1 Message Date
Konsta
dcad73115c audio: hook refine position to alsa stream
* Fixes audio syncronization during video playback.
* Account start_threshold as device specific latency for ALSA HDMI and
  tinyalsa [1] (3.5mm jack, DAC & USB) output.
* Remove unneeded pcm call to query buffer size.

[1]: https://android.googlesource.com/platform/external/tinyalsa_new/+/refs/tags/android-16.0.0_r1/include/tinyalsa/pcm.h#214
2025-11-06 13:10:29 +02:00
Konsta
688b88189e audio: probe pcm card from property
* 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
2025-11-06 13:10:19 +02:00
Konsta
7bc0df0800 audio: alsa_utils: get hdmi device from property
* 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.
2025-11-06 13:10:09 +02:00
Konsta
fabdcf5490 audio: alsa_utils: increase start threshold to prevent underruns
* 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.
2025-11-06 13:10:00 +02:00
Konsta
3ca268d760 audio: alsa_utils: use alsa for hdmi devices
* 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.
2025-11-06 13:09:49 +02:00
Konsta
3306b79d41 audio: alsa_utils: change log tag
* Match log tags used elsewhere in the audio HAL to make debugging easier
  (i.e. 'logcat | grep AHAL').
2025-11-06 13:09:39 +02:00
Konsta
5ad2f1d648 audio: alsa_utils: change default sample rate
* 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.
2025-11-06 13:09:27 +02:00
Konsta
c6340b9c67 audio: default to 48000Hz sample rate for usb 2025-11-06 13:09:12 +02:00
Guillaume LA ROQUE
9562ff31a8 audio: fix usb record
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>
2025-11-06 13:09:01 +02:00
Guillaume LA ROQUE
7af9c78937 audio: enable usb audio hal
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>
2025-11-06 13:08:51 +02:00
Konsta
a0f3530f2e audio: clean up makefiles
* 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.
2025-11-06 13:08:41 +02:00
Konsta
375a38c961 audio: rename hal for rpi 2025-11-06 13:08:31 +02:00
Konsta
451c17acd0 audio: remove effects and tests
* See [1] and [2] for reference and comments.

[1]: 346a56239e
[2]: 765b1a3a3d
2025-11-06 13:08:21 +02:00
Konsta
a76bafa9f4 audio: import usb audio configuration
* frameworks/av/services/audiopolicy/config/ at android-16.0.0_r1.
2025-11-06 13:08:12 +02:00
Konsta
487b7689f6 audio: import alsa_utils
* system/media/ at android-16.0.0_r1.
2025-11-06 13:08:00 +02:00
Konsta
7d6df38051 audio: import aidl hal
* hardware/interfaces/audio/aidl/default/ at android-16.0.0_r1.
2025-11-06 13:07:51 +02:00
Konsta
3292156c2a audio: remove legacy hal 2025-11-06 13:07:41 +02:00
Konsta
be817e8c9e Revert "graphics: enable rpi5 hwcomposer backend"
* No longer needed as resolved on the kernel side [1].

[1]: 957ab73946

This reverts commit ea465608e8.
2025-11-04 12:59:38 +02:00
Konsta
52b9546788 graphics: switch vulkan to apex 2025-11-04 12:08:39 +02:00
Konsta
171eab461d graphics: set vulkan compute level and bump hardware level 2025-11-04 12:08:31 +02:00
Konsta
ae42b024a6 graphics: use latest deqp levels 2025-11-04 12:08:24 +02:00
Konsta
87b43659ea camera: move libcamera hardware property to apex 2025-11-03 18:16:16 +02:00
Konsta
e3f56d94d4 graphics: switch minigbm gralloc to apex 2025-11-01 10:11:16 +02:00
Konsta
44d50650d5 camera: switch external to apex
* Copy service definition from hardware/interfaces/camera/provider/default/.
2025-11-01 10:10:39 +02:00
Konsta
88e5be9bc3 camera: switch libcamera to apex 2025-11-01 10:10:08 +02:00
Konsta
3c6ee78b4f sepolicy: add block devices for NVME/USB boot 2025-10-28 19:16:29 +02:00
Konsta
a07500570b suspend_blocker: rename service 2025-10-28 19:16:21 +02:00
Konsta
984e7f2e98 bump fcm level to 202504
* This is the target FCM level for API level 36.
* Specify that HIDL is enabled so android.hidl.manager is started.
  This copies manifest fragment that doesn't set max FCM level
  (vs. max-level="8").
* Set FCM level in compatibility matrix to satisfy kernel version check.
* 'make check-vintf-all' passes as COMPATIBLE.
2025-10-23 14:41:34 +03:00
Konsta
f1c960d48e ffmpeg: move seccomp policy to external 2025-10-23 12:59:54 +03:00
Konsta
0607f411f5 tv: set correct aapt preference
* tvdpi is for 213 dpi and xhdpi is for 320 dpi. Android TV targets set
  320 dpi on 1920x1080 resolution [1].
* On AOSP16 1280x720 resolution is forced on tvdpi [2] as TvFrameworkOverlay
  RRO package only contains the resource for the preferred density.

[1]: https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-16.0.0_r1/data/etc/displayconfig/default_television.xml#16
[2]: https://android.googlesource.com/device/google/atv/+/refs/tags/android-16.0.0_r1/overlay/TvFrameworkOverlay/res/values-tvdpi/config.xml#23

Change-Id: If8ed07664d9925ab8226f15f8f6ce374d90e0f71
2025-10-11 18:05:41 +03:00
Konsta
44fa08f385 boot: add overlay for Raspberry Pi 5" DSI Touch Display 2 2025-10-06 14:47:39 +03:00
Konsta
89cbccc94b graphics: disable hdr
* 42c9655523
2025-08-30 17:53:14 +03:00
supechicken
fa17a27a8d keylayout: Fix Leanback Keyboard for ATV image
This patch remaps the Enter key to DPAD_CENTER for Leanback Keyboard to work

Change-Id: I201234d8a735c4eec5f6e0680c37bb5c13dcef21
Signed-off-by: supechicken <me@supechicken666.dev>
2025-08-22 20:11:03 +03:00
Konsta
48843429d4 keylayout: add cec config to tv layout
Change-Id: I628544c5e4fdd9b131c9596ef5b8eb9676c3a7c0
2025-08-22 20:10:53 +03:00
Konsta
91ac806cc6 keylayout: add tv specific layout
* Copy from device/google/atv/Generic.kl at 8e49e4448fdced4816fc40d4e01f3f6e66e3c3db.

Change-Id: I2aeb85d5bab319c7efda7d324042e319a447bb83
2025-08-22 20:10:29 +03:00
Konsta
79d71dad3e graphics: build mesa using soong
* libgbm_mesa_wrapper is built as a requirement.
2025-06-27 11:06:52 +03:00
Konsta
77332f861e libcamera: build using soong
* IPA data is now copied as a requirement to ipa_rpi_pisp.
2025-06-27 11:06:44 +03:00
Konsta
3f5dba6729 libcamera: switch to aidl hal
* 20c227e0c3
2025-06-27 11:06:10 +03:00
Konsta
de401a1c18 audio: don't copy alsa configs
* ALSA configs are now copied as a requirement to libasound.
2025-06-24 16:06:51 +03:00
Konsta
a7460bb97a ffmpeg: add instance to framework compatibility matrix
* Picked up by 'make check-vintf-all'.

The following instances are in the device manifest but not specified in framework compatibility matrix:
    android.hardware.media.c2.IComponentStore/ffmpeg (@1)
2025-06-24 16:06:31 +03:00
Konsta
df33a89dc2 enforce-product-packages-exist: add exception for com.android.ranging
* Android 16 ranging feature.
  https://developer.android.com/develop/connectivity/ranging
* com.android.ranging is nowhere found in AOSP though should be built.
  1e9faa2bc9

build/make/core/main.mk:1096: warning:  device/brcm/rpi5/aosp_rpi5.mk includes non-existent modules in PRODUCT_PACKAGES
Offending entries:
com.android.ranging

build/make/core/main.mk:1096: warning:  device/brcm/rpi5/aosp_rpi5_car.mk includes non-existent modules in PRODUCT_PACKAGES
Offending entries:
Bluetooth
Keyguard
Launcher2
OverviewApp
RotaryIME
RotaryPlayground
com.android.ranging
libnfc_ndef
libvariablespeed
pppd

build/make/core/main.mk:1096: warning:  device/brcm/rpi5/aosp_rpi5_tv.mk includes non-existent modules in PRODUCT_PACKAGES
Offending entries:
com.android.ranging
2025-06-16 13:37:43 +03:00
Konsta
c0402d3acc car: update vehicle aidl to v4 2025-06-16 13:37:43 +03:00
Konsta
3af1a6e4e9 car: switch to v4l2 evs aidl hal 2025-06-16 13:37:43 +03:00
Konsta
cefbd94c9a libcamera: update config for 6.12 kernel 2025-06-16 13:37:43 +03:00
Konsta
057d5bb186 ramdisk: update hw decoder media device for 6.12 kernel
console:/ # v4l2-ctl --list-devices
...
rpi-hevc-dec (platform:rpi-hevc-dec):
        /dev/video19
        /dev/media0
2025-06-16 13:37:43 +03:00
Konsta
e83c2e570c bump shipping api level 2025-06-16 13:37:43 +03:00
Konsta
11bcd723fc readme: mkimg: Raspberry Vanilla AOSP 16 2025-06-16 13:37:43 +03:00
Konsta
467fdeed87 mkimg: adjust flashable image size
* It's been reported that 14848MiB = 15569256448 bytes is still too
  large to fit some 16GB storage devices.
* 15360000000 bytes is dividable by 16384, 4096, 2048, 1024, 512, ...
* Fixes 6c7ec173b4.
2025-06-08 12:30:30 +03:00
Konsta
2117ba7dac mkimg: detach loop device 2025-06-08 12:30:22 +03:00
Konsta
0450c28673 wrimg: add more block devices to search 2025-06-08 12:30:14 +03:00