GloDroid / glodroid_manifest

Android port that aims to bring both user- and developer-friendly experience in using AOSP with a set of single-board computers (SBC), phones and other devices.
472 stars 66 forks source link

pinephone: Align tinyHAL configuration with PostMarketOS ALSA UCM configuration #143

Closed rsglobal closed 2 years ago

rsglobal commented 3 years ago

Benefits:

GloDroid configuration: https://github.com/GloDroid/glodroid_device/blob/master/pinephone/audio.pinephone.xml https://cs.android.com/android/platform/superproject/+/master:device/linaro/hikey/audio/audio_policy_configuration.xml;l=87?q=audio_policy_configuration.xml%20hikey

PostMarketOS configuration: https://gitlab.com/postmarketOS/pmaports/-/tree/master/device/main/device-pine64-pinephone/ucm

Pine64 official UCMs: https://gitlab.com/pine64-org/pine64-alsa-ucm/-/merge_requests/1

Example how may phone policies look like: https://cs.android.com/android/platform/superproject/+/master:device/google/coral/audio/audio_policy_configuration.xml;l=208?q=audio_policy_configuration.xml%20&sq=

squidink7 commented 2 years ago

I noticed recent changes to the audio.pinephone.xml file, is this issue at all related to that or no? Also is that the only file that needs adjustment to solve this? and if so could information be gathered from the example tinyhal implementation (https://github.com/CirrusLogic/tinyhal/blob/master/audio.example.xml) which seems to already have a device section for both loudspeaker and headphone port? I understand that it cannot be used without modification, just wondering about how this all works. I apologise for my lack of knowledge on this topic although am eager to learn!

rsglobal commented 2 years ago

In the attempt to complete this issue it was discovered that tinyhal lacks a lot of required functionality. Therefore it can be used to provide basic features only. We have to search for alternative solution or implement our own audio HAL.

MarijnS95 commented 2 years ago

For someone planning to implement an alternative/new solution, consider purely using UCM as configuration format. It is after all already in use to feed PipeWire and PulseAudio for that exact same reason, and should allow a single config to be written and reused across every platform.

@rsglobal and me talked about this a long while ago and I recall creating an issue for it on the CirrusHAL repo - but it doesn't seem to be there. Roman, if you remember this might be the right spot to link it just in case.