Make alsa find its plugins

  • Done
  • quality assurance status badge
Details
2 participants
  • Danny Milosavljevic
  • Julien Lepiller
Owner
unassigned
Submitted by
Julien Lepiller
Severity
normal
J
J
Julien Lepiller wrote on 22 Apr 2018 19:13
(address . guix-patches@gnu.org)
20180422191345.1836dc69@lepiller.eu
Hi, this patch adds an environment variable, ALSA_PLUGIN_DIR to allow
it to find its plugins. This is especially useful in GuixSD where
pulseaudio is used by most applications. When running an application
that only knows about alsa, no sound can be output because the card is
taken by pulse. One solution is to use the pulseaudio plugin from
alsa-plugins:pulseaudio and setting ~/.asoundrc:

# Default to PulseAudio
pcm.!default {
type pulse
hint {
show on
description "Default ALSA Output (currently PulseAudio Sound
Server)" }
}
ctl.!default {
type pulse
}


But this results in an error because alsa will look for plugins in its
own output directory in the store. With this patch, alsa is able to
find its plugins in ALSA_PLUGIN_DIR after exporting it (export
ALSA_PLUGIN_DIR=$HOME/.guix-profile/lib/alsa-lib).
D
D
Danny Milosavljevic wrote on 17 May 2018 08:01
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 31239@debbugs.gnu.org)
20180517080143.06b1113a@scratchpost.org
Hi Julien,

good idea!

The indentation in the patch files is off (alsa-lib uses tabs in its source code).

Also, what is 0001-Add-support-for-a-ALSA_PLUGIN_DIR-environment-variab.patch
embedded in this patch for? Maybe for upstream? Nice :)

You already patch the individual files in alsa-lib.

Note: It would be possible to use

++ char* plugdir = getenv("ALSA_PLUGIN_DIR") ?: ALSA_PLUGIN_DIR;

instead of

++ char* plugdir = ALSA_PLUGIN_DIR;
++ char* envplugdir = getenv("ALSA_PLUGIN_DIR");
++ if(envplugdir != NULL)
++ plugdir = envplugdir;

(especially since it's repeated multiple times) but maybe that's too obscure.

So LGTM except for the indentation and extra patch file!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlr9GscACgkQ5xo1VCww
uqXY1gf+LT7qPxkyylXr7ALsy1Wv02AIiJsvQkfY1Vo56Eshq1iS6Bzqd6Mb2ElD
6m/6s5rYrjNxBFcGDFcnfyMt5kLNnpGTuLjJmjtCE4P1CiNiSPXQey99YkkuttFc
NjrM2vHcohCfv60Ofq0CjJ3tV/QmfO/ZwLM6QR1dYKJ43YFp854jBLTd1iFf/XG3
qFhpYQePqTaV/tsUFZyKx9LTboQflus9R6YrFS3ZJx5GQfF1ZXL6ZYQID0/2nabW
TKH/1NeUnBG2hK4vQVdfGRHAVPyPfeAAh5l94bUqHme5bLE/R7Pe5EnFKmRHwPX2
GUIxINJI83qf8bxWX0hf5R8GULNBhg==
=J0as
-----END PGP SIGNATURE-----


J
J
Julien Lepiller wrote on 27 May 2018 19:07
(address . 31239-done@debbugs.gnu.org)
20180527190726.32ea8178@lepiller.eu
Le Thu, 17 May 2018 08:01:43 +0200,
Danny Milosavljevic <dannym@scratchpost.org> a écrit :

Toggle quote (29 lines)
> Hi Julien,
>
> good idea!
>
> The indentation in the patch files is off (alsa-lib uses tabs in its
> source code).
>
> Also, what is
> 0001-Add-support-for-a-ALSA_PLUGIN_DIR-environment-variab.patch
> embedded in this patch for? Maybe for upstream? Nice :)
>
> You already patch the individual files in alsa-lib.
>
> Note: It would be possible to use
>
> ++ char* plugdir = getenv("ALSA_PLUGIN_DIR") ?: ALSA_PLUGIN_DIR;
>
> instead of
>
> ++ char* plugdir = ALSA_PLUGIN_DIR;
> ++ char* envplugdir = getenv("ALSA_PLUGIN_DIR");
> ++ if(envplugdir != NULL)
> ++ plugdir = envplugdir;
>
> (especially since it's repeated multiple times) but maybe that's too
> obscure.
>
> So LGTM except for the indentation and extra patch file!

Pushed as 2101cc3fb691f443b830fdf5f846ded5fa018739 on core-updates.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEtfrmKFtBNyiyoPrtQxEfRSAIagwFAlsK5c4ACgkQQxEfRSAI
agwKLxAAnES3JvQ2FK2/4xTsyLmOo36vUG+hdk9N1+oxmuihQHXyErTyaDNWEiP3
dYVPY99+xoDPvcomeKQXd4NBVWjvwKi7VcluRZurV+Bk6VVZ3WhXKdaYKqcukot/
Txmt4fvZsHezqfs1yo4poxvy6aj/JG2cBH15UASNbEhQeGGJpu3eAG8U3mvVOP0d
/1kqM3SPXMDby8vLHmAb+brj5Qrau4gouV5qdVpgMZyvx1+6HNqHqEknAJxqi747
NFm1fanxdDvob6SOQIYA/5B3HMtuYfvV6PPZBeakYywOYzuG2sOaVbwfdDSjDIzz
h9fiIKShiUrIy+ylAKtw/L/lAr+2mw3OtJrSw96Ssnb1C1L/T064lqu8xKfdExde
XxZsMYOBNPcvZe9R+WnyW4nAjtcdzLkzr9e/ZHI0qVZqC8fu8HcUm/kzB4feGz+a
QNdp1HEEcdGAJq1fOMk+rZFgyAq33wHa2CjzMRTAEGvFPwo43zIbrUlvm8msjXz9
pKyCCIsVslPfTtpQWujmyfVIWCiflbJr2f1nz1yeXHZFCijo2aMibMYcnPXwWOeL
gZLV1gPOPaZy/fEMK/x2u2Rlvf1GS2Zgx3PX2ylu77RiOtcL/8Z1xetjBc+r9zzr
eiEEdYu0bRGan7k5WlhaJt4goLLJSDDLxg/HgX6ch5IpDK4i8Cs=
=vklG
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 31239@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 31239
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch