all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Audio/sound (ALSA) in guix environment --container
@ 2019-03-21 19:50 Pierre Neidhardt
  2019-03-26 17:15 ` Ludovic Courtès
  0 siblings, 1 reply; 12+ messages in thread
From: Pierre Neidhardt @ 2019-03-21 19:50 UTC (permalink / raw)
  To: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 1335 bytes --]

Hi!

I'm trying to run an graphical application with audio in a Guix
environment.

So far:

--8<---------------cut here---------------start------------->8---
guix environment --container \
  --share=/tmp/.X11-unix/ \
  --share=/dev/snd \
  --ad-hoc foo coreutils -- \
  env DISPLAY=$DISPLAY foo "$@"
--8<---------------cut here---------------end--------------->8---

I get this error:

--8<---------------cut here---------------start------------->8---
ALSA lib pcm_direct.c:1943:(snd1_pcm_direct_parse_open_conf) The field ipc_gid must be a valid group (create group audio)
--8<---------------cut here---------------end--------------->8---

I though --share=/dev/snd would help, but I don't think that's useful.
I tried creating the "audio" group in the container or adding the user
to the group, to no avail:

--8<---------------cut here---------------start------------->8---
> guix environment -C --ad-hoc coreutils shadow 
ambrevar@bababa . [env]# groups
groups: cannot find name for group ID 0
0 groups: cannot find name for group ID 65534
65534
ambrevar@bababa . [env]# groupadd foo
groupadd: PAM: Critical error - immediate abort
--8<---------------cut here---------------end--------------->8---

Can anyone get ALSA to work in Guix containers?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Audio/sound (ALSA) in guix environment --container
  2019-03-21 19:50 Audio/sound (ALSA) in guix environment --container Pierre Neidhardt
@ 2019-03-26 17:15 ` Ludovic Courtès
  2019-03-26 17:21   ` Ricardo Wurmus
  0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2019-03-26 17:15 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: Guix-devel

Hello!

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> I'm trying to run an graphical application with audio in a Guix
> environment.
>
> So far:
>
> guix environment --container \
>   --share=/tmp/.X11-unix/ \
>   --share=/dev/snd \
>   --ad-hoc foo coreutils -- \
>   env DISPLAY=$DISPLAY foo "$@"
>
>
> I get this error:
>
> ALSA lib pcm_direct.c:1943:(snd1_pcm_direct_parse_open_conf) The field ipc_gid must be a valid group (create group audio)
>
>
> I though --share=/dev/snd would help, but I don't think that's useful.
> I tried creating the "audio" group in the container or adding the user
> to the group, to no avail:
>
>> guix environment -C --ad-hoc coreutils shadow 
> ambrevar@bababa . [env]# groups
> groups: cannot find name for group ID 0
> 0 groups: cannot find name for group ID 65534
> 65534

Commit 952afb6f8c209692e52f9561965ee39e143e1d88 changes ‘guix
environment’ so that it creates /etc/group, using the brand new (gnu
build accounts) module.

Now ‘id’ and ‘groups’ work fine in containers.

Does it solve the specific problem you were having?  Maybe there are
other things that would need to be done, dunno.

I’m thinking we should change ‘guix environment -C’ to map to a UID
other than zero, at least by default.  When developing code, some tools
may behave differently when running under UID 0 and that’s rarely what
we need I think.  Thoughts?

Ludo’.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Audio/sound (ALSA) in guix environment --container
  2019-03-26 17:15 ` Ludovic Courtès
@ 2019-03-26 17:21   ` Ricardo Wurmus
  2019-03-27 10:11     ` Pierre Neidhardt
  0 siblings, 1 reply; 12+ messages in thread
From: Ricardo Wurmus @ 2019-03-26 17:21 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel


Ludovic Courtès <ludo@gnu.org> writes:

> I’m thinking we should change ‘guix environment -C’ to map to a UID
> other than zero, at least by default.  When developing code, some tools
> may behave differently when running under UID 0 and that’s rarely what
> we need I think.  Thoughts?

I agree.  Defaulting to UID 0 is not good.  (“conda” is an example of
one application that has very different behaviour when it thinks it is
running as root.)

--
Ricardo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Audio/sound (ALSA) in guix environment --container
  2019-03-26 17:21   ` Ricardo Wurmus
@ 2019-03-27 10:11     ` Pierre Neidhardt
  2019-03-27 10:38       ` Ricardo Wurmus
  0 siblings, 1 reply; 12+ messages in thread
From: Pierre Neidhardt @ 2019-03-27 10:11 UTC (permalink / raw)
  To: Ricardo Wurmus, Ludovic Courtès; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]

I've just "guix pull"ed and I get the following:

--8<---------------cut here---------------start------------->8---
> guix environment --container --ad-hoc coreutils shadow 
# id
uid=0(ambrevar) gid=0(users) groups=0(users),65534(overflow)
# groupadd audio
groupadd: PAM: Critical error - immediate abort
# useradd foo
useradd: PAM: Critical error - immediate abort
--8<---------------cut here---------------end--------------->8---

Any idea where to go from here?

Ricardo Wurmus <rekado@elephly.net> writes:

> I agree.  Defaulting to UID 0 is not good.  (“conda” is an example of
> one application that has very different behaviour when it thinks it is
> running as root.)

What about defaulting to 1000?  It's rather common, so I guess that
would be anonymous enough and "just work".

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Audio/sound (ALSA) in guix environment --container
  2019-03-27 10:11     ` Pierre Neidhardt
