[alsa-devel] [BUG] src/conf/alsa.conf: Hard-coded path `/etc/asound.conf`, needs `@func sysconfdir`.
The file `src/conf/alsa.conf` contains the hard-coded path `/etc/asound.conf`, which in some use cases may not be correct.
One particular use case: Termux[1], a "Linux subsystem for Android", plans to use ALSA plugins to communicate with the OpenSL ES implementation in Android. In doing so, it needs to not conflict with any vendor provided ALSA implentation, which could conceivably use an `/etc/asound.conf` of its own. At any rate, the system `/etc` directory is normally not writable by non-root users of Android.
I would suggest adding a `snd_func_sysconfdir` in `src/confmisc.c (analogous to `snd_func_datadir`) so packagers and users can place a global `asound.conf` file in a directory to which they have write access and which doesn't conflict with the systems ALSA. The desired path can already be specified at build time by using `./configure --sysconfdir=<dir>`, which conveniently defaults to PREFIX/etc in any case. It is available as configure variable: `sysconfdir='${prefix}/etc'`, and only needs to be substituted to be available to `src/confmisc.c`.
Kind regards,
Alain Kalker
[1]: https://termux.com/
On Sun, 05 Mar 2017 19:17:55 +0100, Alain Kalker wrote:
The file `src/conf/alsa.conf` contains the hard-coded path `/etc/asound.conf`, which in some use cases may not be correct.
One particular use case: Termux[1], a "Linux subsystem for Android", plans to use ALSA plugins to communicate with the OpenSL ES implementation in Android. In doing so, it needs to not conflict with any vendor provided ALSA implentation, which could conceivably use an `/etc/asound.conf` of its own. At any rate, the system `/etc` directory is normally not writable by non-root users of Android.
I would suggest adding a `snd_func_sysconfdir` in `src/confmisc.c (analogous to `snd_func_datadir`) so packagers and users can place a global `asound.conf` file in a directory to which they have write access and which doesn't conflict with the systems ALSA. The desired path can already be specified at build time by using `./configure --sysconfdir=<dir>`, which conveniently defaults to PREFIX/etc in any case. It is available as configure variable: `sysconfdir='${prefix}/etc'`, and only needs to be substituted to be available to `src/confmisc.c`.
Maybe an easier fix would be to replace it from src/conf/alsa.conf.in.
Takashi
participants (2)
-
Alain Kalker
-
Takashi Iwai