unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#38075] [PATCH] services: mpd: add pulseaudio support
@ 2019-11-05 22:46 Robert Smith
  2019-11-06 11:22 ` Ludovic Courtès
  2019-11-08 20:34 ` bug#38075: " Tobias Geerinckx-Rice via Guix-patches via
  0 siblings, 2 replies; 8+ messages in thread
From: Robert Smith @ 2019-11-05 22:46 UTC (permalink / raw)
  To: 38075; +Cc: Robert Smith

Set the XDG_RUNTIME_PATH environment variable in the mpd service so
that it can detect pulseaudio when run under a user account.
---
 gnu/services/audio.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
index 471c5fd95f..424ccc7c8f 100644
--- a/gnu/services/audio.scm
+++ b/gnu/services/audio.scm
@@ -140,6 +140,12 @@ audio_output {
                    "--no-daemon"
                    #$(mpd-config->file config))
              #:pid-file #$(mpd-file-name config "pid")
+             #:environment-variables
+             '(#$(string-append
+                   "XDG_RUNTIME_DIR=/run/user/"
+                   (number->string
+                     (passwd:uid 
+                       (getpwnam (mpd-configuration-user config))))))
              #:log-file #$(mpd-file-name config "log")))
    (stop  #~(make-kill-destructor))))
 
-- 
2.23.0

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

* [bug#38075] [PATCH] services: mpd: add pulseaudio support
  2019-11-05 22:46 [bug#38075] [PATCH] services: mpd: add pulseaudio support Robert Smith
@ 2019-11-06 11:22 ` Ludovic Courtès
  2019-11-06 13:32   ` Robert Smith
                     ` (2 more replies)
  2019-11-08 20:34 ` bug#38075: " Tobias Geerinckx-Rice via Guix-patches via
  1 sibling, 3 replies; 8+ messages in thread
From: Ludovic Courtès @ 2019-11-06 11:22 UTC (permalink / raw)
  To: Robert Smith; +Cc: 38075, Tobias Geerinckx-Rice, Leo Famulari

Hi,

(Cc’ing Leo and Tobias who have been taking care of the mpd package and
service.)

Robert Smith <robertsmith@posteo.net> skribis:

> Set the XDG_RUNTIME_PATH environment variable in the mpd service so
> that it can detect pulseaudio when run under a user account.
> ---
>  gnu/services/audio.scm | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
> index 471c5fd95f..424ccc7c8f 100644
> --- a/gnu/services/audio.scm
> +++ b/gnu/services/audio.scm
> @@ -140,6 +140,12 @@ audio_output {
>                     "--no-daemon"
>                     #$(mpd-config->file config))
>               #:pid-file #$(mpd-file-name config "pid")
> +             #:environment-variables
> +             '(#$(string-append
> +                   "XDG_RUNTIME_DIR=/run/user/"
> +                   (number->string
> +                     (passwd:uid 
> +                       (getpwnam (mpd-configuration-user config))))))
>               #:log-file #$(mpd-file-name config "log")))

I suppose this is meant for the libpulse client library, right?  (I’m
surprised it’s not the default, but apparently that’s the way it is.)

Note that this also has an effect on mpd itself from what I can see in
the source: mpd will listen to $XDG_RUNTIME_DIR/mpd/socket instead of
(in addition to?) listening on TCP.

I don’t use mpd myself; could you ensure that the socket change is also
fine and doesn’t cause any troubles for mpd clients?

Thanks,
Ludo’.

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

* [bug#38075] [PATCH] services: mpd: add pulseaudio support
  2019-11-06 11:22 ` Ludovic Courtès
@ 2019-11-06 13:32   ` Robert Smith
  2019-11-06 18:27   ` Leo Famulari
  2019-11-08 19:53   ` Tobias Geerinckx-Rice via Guix-patches via
  2 siblings, 0 replies; 8+ messages in thread
From: Robert Smith @ 2019-11-06 13:32 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 38075, Tobias Geerinckx-Rice, Leo Famulari


On 06.11.2019 12:22, Ludovic Courtès wrote:
> 
> Note that this also has an effect on mpd itself from what I can see in
> the source: mpd will listen to $XDG_RUNTIME_DIR/mpd/socket instead of
> (in addition to?) listening on TCP.
> 
> I don’t use mpd myself; could you ensure that the socket change is also
> fine and doesn’t cause any troubles for mpd clients?

I've been using the ncmpcpp client, and the functionality is unchanged.
I can confirm that the mpd still listens to TCP port 6600, the only
difference being that the output is sent to pulseaudio.

-Robert

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

* [bug#38075] [PATCH] services: mpd: add pulseaudio support
  2019-11-06 11:22 ` Ludovic Courtès
  2019-11-06 13:32   ` Robert Smith
@ 2019-11-06 18:27   ` Leo Famulari
  2019-11-06 23:54     ` Robert Smith
  2019-11-08 19:53   ` Tobias Geerinckx-Rice via Guix-patches via
  2 siblings, 1 reply; 8+ messages in thread
From: Leo Famulari @ 2019-11-06 18:27 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Robert Smith, 38075, Tobias Geerinckx-Rice

On Wed, Nov 06, 2019 at 12:22:29PM +0100, Ludovic Courtès wrote:
> (Cc’ing Leo and Tobias who have been taking care of the mpd package and
> service.)

I haven't been using the MPD service so I don't really have an opinion
on this patch. Starting it "by hand", the pulse output works for me
already. But it would be great if our service worked "out of the box"
with Pulseaudio.

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

* [bug#38075] [PATCH] services: mpd: add pulseaudio support
  2019-11-06 18:27   ` Leo Famulari
@ 2019-11-06 23:54     ` Robert Smith
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Smith @ 2019-11-06 23:54 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 38075, Ludovic Courtès, Tobias Geerinckx-Rice



On 06.11.2019 19:27, Leo Famulari wrote:
> I haven't been using the MPD service so I don't really have an opinion
> on this patch. Starting it "by hand", the pulse output works for me
> already. But it would be great if our service worked "out of the box"
> with Pulseaudio.

I'm not sure how common my use case is (running mpd locally under
my own user account) but since we are supporting the pulse output
mode in the service configuration, I think we need to make sure that
it works. Currently when the mpd service is started under my account
with the pulse output, it fails to connect to pulse because of the
missing environment variable, and defaults to alsa. This is unfortunate
because the whole point of using pulse for me is to make sure
different apps "play nicely" with each other when playing audio.
Thankfully this is a relatively simple fix.

I also installed the sonata client to make sure that other clients
weren't acting funny, and everything seems normal!

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

* [bug#38075] [PATCH] services: mpd: add pulseaudio support
  2019-11-06 11:22 ` Ludovic Courtès
  2019-11-06 13:32   ` Robert Smith
  2019-11-06 18:27   ` Leo Famulari
@ 2019-11-08 19:53   ` Tobias Geerinckx-Rice via Guix-patches via
  2019-11-08 20:28     ` Peter Mikkelsen
  2 siblings, 1 reply; 8+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2019-11-08 19:53 UTC (permalink / raw)
  To: Ludovic Courtès, Peter Mikkelsen; +Cc: Robert Smith, 38075, Leo Famulari

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

Peter [CC'd],

I see that you added the Guix MPD service in 2017, and wrote then 
that it ‘uses pulseaudio for output’[0].  Do you have an opinion 
on this patch[1]?  Did something change?

Kind regards,

T G-R

[0]: http://guix.gnu.org/manual/en/html_node/Audio-Services.html
[1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38075

Ludovic Courtès 写道:
> Robert Smith <robertsmith@posteo.net> skribis:
>
>> Set the XDG_RUNTIME_PATH environment variable in the mpd 
>> service so
>> that it can detect pulseaudio when run under a user account.
>> ---
>>  gnu/services/audio.scm | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
>> index 471c5fd95f..424ccc7c8f 100644
>> --- a/gnu/services/audio.scm
>> +++ b/gnu/services/audio.scm
>> @@ -140,6 +140,12 @@ audio_output {
>>                     "--no-daemon"
>>                     #$(mpd-config->file config))
>>               #:pid-file #$(mpd-file-name config "pid")
>> +             #:environment-variables
>> +             '(#$(string-append
>> +                   "XDG_RUNTIME_DIR=/run/user/"
>> +                   (number->string
>> +                     (passwd:uid 
>> +                       (getpwnam (mpd-configuration-user 
>> config))))))
>>               #:log-file #$(mpd-file-name config "log")))
>
> I suppose this is meant for the libpulse client library, right? 
> (I’m
> surprised it’s not the default, but apparently that’s the way it 
> is.)
>
> Note that this also has an effect on mpd itself from what I can 
> see in
> the source: mpd will listen to $XDG_RUNTIME_DIR/mpd/socket 
> instead of
> (in addition to?) listening on TCP.
>
> I don’t use mpd myself; could you ensure that the socket change 
> is also
> fine and doesn’t cause any troubles for mpd clients?

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

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

* [bug#38075] [PATCH] services: mpd: add pulseaudio support
  2019-11-08 19:53   ` Tobias Geerinckx-Rice via Guix-patches via
@ 2019-11-08 20:28     ` Peter Mikkelsen
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Mikkelsen @ 2019-11-08 20:28 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice
  Cc: Robert Smith, 38075, Ludovic Courtès, Leo Famulari

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

Hi Tobias,

Unfortunately I don't use mpd anymore and I don't have a good understanding
of how it works anymore.

Cheers,
Peter Mikkelsen

fre. 8. nov. 2019 20.53 skrev Tobias Geerinckx-Rice <me@tobias.gr>:

> Peter [CC'd],
>
> I see that you added the Guix MPD service in 2017, and wrote then
> that it ‘uses pulseaudio for output’[0].  Do you have an opinion
> on this patch[1]?  Did something change?
>
> Kind regards,
>
> T G-R
>
> [0]: http://guix.gnu.org/manual/en/html_node/Audio-Services.html
> [1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38075
>
> Ludovic Courtès 写道:
> > Robert Smith <robertsmith@posteo.net> skribis:
> >
> >> Set the XDG_RUNTIME_PATH environment variable in the mpd
> >> service so
> >> that it can detect pulseaudio when run under a user account.
> >> ---
> >>  gnu/services/audio.scm | 6 ++++++
> >>  1 file changed, 6 insertions(+)
> >>
> >> diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
> >> index 471c5fd95f..424ccc7c8f 100644
> >> --- a/gnu/services/audio.scm
> >> +++ b/gnu/services/audio.scm
> >> @@ -140,6 +140,12 @@ audio_output {
> >>                     "--no-daemon"
> >>                     #$(mpd-config->file config))
> >>               #:pid-file #$(mpd-file-name config "pid")
> >> +             #:environment-variables
> >> +             '(#$(string-append
> >> +                   "XDG_RUNTIME_DIR=/run/user/"
> >> +                   (number->string
> >> +                     (passwd:uid
> >> +                       (getpwnam (mpd-configuration-user
> >> config))))))
> >>               #:log-file #$(mpd-file-name config "log")))
> >
> > I suppose this is meant for the libpulse client library, right?
> > (I’m
> > surprised it’s not the default, but apparently that’s the way it
> > is.)
> >
> > Note that this also has an effect on mpd itself from what I can
> > see in
> > the source: mpd will listen to $XDG_RUNTIME_DIR/mpd/socket
> > instead of
> > (in addition to?) listening on TCP.
> >
> > I don’t use mpd myself; could you ensure that the socket change
> > is also
> > fine and doesn’t cause any troubles for mpd clients?
>

[-- Attachment #2: Type: text/html, Size: 3333 bytes --]

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

* bug#38075: [PATCH] services: mpd: add pulseaudio support
  2019-11-05 22:46 [bug#38075] [PATCH] services: mpd: add pulseaudio support Robert Smith
  2019-11-06 11:22 ` Ludovic Courtès
@ 2019-11-08 20:34 ` Tobias Geerinckx-Rice via Guix-patches via
  1 sibling, 0 replies; 8+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2019-11-08 20:34 UTC (permalink / raw)
  To: 38075-done, Robert Smith

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

Robert,

Thanks for the patch!

Robert Smith 写道:
> +             #:environment-variables
> +             '(#$(string-append
> +                   "XDG_RUNTIME_DIR=/run/user/"
> +                   (number->string
> +                     (passwd:uid 
> +                       (getpwnam (mpd-configuration-user 
> config))))))

Like Ludo', I'm surprised this isn't the default.  My XDG-foo is 
weak, though.

Your patch failed to break my set-up (better luck next time) so 
I've pushed it as 970cb5ceceaa85765230a9f896a43783cdcb4e6c with 
the following tweaks:

- Adjusted the commit message to follow the GNU change log 
  standards & Guix's conventions
- Promoted your commenty commit message to first-class comment
- Removed a trailing space after ‘passwd:uid’ (git diff/show/… 
  should highlight this)

Kind regards,

T G-R

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

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

end of thread, other threads:[~2019-11-08 20:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-05 22:46 [bug#38075] [PATCH] services: mpd: add pulseaudio support Robert Smith
2019-11-06 11:22 ` Ludovic Courtès
2019-11-06 13:32   ` Robert Smith
2019-11-06 18:27   ` Leo Famulari
2019-11-06 23:54     ` Robert Smith
2019-11-08 19:53   ` Tobias Geerinckx-Rice via Guix-patches via
2019-11-08 20:28     ` Peter Mikkelsen
2019-11-08 20:34 ` bug#38075: " Tobias Geerinckx-Rice via Guix-patches via

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).