mpd / pulse control issue

  • Open
  • quality assurance status badge
Details
5 participants
  • Bradley Haggerty
  • ???
  • Julien Lepiller
  • Leo Famulari
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Bradley Haggerty
Severity
normal
B
B
Bradley Haggerty wrote on 9 Jun 2018 13:58
(address . bug-guix@gnu.org)
CABGw91f0rxauVJNqcGQxrU1ua2c=Lrvb-zmLoKG6_XyP0GENfQ@mail.gmail.com
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: file
?
(name . Bradley Haggerty)(address . bradigger@gmail.com)(address . 31769@debbugs.gnu.org)
874libidtk.fsf@member.fsf.org
Bradley Haggerty <bradigger@gmail.com> writes:

Toggle quote (7 lines)
> 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:


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:
J
J
Julien Lepiller wrote on 10 Jun 2018 10:15
(address . 31769@debbugs.gnu.org)
1AF31671-633B-45D0-B405-82610F3ADF79@lepiller.eu
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 :
Toggle quote (30 lines)
>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: file
L
L
Leo Famulari wrote on 11 Jun 2018 05:33
(name . Bradley Haggerty)(address . bradigger@gmail.com)(address . 31769@debbugs.gnu.org)
20180611033353.GA24092@jasmine.lan
On Sat, Jun 09, 2018 at 06:58:03AM -0500, Bradley Haggerty wrote:
Toggle quote (5 lines)
> 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))
------
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlsd7Z0ACgkQJkb6MLrK
fwgiww//UbM7j8nUBpvM5Qi/HHuypvoWQRe1krpca9bDYReoH1lRn3BIMkFY6m6K
g9n9c8cuGK3zx5hDj5enpbxw89DgOXrcPSeTy29c+Nrb7FGaEwH6UgXBhcTwf55W
pjg4as4sGbckL8oom1dEBAjh0WRWXvSDcWFztaKFFTz9N5gshKFCuwAUUHGvfKx6
LINIdByFGwpVzDeudukiBtdfGx3BzuglHYL65lVKGPppDPjFSJ18C1fPTkMsuzFu
uvvqFglsD8f1xCyprYlf76olwXp33odnLito9qDTAULQm9A5gSKfA3hrTMSCXrbj
iHbYtEe2MR/DGf1jppDMufVD1qoAYD2yYuoikj/GYInslIDZbPhQbLFaDCIsiXII
6ilkwtleXJyX/x6l3PbuGJA/TedDMdbonjP5Z4tqr+3ley1+xfLlE3upjQSebajD
xFxWN+uVHfWSS1GlLYUDMu8j5rIlBUpOcYwSQNUZpcWfpjpcLFIUbNR7lnXsv7BL
/4TBhh3RvJQIKv6rj3tAH2RRiaY5wkGJATKQkLv+Z3B4GaFQ1Tqe4XXsBgqabkjo
L3ioowWaTG955wuKTtD16fLaYd02i5OByVscwSPMYf9+Z6W2lDTY7U69ZQFiH2MV
LiU6Ra2yBKY3PnI3I59Ww1m5iI5N6/IvzTDLTNkpRvGaC+Fe3Ac=
=NvI2
-----END PGP SIGNATURE-----


M
M
Maxim Cournoyer wrote on 26 Apr 2023 02:08
(name . ???)(address . iyzsong@member.fsf.org)
87sfcno68s.fsf@gmail.com
Hi,

iyzsong@member.fsf.org (???) writes:

Toggle quote (24 lines)
> 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
?
Your comment

Commenting via the web interface is currently disabled.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 31769
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