Skip to content

build: give AudioReach its own /etc and /usr/share namespace - #93

Open
aekoroglu wants to merge 3 commits into
AudioReach:masterfrom
aekoroglu:aek-dev-3
Open

aekoroglu wants to merge 3 commits into
AudioReach:masterfrom
aekoroglu:aek-dev-3

Conversation

@aekoroglu

Copy link
Copy Markdown

Fixes #90.

/etc/acdbdata/<BOARD>/  ->  /usr/share/audioreach/acdbdata/<BOARD>/
/etc/card-defs.xml      ->  /etc/audioreach/card-defs.xml

As discussed in #90, the .acdb and .qwsp files are read-only data generated by
ARC/QACT, not conffiles, so they belong under ${datadir}. card-defs.xml is
genuinely editable and stays in /etc, but moves into an audioreach/
subdirectory /etc/card-defs.xml doesn't say what it configures, whereas
ls /etc/audioreach/ is a complete inventory of what's tunable.

The paths are hardcoded today, so --sysconfdir has no effect. The first
commit adds m4/audioreach-paths.m4 to make them configure options;
--with-audioreach-confdir and --with-audioreach-datadir restore the old
layout.

Introduce m4/audioreach-paths.m4, defining three directories as both
configure options and make variables:

  audioreachconfdir    ${sysconfdir}/audioreach
  audioreachdatadir    ${datadir}/audioreach
  audioreachdeltadir   ${localstatedir}/lib/audioreach/acdb-delta

Nothing uses them yet; the following commits route the install
directories through them.

The audio stack currently installs unqualified names into the root of
/etc: card-defs.xml here, and plugin_manager.xml and usecaseKvManager.xml
from audioreach-pal. Nothing about "plugin_manager.xml" is
audio-specific, and /etc is a namespace shared with every other package
on the system. /etc/card-defs.xml also does not say what it configures,
whereas ls /etc/audioreach/ is a complete inventory of what is tunable
in the audio stack.

The paths are also hardcoded today, so this package cannot be built
correctly for any prefix but the default: --sysconfdir has no effect.
Distributions that want the historical locations can pass
--with-audioreach-confdir and --with-audioreach-datadir.

The same macro is used by audioreach-graphmgr and audioreach-pal, which
declare the locations of files this package installs. It is copied into
each project rather than shared through a package: it has no
dependencies, and centralising it would give three repos a build-time
dependency on a fourth. This repo holds the canonical copy; bump the
serial when it changes.

Copies live in m4/ and qcom/qli/m4/ because qcom/qli is an independent
AC_INIT sub-package that can be configured standalone.

Signed-off-by: Ali Erdinc Koroglu <ali.koroglu@oss.qualcomm.com>
acdb_cal.acdb and workspaceFileXml.qwsp are read-only vendor data, not
configuration: they are produced offline by QACT and are not edited on
the device. They belong under ${datadir}, not ${sysconfdir}.

  /etc/acdbdata/<BOARD>/ -> /usr/share/audioreach/acdbdata/<BOARD>/

qcm6490 has two of these directories -- QCS6490_RB3Gen2 and QCM6490_IDP
-- and both are converted.

audioreach-graphmgr reads this location as -DACDB_PATH and must be
updated to match. Packaging that lists ${sysconfdir}/acdbdata needs
updating too.

Note that ACDB tuning deltas are written at runtime by ATS, so they
cannot live under a read-only /usr; audioreachdeltadir is separate for
that reason and is used by audioreach-graphmgr, not here.

Signed-off-by: Ali Erdinc Koroglu <ali.koroglu@oss.qualcomm.com>
card-defs.xml is integrator-editable configuration, unlike the ACDB
blobs installed alongside it, so it uses the configuration directory
rather than the data directory.

  /etc/card-defs.xml -> /etc/audioreach/card-defs.xml

This file's location is also declared in audioreach-graphmgr
(CARD_DEF_FILE) and audioreach-pal (SNDPARSER), both of which read it.
pal cannot delegate the lookup: snd_card_def_get_card() takes a card
number and no path. All three must move together, or audio comes up
with no card definition and no obvious cause. A compatibility symlink
at /etc/card-defs.xml is advisable for one release.

$(sysconfdir)/alsa/conf.d in linux/reference is deliberately untouched;
that namespace belongs to ALSA.

Signed-off-by: Ali Erdinc Koroglu <ali.koroglu@oss.qualcomm.com>
@aekoroglu
aekoroglu requested review from a team September 3, 2026 13:14
@slyon

slyon commented Sep 7, 2026

Copy link
Copy Markdown

I very much support this change, but what else do we need to update, across AudioReach and potentially other consumers, that was expecting to find those files in its original directories?

@slyon

slyon commented Sep 9, 2026

Copy link
Copy Markdown

The problem with /etc/audioreach/card-def.xml is that we have multiple variants of that file for the different boards (e.g. qcom/qli/GLYMUR/card-defs.xml), which one is being installed? Only one ends up in the package (for me it's qcom/qli/X1E80100/card-defs.xml in the Debian build, likely because that sorts last).

Maybe those files should end up in /usr/share/audioreach/ in a per-device directory, as vendor defaults and the application choosing the relevant file automatically at runtime. Keeping the /etc/audioreach/card-def.xml location as an override, so a human can modify the vendor defaults. /etc/audioreach/card-def.xml could also be a symlink to the relevant device-default XML, to be choosen at installation time (e.g. via update-alternatives).

@qti-sbojja What do you think about that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify source and location of ACDB data files

2 participants