@ 2019-03-27 10:38       ` Ricardo Wurmus
  2019-03-27 11:05         ` Pierre Neidhardt
  2019-03-27 11:14         ` Ludovic Courtès
  0 siblings, 2 replies; 12+ messages in thread
From: Ricardo Wurmus @ 2019-03-27 10:38 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: Guix-devel


Pierre Neidhardt <mail@ambrevar.xyz> writes:

> I've just "guix pull"ed and I get the following:
>
> --8<---------------cut here---------------start------------->8---
>> guix environment --container --ad-hoc coreutils shadow 
> # id
> uid=0(ambrevar) gid=0(users) groups=0(users),65534(overflow)
> # groupadd audio
> groupadd: PAM: Critical error - immediate abort
> # useradd foo
> useradd: PAM: Critical error - immediate abort
> --8<---------------cut here---------------end--------------->8---
>
> Any idea where to go from here?

I suppose /etc/pam.d/ also needs to be in the container.

> Ricardo Wurmus <rekado@elephly.net> writes:
>
>> I agree.  Defaulting to UID 0 is not good.  (“conda” is an example of
>> one application that has very different behaviour when it thinks it is
>> running as root.)
>
> What about defaulting to 1000?  It's rather common, so I guess that
> would be anonymous enough and "just work".

Would it make sense to map the current user’s UID into the container
instead of using a fixed UID?

-- 
Ricardo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Audio/sound (ALSA) in guix environment --container
  2019-03-27 10:38       ` Ricardo Wurmus
@ 2019-03-27 11:05         ` Pierre Neidhardt
  2019-03-27 11:10           ` Ricardo Wurmus
  2019-03-27 11:14         ` Ludovic Courtès
  1 sibling, 1 reply; 12+ messages in thread
From: Pierre Neidhardt @ 2019-03-27 11:05 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 563 bytes --]

Ricardo Wurmus <rekado@elephly.net> writes:

> I suppose /etc/pam.d/ also needs to be in the container.

Tried it, same error.

>> What about defaulting to 1000?  It's rather common, so I guess that
>> would be anonymous enough and "just work".
>
> Would it make sense to map the current user’s UID into the container
> instead of using a fixed UID?

We have a "--user" option, so we could use the current user's UID when
--user is not specified, 1000 otherwise.
Or better: add a --uid CLI option.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Audio/sound (ALSA) in guix environment --container
  2019-03-27 11:05         ` Pierre Neidhardt
@ 2019-03-27 11:10           ` Ricardo Wurmus
  2019-03-27 15:03             ` Ludovic Courtès
  0 siblings, 1 reply; 12+ messages in thread
From: Ricardo Wurmus @ 2019-03-27 11:10 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: Guix-devel


Pierre Neidhardt <mail@ambrevar.xyz> writes:

> Ricardo Wurmus <rekado@elephly.net> writes:
>
>> I suppose /etc/pam.d/ also needs to be in the container.
>
> Tried it, same error.
>
>>> What about defaulting to 1000?  It's rather common, so I guess that
>>> would be anonymous enough and "just work".
>>
>> Would it make sense to map the current user’s UID into the container
>> instead of using a fixed UID?
>
> We have a "--user" option, so we could use the current user's UID when
> --user is not specified, 1000 otherwise.
> Or better: add a --uid CLI option.

I can see confusion coming from the existence of both “--user” and
“--uid”.  Maybe “--user” could take an optional argument, with the
default being the current user.  Without “--user” we’d use UID 1000.

What do you think?

--
Ricardo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Audio/sound (ALSA) in guix environment --container
  2019-03-27 10:38       ` Ricardo Wurmus
  2019-03-27 11:05         ` Pierre Neidhardt
@ 2019-03-27 11:14         ` Ludovic Courtès
  1 sibling, 0 replies; 12+ messages in thread
From: Ludovic Courtès @ 2019-03-27 11:14 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Guix-devel

Hello,

Ricardo Wurmus <rekado@elephly.net> skribis:

> Would it make sense to map the current user’s UID into the container
> instead of using a fixed UID?

From a reproducibility viewpoint, I’d find it nicer to use a fixed UID
(it can still be mapped to the user’s name anyway.)

We could make it configurable if necessary.  WDYT?

Ludo’.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Audio/sound (ALSA) in guix environment --container
  2019-03-27 11:10           ` Ricardo Wurmus
@ 2019-03-27 15:03             ` Ludovic Courtès
  2019-03-27 15:14               ` Ricardo Wurmus
  0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2019-03-27 15:03 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Guix-devel

Ricardo Wurmus <rekado@elephly.net> skribis:

> Pierre Neidhardt <mail@ambrevar.xyz> writes:
>
>> Ricardo Wurmus <rekado@elephly.net> writes:
>>
>>> I suppose /etc/pam.d/ also needs to be in the container.
>>
>> Tried it, same error.
>>
>>>> What about defaulting to 1000?  It's rather common, so I guess that
>>>> would be anonymous enough and "just work".
>>>
>>> Would it make sense to map the current user’s UID into the container
>>> instead of using a fixed UID?
>>
>> We have a "--user" option, so we could use the current user's UID when
>> --user is not specified, 1000 otherwise.
>> Or better: add a --uid CLI option.
>
> I can see confusion coming from the existence of both “--user” and
> “--uid”.  Maybe “--user” could take an optional argument, with the
> default being the current user.  Without “--user” we’d use UID 1000.

Currently, without --user, we keep the current user’s name.  So it would
actually be consistent to inherit its UID as well.  And with ‘--user’,
we’d use the given user name and UID 1000.  (Essentially what Pierre
proposed above.)

Thoughts?  :-)

Ludo’.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Audio/sound (ALSA) in guix environment --container
  2019-03-27 15:03             ` Ludovic Courtès
@ 2019-03-27 15:14               ` Ricardo Wurmus
  2019-04-02 16:17                 ` Ludovic Courtès
  0 siblings, 1 reply; 12+ messages in thread
From: Ricardo Wurmus @ 2019-03-27 15:14 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel


Ludovic Courtès <ludo@gnu.org> writes:

> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> Pierre Neidhardt <mail@ambrevar.xyz> writes:
>>
>>> Ricardo Wurmus <rekado@elephly.net> writes:
>>>
>>>> I suppose /etc/pam.d/ also needs to be in the container.
>>>
>>> Tried it, same error.
>>>
>>>>> What about defaulting to 1000?  It's rather common, so I guess that
>>>>> would be anonymous enough and "just work".
>>>>
>>>> Would it make sense to map the current user’s UID into the container
>>>> instead of using a fixed UID?
>>>
>>> We have a "--user" option, so we could use the current user's UID when
>>> --user is not specified, 1000 otherwise.
>>> Or better: add a --uid CLI option.
>>
>> I can see confusion coming from the existence of both “--user” and
>> “--uid”.  Maybe “--user” could take an optional argument, with the
>> default being the current user.  Without “--user” we’d use UID 1000.
>
> Currently, without --user, we keep the current user’s name.  So it would
> actually be consistent to inherit its UID as well.  And with ‘--user’,
> we’d use the given user name and UID 1000.  (Essentially what Pierre
> proposed above.)

Excellent, this sounds good.

-- 
Ricardo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Audio/sound (ALSA) in guix environment --container
  2019-03-27 15:14               ` Ricardo Wurmus
@ 2019-04-02 16:17                 ` Ludovic Courtès
  2019-04-03  8:01                   ` Pierre Neidhardt
  0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2019-04-02 16:17 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Guix-devel

Hello!

Ricardo Wurmus <rekado@elephly.net> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:

[...]

>> Currently, without --user, we keep the current user’s name.  So it would
>> actually be consistent to inherit its UID as well.  And with ‘--user’,
>> we’d use the given user name and UID 1000.  (Essentially what Pierre
>> proposed above.)
>
> Excellent, this sounds good.

Done in commit 1ccc0f807d3f22fa9ade1c607c112e04df833a72.

Ludo’.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Audio/sound (ALSA) in guix environment --container
  2019-04-02 16:17                 ` Ludovic Courtès
@ 2019-04-03  8:01                   ` Pierre Neidhardt
  0 siblings, 0 replies; 12+ messages in thread
From: Pierre Neidhardt @ 2019-04-03  8:01 UTC (permalink / raw)
  To: Ludovic Courtès, Ricardo Wurmus; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 223 bytes --]

Nice, just tried it and it's working.
It's also able to start programs I would not start before, so great
success!

I'm still not able to play any sound though.  Anyone?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-04-03  8:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21 19:50 Audio/sound (ALSA) in guix environment --container Pierre Neidhardt
2019-03-26 17:15 ` Ludovic Courtès
2019-03-26 17:21   ` Ricardo Wurmus
2019-03-27 10:11     ` Pierre Neidhardt
2019-03-27 10:38       ` Ricardo Wurmus
2019-03-27 11:05         ` Pierre Neidhardt
2019-03-27 11:10           ` Ricardo Wurmus
2019-03-27 15:03             ` Ludovic Courtès
2019-03-27 15:14               ` Ricardo Wurmus
2019-04-02 16:17                 ` Ludovic Courtès
2019-04-03  8:01                   ` Pierre Neidhardt
2019-03-27 11:14         ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.