unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31769: mpd / pulse control issue
@ 2018-06-09 11:58 Bradley Haggerty
  2018-06-10  2:18 ` 宋文武
  2018-06-11  3:33 ` Leo Famulari
  0 siblings, 2 replies; 5+ messages in thread
From: Bradley Haggerty @ 2018-06-09 11:58 UTC (permalink / raw)
  To: 31769

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

I have mpd enabled as a herd service. When I start my computer, mpd can
play my music fine, but pavucontrol can't connect to pulse and show my
volume controls. If I kill pulse and open pavucontrol, all my volume
controls are visible, but then mpd can't play music. If I kill pulse again
and this time play a song in mpd, mpd works again, but pavucontrol can't
connect. Basically, if mpd starts pulse, mpd works, but other things can't
connect, and if pavucontrol starts pulse, mpd can't connect to pulse. Since
I have mpd enabled as a service, it's the one to start pulse on a fresh
boot. I also tried starting pulse as my user by killing it and opening
pavucontrol, then restarting the mpd service in case it could find my pulse
service this way. No success there. While mpd has control of pulse, other
applications also lack sounds, such as mpv (video players) and icecat.

mpd version: 0.20.20
OS: GuixSD c300cae68233ec7cbf50c40bdea7c191eed21e54 x86_64

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

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

* bug#31769: mpd / pulse control issue
  2018-06-09 11:58 bug#31769: mpd / pulse control issue Bradley Haggerty
@ 2018-06-10  2:18 ` 宋文武
  2018-06-10  8:15   ` Julien Lepiller
  2023-04-26  0:08   ` Maxim Cournoyer
  2018-06-11  3:33 ` Leo Famulari
  1 sibling, 2 replies; 5+ messages in thread
From: 宋文武 @ 2018-06-10  2:18 UTC (permalink / raw)
  To: Bradley Haggerty; +Cc: 31769

Bradley Haggerty <bradigger@gmail.com> writes:

> I have mpd enabled as a herd service. When I start my computer, mpd can play my music fine, but pavucontrol can't connect to pulse and show my volume controls. If I
> kill pulse and open pavucontrol, all my volume controls are visible, but then mpd can't play music. If I kill pulse again and this time play a song in mpd, mpd works again,
> but pavucontrol can't connect. Basically, if mpd starts pulse, mpd works, but other things can't connect, and if pavucontrol starts pulse, mpd can't connect to pulse. Since
> I have mpd enabled as a service, it's the one to start pulse on a fresh boot. I also tried starting pulse as my user by killing it and opening pavucontrol, then restarting the
> mpd service in case it could find my pulse service this way. No success there. While mpd has control of pulse, other applications also lack sounds, such as mpv (video
> players) and icecat.

According to the wiki of ArchLinux, users of PulseAudio with a
system-wide MPD configuration have to implement a workaground:

<https://wiki.archlinux.org/index.php/Music_Player_Daemon/Tips_and_tricks#Local_.28with_separate_mpd_user.29>

It suggests letting mpd use pulseaudio's tcp module to send sound to
localhost, where user's pulseaudio server listening.

This seems too tricky for me, I'll suggest you forget the system herd
service, and launch mpd as a normal user:
<https://wiki.archlinux.org/index.php/Music_Player_Daemon#Per-user_configuration>.

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

* bug#31769: mpd / pulse control issue
  2018-06-10  2:18 ` 宋文武
@ 2018-06-10  8:15   ` Julien Lepiller
  2023-04-26  0:08   ` Maxim Cournoyer
  1 sibling, 0 replies; 5+ messages in thread
From: Julien Lepiller @ 2018-06-10  8:15 UTC (permalink / raw)
  Cc: 31769

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

I think the best solution is to implement this in our herd service. It doesn't look too difficult to do the part in the mpd configuration, but pulseaudio might be trickier to configure...

Le 10 juin 2018 04:18:47 GMT+02:00, iyzsong@member.fsf.org a écrit :
>Bradley Haggerty <bradigger@gmail.com> writes:
>
>> I have mpd enabled as a herd service. When I start my computer, mpd
>can play my music fine, but pavucontrol can't connect to pulse and show
>my volume controls. If I
>> kill pulse and open pavucontrol, all my volume controls are visible,
>but then mpd can't play music. If I kill pulse again and this time play
>a song in mpd, mpd works again,
>> but pavucontrol can't connect. Basically, if mpd starts pulse, mpd
>works, but other things can't connect, and if pavucontrol starts pulse,
>mpd can't connect to pulse. Since
>> I have mpd enabled as a service, it's the one to start pulse on a
>fresh boot. I also tried starting pulse as my user by killing it and
>opening pavucontrol, then restarting the
>> mpd service in case it could find my pulse service this way. No
>success there. While mpd has control of pulse, other applications also
>lack sounds, such as mpv (video
>> players) and icecat.
>
>According to the wiki of ArchLinux, users of PulseAudio with a
>system-wide MPD configuration have to implement a workaground:
>
><https://wiki.archlinux.org/index.php/Music_Player_Daemon/Tips_and_tricks#Local_.28with_separate_mpd_user.29>
>
>It suggests letting mpd use pulseaudio's tcp module to send sound to
>localhost, where user's pulseaudio server listening.
>
>This seems too tricky for me, I'll suggest you forget the system herd
>service, and launch mpd as a normal user:
><https://wiki.archlinux.org/index.php/Music_Player_Daemon#Per-user_configuration>.

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

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

* bug#31769: mpd / pulse control issue
  2018-06-09 11:58 bug#31769: mpd / pulse control issue Bradley Haggerty
  2018-06-10  2:18 ` 宋文武
