GNU bug report logs - #31934
[PATCH] Fix ALSA_PLUGIN_DIR usage

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Fri, 22 Jun 2018 12:40:02 UTC

Severity: normal

Tags: patch

Done: iyzsong <at> member.fsf.org (宋文武)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31934 in the body.
You can then email your comments to 31934 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#31934; Package guix-patches. (Fri, 22 Jun 2018 12:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julien Lepiller <julien <at> lepiller.eu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 22 Jun 2018 12:40:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: guix-patches <at> gnu.org
Subject: [PATCH] Fix ALSA_PLUGIN_DIR usage
Date: Fri, 22 Jun 2018 14:39:33 +0200
[Message part 1 (text/plain, inline)]
Hi, this patch fixes an issue with the patch for alsa-lib and defines a 
search-path rather than a native-search-path. In order to make the 
alsa-service work properly, you still need to have alsa-lib and 
alsa-plugins:pulseaudio in the same profile, and point ALSA_PLUGIN_DIR 
to $PROFILE/lib/alsa-lib.
[0001-gnu-alsa-lib-Fix-ALSA_PLUGIN_DIR-usage.patch (text/x-diff, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#31934; Package guix-patches. (Fri, 22 Jun 2018 19:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 31934 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 31934 <at> debbugs.gnu.org
Subject: Re: [bug#31934] [PATCH] Fix ALSA_PLUGIN_DIR usage
Date: Fri, 22 Jun 2018 21:54:45 +0200
Hello,

Julien Lepiller <julien <at> lepiller.eu> skribis:

> Hi, this patch fixes an issue with the patch for alsa-lib and defines
> a search-path rather than a native-search-path. In order to make the
> alsa-service work properly, you still need to have alsa-lib and
> alsa-plugins:pulseaudio in the same profile, and point ALSA_PLUGIN_DIR
> to $PROFILE/lib/alsa-lib.

Could you clarify which issue this fixes?

Also, I think you really want ‘native-search-paths’ and not
‘search-paths’.  The latter is meant to be used by things like
cross-compilers.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31934; Package guix-patches. (Fri, 22 Jun 2018 20:23:02 GMT) Full text and rfc822 format available.

Message #11 received at 31934 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: 31934 <at> debbugs.gnu.org
Subject: Re: [bug#31934] [PATCH] Fix ALSA_PLUGIN_DIR usage
Date: Fri, 22 Jun 2018 22:22:46 +0200
Le Fri, 22 Jun 2018 21:54:45 +0200,
ludo <at> gnu.org (Ludovic Courtès) a écrit :

> Could you clarify which issue this fixes?
> 
> Also, I think you really want ‘native-search-paths’ and not
> ‘search-paths’.  The latter is meant to be used by things like
> cross-compilers.
> 
> Thanks,
> Ludo’.

The issue was that a part of the code was only partially patched. It
looked like:

plugdir = ALSA_PLUGIN_DIR;
envplugdir = getenv("ALSA_PLUGIN_DIR");
if(envplugdir != NULL)
  plugdir = envplugdir;
...
sofile = malloc(sizeof(plugdir) + ...);
...
sprintf(sofile, "%s/whatever.so", ALSA_PLUGIN_DIR);

If at compilation time ALSA_PLUGIN_DIR is bigger than the runtime
$ALSA_PLUGIN_DIR, we are in trouble: alsa-lib will crash because of a
buffer overflow. Otherwise, it just didn't care about $ALSA_PLUGIN_DIR.
The native-search-paths vs search-paths is a bit confusing... I need to
read the manual more carefully I guess.




Information forwarded to guix-patches <at> gnu.org:
bug#31934; Package guix-patches. (Sat, 23 Jun 2018 21:55:01 GMT) Full text and rfc822 format available.

Message #14 received at 31934 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 31934 <at> debbugs.gnu.org
Subject: Re: [bug#31934] [PATCH] Fix ALSA_PLUGIN_DIR usage
Date: Sat, 23 Jun 2018 23:54:22 +0200
Julien Lepiller <julien <at> lepiller.eu> skribis:

> Le Fri, 22 Jun 2018 21:54:45 +0200,
> ludo <at> gnu.org (Ludovic Courtès) a écrit :
>
>> Could you clarify which issue this fixes?
>> 
>> Also, I think you really want ‘native-search-paths’ and not
>> ‘search-paths’.  The latter is meant to be used by things like
>> cross-compilers.
>> 
>> Thanks,
>> Ludo’.
>
> The issue was that a part of the code was only partially patched. It
> looked like:
>
> plugdir = ALSA_PLUGIN_DIR;
> envplugdir = getenv("ALSA_PLUGIN_DIR");
> if(envplugdir != NULL)
>   plugdir = envplugdir;
> ...
> sofile = malloc(sizeof(plugdir) + ...);
> ...
> sprintf(sofile, "%s/whatever.so", ALSA_PLUGIN_DIR);
>
> If at compilation time ALSA_PLUGIN_DIR is bigger than the runtime
> $ALSA_PLUGIN_DIR, we are in trouble: alsa-lib will crash because of a
> buffer overflow. Otherwise, it just didn't care about $ALSA_PLUGIN_DIR.

Alright, so the patch update can definitely go in!

> The native-search-paths vs search-paths is a bit confusing... I need to
> read the manual more carefully I guess.

The manual doesn’t say much about this, so you have a good excuse.

But anyway, that change is surely not necessary.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31934; Package guix-patches. (Sun, 24 Jun 2018 07:06:02 GMT) Full text and rfc822 format available.

Message #17 received at 31934 <at> debbugs.gnu.org (full text, mbox):

From: iyzsong <at> member.fsf.org (宋文武)
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 31934 <at> debbugs.gnu.org
Subject: Re: [bug#31934] [PATCH] Fix ALSA_PLUGIN_DIR usage
Date: Sun, 24 Jun 2018 15:05:17 +0800
Julien Lepiller <julien <at> lepiller.eu> writes:

> Hi, this patch fixes an issue with the patch for alsa-lib and defines
> a search-path rather than a native-search-path. In order to make the
> alsa-service work properly, you still need to have alsa-lib and
> alsa-plugins:pulseaudio in the same profile, and point ALSA_PLUGIN_DIR
> to $PROFILE/lib/alsa-lib.

Hello, after some hours of searching...  I found that we can use the
'lib' option in 'pcm_type' and 'ctl_type' to specify the library path
for alsa plugins, e.g:

--8<---------------cut here---------------start------------->8---
# Use PulseAudio by default
pcm_type.pulse {
  lib "/gnu/store/icvba55494j4vxb7yp97iya1h6g1l30h-alsa-plugins-1.1.6-pulseaudio/lib/alsa-lib/libasound_module_pcm_pulse.so"
}

ctl_type.pulse {
  lib "/gnu/store/icvba55494j4vxb7yp97iya1h6g1l30h-alsa-plugins-1.1.6-pulseaudio/lib/alsa-lib/libasound_module_ctl_pulse.so"
}

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

ctl.!default {
  type pulse
  fallback "sysdefault"
}
--8<---------------cut here---------------end--------------->8---

So I think we can make our 'alsa-service' do this, instead of patching
alsa-lib for 'ALSA_PLUGIN_DIR'.  We could document it in the manual, so
that a user wanting to use other alsa plugins get a hint to add:
  'lib "/home/xxx/.guix-profile/lib/alsa-lib/libasound_xxx.so"'
in '~/.asoundrc'.  How's this sound?


Also, NixOS did this actually, and they went far to support running
32-bit alsa applications with 64-bit pulseaudio:

https://github.com/NixOS/nixpkgs/commit/0c8ad65560fa1df07ea7b7937e02b44b1ce2b498

I think we don't need this now...




Information forwarded to guix-patches <at> gnu.org:
bug#31934; Package guix-patches. (Sun, 24 Jun 2018 10:46:02 GMT) Full text and rfc822 format available.

Message #20 received at 31934 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: iyzsong <at> member.fsf.org (宋文武)
Cc: Julien Lepiller <julien <at> lepiller.eu>, 31934 <at> debbugs.gnu.org
Subject: Re: [bug#31934] [PATCH] services: sound: Properly handle alsa-plugins.
Date: Sun, 24 Jun 2018 13:44:54 +0300
[Message part 1 (text/plain, inline)]
Hello,

iyzsong <at> member.fsf.org (宋文武) writes:

> Julien Lepiller <julien <at> lepiller.eu> writes:

[…]

> Hello, after some hours of searching...  I found that we can use the
> 'lib' option in 'pcm_type' and 'ctl_type' to specify the library path
> for alsa plugins, e.g:

Thats a nice hack :-)  Thank you for working on this.

[…]

> So I think we can make our 'alsa-service' do this, instead of patching
> alsa-lib for 'ALSA_PLUGIN_DIR'.

Done.  Here is a patch which I tested on my machine by ‘system reconfigure’:
[0001-services-sound-Properly-handle-alsa-plugins.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
[…]

Thanks,
Oleg.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31934; Package guix-patches. (Mon, 25 Jun 2018 15:36:02 GMT) Full text and rfc822 format available.

Message #23 received at 31934 <at> debbugs.gnu.org (full text, mbox):

From: iyzsong <at> member.fsf.org (宋文武)
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: Julien Lepiller <julien <at> lepiller.eu>, 31934 <at> debbugs.gnu.org,
 31591-done <at> debbugs.gnu.org
Subject: Re: [bug#31934] [PATCH] services: sound: Properly handle alsa-plugins.
Date: Mon, 25 Jun 2018 23:34:13 +0800
Oleg Pykhalov <go.wigust <at> gmail.com> writes:

> Hello,
>
> iyzsong <at> member.fsf.org (宋文武) writes:
>
>> Julien Lepiller <julien <at> lepiller.eu> writes:
>
> […]
>
>> Hello, after some hours of searching...  I found that we can use the
>> 'lib' option in 'pcm_type' and 'ctl_type' to specify the library path
>> for alsa plugins, e.g:
>
> Thats a nice hack :-)  Thank you for working on this.
>
> […]
>
>> So I think we can make our 'alsa-service' do this, instead of patching
>> alsa-lib for 'ALSA_PLUGIN_DIR'.
>
> Done.  Here is a patch which I tested on my machine by ‘system reconfigure’:
>

Thank you, I modified it to keep the 'pulseaudio? #f' function, and
pushed :-)




Information forwarded to guix-patches <at> gnu.org:
bug#31934; Package guix-patches. (Mon, 25 Jun 2018 15:38:01 GMT) Full text and rfc822 format available.

Message #26 received at 31934 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: 31934 <at> debbugs.gnu.org
Subject: Re: [bug#31934] [PATCH] services: sound: Properly handle alsa-plugins.
Date: Mon, 25 Jun 2018 17:37:56 +0200
Le 2018-06-25 17:34, iyzsong <at> member.fsf.org a écrit :
> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
> 
>> Hello,
>> 
>> iyzsong <at> member.fsf.org (宋文武) writes:
>> 
>>> Julien Lepiller <julien <at> lepiller.eu> writes:
>> 
>> […]
>> 
>>> Hello, after some hours of searching...  I found that we can use the
>>> 'lib' option in 'pcm_type' and 'ctl_type' to specify the library path
>>> for alsa plugins, e.g:
>> 
>> Thats a nice hack :-)  Thank you for working on this.
>> 
>> […]
>> 
>>> So I think we can make our 'alsa-service' do this, instead of 
>>> patching
>>> alsa-lib for 'ALSA_PLUGIN_DIR'.
>> 
>> Done.  Here is a patch which I tested on my machine by ‘system 
>> reconfigure’:
>> 
> 
> Thank you, I modified it to keep the 'pulseaudio? #f' function, and
> pushed :-)

So maybe we can drop our ALSA_PLUGIN_DIR patch now?




Information forwarded to guix-patches <at> gnu.org:
bug#31934; Package guix-patches. (Tue, 26 Jun 2018 11:41:02 GMT) Full text and rfc822 format available.

Message #29 received at 31934 <at> debbugs.gnu.org (full text, mbox):

From: iyzsong <at> member.fsf.org (宋文武)
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: rekado <at> elephly.net, 31934 <at> debbugs.gnu.org
Subject: Re: [bug#31934] [PATCH] services: sound: Properly handle alsa-plugins.
Date: Tue, 26 Jun 2018 19:38:44 +0800
Julien Lepiller <julien <at> lepiller.eu> writes:

> Le 2018-06-25 17:34, iyzsong <at> member.fsf.org a écrit :
>> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>>
>>> Hello,
>>>
>>> iyzsong <at> member.fsf.org (宋文武) writes:
>>>
>>>> Julien Lepiller <julien <at> lepiller.eu> writes:
>>>
>>> […]
>>>
>>>> Hello, after some hours of searching...  I found that we can use the
>>>> 'lib' option in 'pcm_type' and 'ctl_type' to specify the library path
>>>> for alsa plugins, e.g:
>>>
>>> Thats a nice hack :-)  Thank you for working on this.
>>>
>>> […]
>>>
>>>> So I think we can make our 'alsa-service' do this, instead of
>>>> patching
>>>> alsa-lib for 'ALSA_PLUGIN_DIR'.
>>>
>>> Done.  Here is a patch which I tested on my machine by ‘system
>>> reconfigure’:
>>>
>>
>> Thank you, I modified it to keep the 'pulseaudio? #f' function, and
>> pushed :-)
>
> So maybe we can drop our ALSA_PLUGIN_DIR patch now?

Yes, I think so.  @Ricardo, should we do it in core-updates?




Information forwarded to guix-patches <at> gnu.org:
bug#31934; Package guix-patches. (Tue, 26 Jun 2018 11:50:02 GMT) Full text and rfc822 format available.

Message #32 received at 31934 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: 宋文武 <iyzsong <at> member.fsf.org>, Julien Lepiller
 <julien <at> lepiller.eu>
Cc: rekado <at> elephly.net, 31934 <at> debbugs.gnu.org
Subject: Re: [bug#31934] [PATCH] services: sound: Properly handle alsa-plugins.
Date: Tue, 26 Jun 2018 13:49:52 +0200
[Message part 1 (text/plain, inline)]
iyzsong <at> member.fsf.org (宋文武) writes:

> Julien Lepiller <julien <at> lepiller.eu> writes:
>
>> Le 2018-06-25 17:34, iyzsong <at> member.fsf.org a écrit :
>>> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>>>
>>>> Hello,
>>>>
>>>> iyzsong <at> member.fsf.org (宋文武) writes:
>>>>
>>>>> Julien Lepiller <julien <at> lepiller.eu> writes:
>>>>
>>>> […]
>>>>
>>>>> Hello, after some hours of searching...  I found that we can use the
>>>>> 'lib' option in 'pcm_type' and 'ctl_type' to specify the library path
>>>>> for alsa plugins, e.g:
>>>>
>>>> Thats a nice hack :-)  Thank you for working on this.
>>>>
>>>> […]
>>>>
>>>>> So I think we can make our 'alsa-service' do this, instead of
>>>>> patching
>>>>> alsa-lib for 'ALSA_PLUGIN_DIR'.
>>>>
>>>> Done.  Here is a patch which I tested on my machine by ‘system
>>>> reconfigure’:
>>>>
>>>
>>> Thank you, I modified it to keep the 'pulseaudio? #f' function, and
>>> pushed :-)
>>
>> So maybe we can drop our ALSA_PLUGIN_DIR patch now?
>
> Yes, I think so.  @Ricardo, should we do it in core-updates?

If you're quick, you can do it on 'staging' which I'll attempt to
re-start during today.
[signature.asc (application/pgp-signature, inline)]

Reply sent to iyzsong <at> member.fsf.org (宋文武):
You have taken responsibility. (Tue, 26 Jun 2018 12:36:01 GMT) Full text and rfc822 format available.

Notification sent to Julien Lepiller <julien <at> lepiller.eu>:
bug acknowledged by developer. (Tue, 26 Jun 2018 12:36:02 GMT) Full text and rfc822 format available.

Message #37 received at 31934-done <at> debbugs.gnu.org (full text, mbox):

From: iyzsong <at> member.fsf.org (宋文武)
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: Julien Lepiller <julien <at> lepiller.eu>, 31934-done <at> debbugs.gnu.org
Subject: Re: [bug#31934] [PATCH] services: sound: Properly handle alsa-plugins.
Date: Tue, 26 Jun 2018 20:34:53 +0800
Marius Bakke <mbakke <at> fastmail.com> writes:

> iyzsong <at> member.fsf.org (宋文武) writes:
>
>> Julien Lepiller <julien <at> lepiller.eu> writes:
>>
>>> Le 2018-06-25 17:34, iyzsong <at> member.fsf.org a écrit :
>>>> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>>>>
>>>>> Hello,
>>>>>
>>>>> iyzsong <at> member.fsf.org (宋文武) writes:
>>>>>
>>>>>> Julien Lepiller <julien <at> lepiller.eu> writes:
>>>>>
>>>>> […]
>>>>>
>>>>>> Hello, after some hours of searching...  I found that we can use the
>>>>>> 'lib' option in 'pcm_type' and 'ctl_type' to specify the library path
>>>>>> for alsa plugins, e.g:
>>>>>
>>>>> Thats a nice hack :-)  Thank you for working on this.
>>>>>
>>>>> […]
>>>>>
>>>>>> So I think we can make our 'alsa-service' do this, instead of
>>>>>> patching
>>>>>> alsa-lib for 'ALSA_PLUGIN_DIR'.
>>>>>
>>>>> Done.  Here is a patch which I tested on my machine by ‘system
>>>>> reconfigure’:
>>>>>
>>>>
>>>> Thank you, I modified it to keep the 'pulseaudio? #f' function, and
>>>> pushed :-)
>>>
>>> So maybe we can drop our ALSA_PLUGIN_DIR patch now?
>>
>> Yes, I think so.  @Ricardo, should we do it in core-updates?
>
> If you're quick, you can do it on 'staging' which I'll attempt to
> re-start during today.

Done, thanks!

And we can close this patch now...




Information forwarded to guix-patches <at> gnu.org:
bug#31934; Package guix-patches. (Tue, 26 Jun 2018 13:00:03 GMT) Full text and rfc822 format available.

Message #40 received at 31934-done <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: 宋文武 <iyzsong <at> member.fsf.org>
Cc: Julien Lepiller <julien <at> lepiller.eu>, 31934-done <at> debbugs.gnu.org
Subject: Re: [bug#31934] [PATCH] services: sound: Properly handle alsa-plugins.
Date: Tue, 26 Jun 2018 14:59:24 +0200
[Message part 1 (text/plain, inline)]
iyzsong <at> member.fsf.org (宋文武) writes:

> Marius Bakke <mbakke <at> fastmail.com> writes:
>
>> iyzsong <at> member.fsf.org (宋文武) writes:
>>
>>> Julien Lepiller <julien <at> lepiller.eu> writes:
>>>
>>>> Le 2018-06-25 17:34, iyzsong <at> member.fsf.org a écrit :
>>>>> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> iyzsong <at> member.fsf.org (宋文武) writes:
>>>>>>
>>>>>>> Julien Lepiller <julien <at> lepiller.eu> writes:
>>>>>>
>>>>>> […]
>>>>>>
>>>>>>> Hello, after some hours of searching...  I found that we can use the
>>>>>>> 'lib' option in 'pcm_type' and 'ctl_type' to specify the library path
>>>>>>> for alsa plugins, e.g:
>>>>>>
>>>>>> Thats a nice hack :-)  Thank you for working on this.
>>>>>>
>>>>>> […]
>>>>>>
>>>>>>> So I think we can make our 'alsa-service' do this, instead of
>>>>>>> patching
>>>>>>> alsa-lib for 'ALSA_PLUGIN_DIR'.
>>>>>>
>>>>>> Done.  Here is a patch which I tested on my machine by ‘system
>>>>>> reconfigure’:
>>>>>>
>>>>>
>>>>> Thank you, I modified it to keep the 'pulseaudio? #f' function, and
>>>>> pushed :-)
>>>>
>>>> So maybe we can drop our ALSA_PLUGIN_DIR patch now?
>>>
>>> Yes, I think so.  @Ricardo, should we do it in core-updates?
>>
>> If you're quick, you can do it on 'staging' which I'll attempt to
>> re-start during today.
>
> Done, thanks!

Thanks!  I've spun the Hydra lucky wheel:

https://hydra.gnu.org/jobset/gnu/staging

If we won, the new build jobs will start in about 8 hours.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31934; Package guix-patches. (Tue, 26 Jun 2018 14:04:02 GMT) Full text and rfc822 format available.

Message #43 received at 31934 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 31934 <at> debbugs.gnu.org
Subject: Re: [bug#31934] [PATCH] services: sound: Properly handle alsa-plugins.
Date: Tue, 26 Jun 2018 16:02:58 +0200
Julien Lepiller <julien <at> lepiller.eu> skribis:

> So maybe we can drop our ALSA_PLUGIN_DIR patch now?

It may still be useful on foreign distros, no?

Ludo’.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 25 Jul 2018 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 276 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.