@ 2018-06-11  3:33 ` Leo Famulari
  1 sibling, 0 replies; 5+ messages in thread
From: Leo Famulari @ 2018-06-11  3:33 UTC (permalink / raw)
  To: Bradley Haggerty; +Cc: 31769

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

On Sat, Jun 09, 2018 at 06:58:03AM -0500, Bradley Haggerty wrote:
> When I start my computer, mpd can play my music fine, but pavucontrol can't
> connect to pulse and show my volume controls. If I kill pulse and open
> pavucontrol, all my volume controls are visible, but then mpd can't play
> music.

As 宋文武 and Julien said, this should be fixed in our service but it might be
tricky to do without being able to listen to music ;)

In the meantime, If it suits your needs, you can run MPD with your
unprivileged user instead of at the system level.

Below is a file I use to start MPD as my own user on GuixSD, and it
seems to do the right thing regarding PulseAudio, although I use
pulsemixer instead of pavucontrol.

I originally copied the file from Dave Thompson... any mistakes are my
own :)

By the way, the file should be named '~/.config/shepherd/init.scm'.

------
;; To use this automatically, add something like the following line to
;; whatever gets sourced for a login shell:
;;
;; [[ -z $(pgrep -U $(id --user) shepherd) ]] && shepherd & > /dev/null
;;
;; Or, just invoke `shepherd`.

(use-modules (ice-9 match)
             (srfi srfi-1)
             (system repl server))

(define (touch-file file)
  (close-port (open-file file "a0b")))

(register-services

  (make <service>
    #:provides '(mpd)
    #:requires '() 
    #:start (lambda args
              (define (mpd-dir file)
                (string-append (getenv "HOME") "/.mpd/" file))
              (unless (file-exists? (mpd-dir "playlists"))
                (mkdir (mpd-dir "playlists")))
              (touch-file (mpd-dir "database"))
              (fork+exec-command
               (list "mpd" "--no-daemon")))
    #:stop (make-kill-destructor)))

(action 'shepherd 'daemonize)

(for-each start '(mpd))
------

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

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

* bug#31769: mpd / pulse control issue
  2018-06-10  2:18 ` 宋文武
  2018-06-10  8:15   ` Julien Lepiller
@ 2023-04-26  0:08   ` Maxim Cournoyer
  1 sibling, 0 replies; 5+ messages in thread
From: Maxim Cournoyer @ 2023-04-26  0:08 UTC (permalink / raw)
  To: 宋文武; +Cc: 31769, Bradley Haggerty

Hi,

iyzsong@member.fsf.org (宋文武) writes:

> Bradley Haggerty <bradigger@gmail.com> writes:
>
>> I have mpd enabled as a herd service. When I start my computer, mpd
>> can play my music fine, but pavucontrol can't connect to pulse and
>> show my volume controls. If I
>> kill pulse and open pavucontrol, all my volume controls are visible,
>> but then mpd can't play music. If I kill pulse again and this time
>> play a song in mpd, mpd works again,
>> but pavucontrol can't connect. Basically, if mpd starts pulse, mpd
>> works, but other things can't connect, and if pavucontrol starts
>> pulse, mpd can't connect to pulse. Since
>> I have mpd enabled as a service, it's the one to start pulse on a
>> fresh boot. I also tried starting pulse as my user by killing it and
>> opening pavucontrol, then restarting the
>> mpd service in case it could find my pulse service this way. No
>> success there. While mpd has control of pulse, other applications
>> also lack sounds, such as mpv (video
>> players) and icecat.
>
> According to the wiki of ArchLinux, users of PulseAudio with a
> system-wide MPD configuration have to implement a workaground:
>
> <https://wiki.archlinux.org/index.php/Music_Player_Daemon/Tips_and_tricks#Local_.28with_separate_mpd_user.29>

Could this happen to have been fixed by
bc30a9ee889fb1b81c43a7f94ea4c2b95a15db75 ("services: mpd: Set
PulseAudio-related variables.") ?  I'm not sure I understand what the
issue is exactly, but that commit did do some pulseaudio-related configuration.

-- 
Thanks,
Maxim




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

end of thread, other threads:[~2023-04-26  0:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-09 11:58 bug#31769: mpd / pulse control issue Bradley Haggerty
2018-06-10  2:18 ` 宋文武
2018-06-10  8:15   ` Julien Lepiller
2023-04-26  0:08   ` Maxim Cournoyer
2018-06-11  3:33 ` Leo Famulari

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).