Editing pulseaudio config file fails with "No such file or directory"

  • Done
  • quality assurance status badge
Details
4 participants
  • Leo Prikler
  • Maxim Cournoyer
  • Nathan Dehnel
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Nathan Dehnel
Severity
normal
N
N
Nathan Dehnel wrote on 29 Jun 2020 09:34
(address . bug-guix@gnu.org)
CAEEhgEuYiWkSJg-c8PS3Ka0s=HD1RybTWYWMDg6Mi7o2pXNNCg@mail.gmail.com
Relevant snippet:
(define %my-services
;; My very own list of services.
(modify-services %desktop-services
(pulseaudio-service-type config =>
(pulseaudio-configuration
(inherit config)
(script-file
"/home/nathan/.config/pulse/default.pa")))))

/home/nathan/guix/config.scm:
;; This is an operating system configuration generated
;; by the graphical installer.

(use-modules (gnu))
(use-service-modules desktop networking ssh xorg)
;; Import nonfree linux module.
(use-modules (nongnu packages linux)
(nongnu system linux-initrd))
(use-modules (gnu services sound))
(use-modules (gnu packages pulseaudio))

(define %my-services
;; My very own list of services.
(modify-services %desktop-services
(pulseaudio-service-type config =>
(pulseaudio-configuration
(inherit config)
(script-file
"/home/nathan/.config/pulse/default.pa")))))

(operating-system
(kernel linux)
(initrd microcode-initrd)
(firmware (list linux-firmware))
(locale "en_US.utf8")
(timezone "America/Chicago")
(keyboard-layout
(keyboard-layout "us" "altgr-intl"))
(bootloader
(bootloader-configuration
(bootloader grub-efi-bootloader)
(target "/boot/efi")
(keyboard-layout keyboard-layout)))
(mapped-devices
(list (mapped-device
(source
(uuid "d9ca0501-1dd4-4085-905a-9f0aa1bbd5a1"))
(target "cryptroot")
(type luks-device-mapping))))
(file-systems
(cons* (file-system
(mount-point "/boot/efi")
(device (uuid "EB48-BC12" 'fat32))
(type "vfat"))
(file-system
(mount-point "/")
(device "/dev/mapper/cryptroot")
(type "btrfs")
(dependencies mapped-devices))
(file-system
(mount-point "/media/store")
(device "gentooserver:/")
(type "nfs4")
(mount? #f)
(create-mount-point? #t)
(options "rw,_netdev,noauto,user,lazytime,exec,tcp"))
%base-file-systems))
(host-name "guixlaptop")
(users (cons* (user-account
(name "nathan")
(comment "Nathan Dehnel")
(group "users")
(home-directory "/home/nathan")
(supplementary-groups
'("wheel" "netdev" "audio" "video" "kvm")))
%base-user-accounts))
(packages
(append
(list (specification->package "openbox")
(specification->package "nss-certs"))
%base-packages))
(services
(append
(list (service gnome-desktop-service-type)
(service xfce-desktop-service-type)
(service tor-service-type)
(pam-limits-service
(list
(pam-limits-entry "@audio" 'both 'rtprio 99)
(pam-limits-entry "@audio" 'both 'memlock 'unlimited)
(pam-limits-entry "@realtime" 'both 'rtprio 99)
(pam-limits-entry "@realtime" 'both 'memlock 'unlimited)))
"/home/nathan/.config/pulse/default.pa"))))
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout))))
%my-services)))


Relevant manual page:

Command:
bash-5.0$ sudo guix system reconfigure '/home/nathan/guix/config.scm'
Password:
guix system: warning: Your Guix installation is 26 days old.
guix system: warning: Consider running 'guix pull' followed by
'guix system reconfigure' to get up-to-date packages and security updates.

The following derivations will be built:
/gnu/store/acq4drfdn27m7ii7bcmzkpixfg9ilzcz-system.drv
/gnu/store/86p3i23a8pydllh30wwlg20nh5js52m7-boot.drv
/gnu/store/dpkf322d0j98lcwy1ily0d763684ypla-activate.scm.drv
/gnu/store/76z6jjyahkivnb0423cpvj6asv7yr4gg-activate-service.scm.drv
/gnu/store/j0ma4b6j8ah123sf7pk97c9axh461s1c-etc.drv
/gnu/store/3ybxvw8rmn4q7r2zlcrv28qimmk1619v-pulse.drv
/gnu/store/715xzqa8cg29p498bsf4c1k27mlpjd4k-grub.cfg.drv
building /gnu/store/3ybxvw8rmn4q7r2zlcrv28qimmk1619v-pulse.drv...
\builder for `/gnu/store/3ybxvw8rmn4q7r2zlcrv28qimmk1619v-pulse.drv'
failed with exit code 1
build of /gnu/store/3ybxvw8rmn4q7r2zlcrv28qimmk1619v-pulse.drv failed
View build log at
'/var/log/guix/drvs/3y/bxvw8rmn4q7r2zlcrv28qimmk1619v-pulse.drv.bz2'.
cannot build derivation
`/gnu/store/j0ma4b6j8ah123sf7pk97c9axh461s1c-etc.drv': 1 dependencies
couldn't be built
cannot build derivation
`/gnu/store/acq4drfdn27m7ii7bcmzkpixfg9ilzcz-system.drv': 1
dependencies couldn't be built
guix system: error: build of
`/gnu/store/acq4drfdn27m7ii7bcmzkpixfg9ilzcz-system.drv' failed

Log:
bash-5.0$ bzip2 -dkc
/var/log/guix/drvs/3y/bxvw8rmn4q7r2zlcrv28qimmk1619v-pulse.drv.bz2
Backtrace:
2 (primitive-load "/gnu/store/sr5criapbpr4xk168wk3daxd0w4?")
In ice-9/eval.scm:
619:8 1 (_ #f)
In unknown file:
0 (stat "/home/nathan/.config/pulse/default.pa" #<undefin?>)

ERROR: In procedure stat:
In procedure stat: No such file or directory:
"/home/nathan/.config/pulse/default.pa"

FIle:
bash-5.0$ ls -l /home/nathan/.config/pulse/default.pa
-rw-r--r-- 1 nathan users 4811 Jun 26 00:15
/home/nathan/.config/pulse/default.pa
L
L
Leo Prikler wrote on 29 Jun 2020 12:27
(address . ncdehnel@gmail.com)(address . bug-guix@gnu.org)
8bba5017b0c04cb4c92d25a855bf4d70986aa8bd.camel@student.tugraz.at
Hello Nathan,

The snippet you've supplied
Toggle quote (8 lines)
> (define %my-services
> ;; My very own list of services.
> (modify-services %desktop-services
> (pulseaudio-service-type config =>
> (pulseaudio-configuration
> (inherit config)
> (script-file
> "/home/nathan/.config/pulse/default.pa")))))
can not possibly work. The reason for that, is that "file" does not
refer to an actual file, but to a file-like object as returned by Guix
G-Expressions. You probably want to use `mixed-text-file' or something
similar to write your default.pa inside Guix itself. Alternatively,
you can unset PULSE_CONFIG and PULSE_CLIENTCONFIG in your .profile (or
equivalent for other shells) and Pulseaudio should load your local
configuration.

Regards, Leo
L
L
Leo Prikler wrote on 30 Jun 2020 12:43
(name . Nathan Dehnel)(address . ncdehnel@gmail.com)(address . 42118@debbugs.gnu.org)
8104d8d87ddfcd1572dd6e0dd553a2fcaa7483f0.camel@student.tugraz.at
Am Dienstag, den 30.06.2020, 05:22 -0500 schrieb Nathan Dehnel:
Toggle quote (2 lines)
> Thanks for the tip. Do I have to put the entire file inside a string
> in guix? It's quite long.
mixed-text-file allows you to split the string into multiple parts, but
that is essentially the idea, yes. There are of course other ways of
building it, but it is your task to ensure, that those end up with the
result you want. In my personal opinion, explicit coding tends to be
best suited to accomplish this.

Toggle quote (8 lines)
>
> It mentions "local-file" so I did this:
> (script-file (local-file
> "/home/nathan/.config/pulse/default.pa"))))))
>
> guix system reconfigure then completed, but pulseaudio does not seem
> to reflect the change in settings.
That should work up to a certain extent – what this basically does is
copy your local default.pa into the Guix store and then
/etc/pulse/default.pa is a symlink to that file in the Guix store.
Depending on the content of default.pa, that may not actually be what
you want, but unless you're doing very weird things in there, it may
also be a perfectly valid configuration.
Can you check, that /etc/pulse/default.pa is indeed what you want it to
be? IIRC, you may have to reboot for /etc to change.

Regards, Leo
L
L
Leo Prikler wrote on 1 Jul 2020 10:15
(name . Nathan Dehnel)(address . ncdehnel@gmail.com)(address . 42118@debbugs.gnu.org)
346a83e1452455cbcf58c97cd260f571cd4af278.camel@student.tugraz.at
Am Mittwoch, den 01.07.2020, 01:58 -0500 schrieb Nathan Dehnel:
Toggle quote (13 lines)
> There is a file 86cvvgnb03cc11li0m0s3nrl73zf68fm-default.pa with my
> changes in it in /gnu/store.
>
> load-module module-jack-sink
> load-module module-jack-source
>
> Maybe pulse wasn't compiled with support for this feature enabled?
>
> This setting in /etc/pulse/daemon.conf points somewhere else:
> ; default-script-file =
> /gnu/store/y0lbm4qcxm3i8i7q1msp0ng1pysg8pb9-pulseaudio-
> 13.0/etc/pulse/default.pa
> I assume guix overrides this somehow?
I don't think so. The relevant code portions are in
gnu/services/sound.scm and read among others:

(define pulseaudio-environment
(match-lambda
(($ <pulseaudio-configuration> client-conf daemon-conf
default-script-file)
`(("PULSE_CONFIG" . ,(apply mixed-text-file "daemon.conf"
"default-script-file = "
default-script-file "\n"
(map pulseaudio-conf-entry
daemon-conf)))
("PULSE_CLIENTCONFIG" . ,(apply mixed-text-file "client.conf"
(map pulseaudio-conf-entry
client-conf)))))))

Due to a bug with webkit sandboxing, we no longer put daemon.conf into
/etc/pulse (my bad), but rather set PULSE_CONFIG to directly point to
it. As you can see, `default-script-file' should be set to the file
you're supplying. I am currently unsure, at which point this variable
gets updated (I still think you need to reboot), but I'm pretty
convinced, this would work with a custom script file.

Regards,
Leo.
L
L
Leo Prikler wrote on 1 Jul 2020 12:57
(name . Nathan Dehnel)(address . ncdehnel@gmail.com)(address . 42118@debbugs.gnu.org)
639906b4e6788d7cf645ccd5635132a19ef2e757.camel@student.tugraz.at
Am Mittwoch, den 01.07.2020, 04:33 -0500 schrieb Nathan Dehnel:
Toggle quote (13 lines)
> > Due to a bug with webkit sandboxing, we no longer put daemon.conf
> > into
> /etc/pulse (my bad), but rather set PULSE_CONFIG to directly point to
> it.
> I meant to say /gnu/store/<pulse package>/etc/pulse/daemon.conf.
>
> > I am currently unsure, at which point this variable
> gets updated (I still think you need to reboot)
>
> I rebooted and everything seems the same.
>
> Maybe the problem is pulse uses Jack1 as a dependency and I'm trying
> to use Jack2.
That might be an issue, but your $PULSE_CONFIG should at least point to
the right default.pa. It should especially not be the daemon.conf
shipped with pulseaudio, because we override flat-volumes (which most
distros agree has an insane default).

Btw. please keep the bug in your reply, so that others can follow. The
easiest way of doing so is to use "reply to all" in your mail client.

Regards, Leo
N
N
Nathan Dehnel wrote on 1 Jul 2020 13:52
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)(address . 42118@debbugs.gnu.org)
CAEEhgEsVx-5SwML+JTqzaG9QkpLVLa_bFwM+a-OiLWg41Bam4w@mail.gmail.com
Toggle quote (1 lines)
>That might be an issue, but your $PULSE_CONFIG should at least point to
the right default.pa. It should especially not be the daemon.conf
ok $PULSE_CONFIG points to daemon.conf which points to my edited file.

On Wed, Jul 1, 2020 at 5:57 AM Leo Prikler
<leo.prikler@student.tugraz.at> wrote:
Toggle quote (25 lines)
>
> Am Mittwoch, den 01.07.2020, 04:33 -0500 schrieb Nathan Dehnel:
> > > Due to a bug with webkit sandboxing, we no longer put daemon.conf
> > > into
> > /etc/pulse (my bad), but rather set PULSE_CONFIG to directly point to
> > it.
> > I meant to say /gnu/store/<pulse package>/etc/pulse/daemon.conf.
> >
> > > I am currently unsure, at which point this variable
> > gets updated (I still think you need to reboot)
> >
> > I rebooted and everything seems the same.
> >
> > Maybe the problem is pulse uses Jack1 as a dependency and I'm trying
> > to use Jack2.
> That might be an issue, but your $PULSE_CONFIG should at least point to
> the right default.pa. It should especially not be the daemon.conf
> shipped with pulseaudio, because we override flat-volumes (which most
> distros agree has an insane default).
>
> Btw. please keep the bug in your reply, so that others can follow. The
> easiest way of doing so is to use "reply to all" in your mail client.
>
> Regards, Leo
>
R
R
Ricardo Wurmus wrote on 1 Jul 2020 14:01
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
875zb7moko.fsf@elephly.net
Leo Prikler <leo.prikler@student.tugraz.at> writes:

Toggle quote (15 lines)
> Am Mittwoch, den 01.07.2020, 04:33 -0500 schrieb Nathan Dehnel:
>> > Due to a bug with webkit sandboxing, we no longer put daemon.conf
>> > into
>> /etc/pulse (my bad), but rather set PULSE_CONFIG to directly point to
>> it.
>> I meant to say /gnu/store/<pulse package>/etc/pulse/daemon.conf.
>>
>> > I am currently unsure, at which point this variable
>> gets updated (I still think you need to reboot)
>>
>> I rebooted and everything seems the same.
>>
>> Maybe the problem is pulse uses Jack1 as a dependency and I'm trying
>> to use Jack2.

This should not be a problem. JACK2 only differs for users but not in
terms of the API when building software. In Guix we only build with
JACK1 for consistency.

--
Ricardo
N
N
Nathan Dehnel wrote on 7 Jul 2020 04:59
(name . Ricardo Wurmus)(address . rekado@elephly.net)
CAEEhgEshVavjOMcU-iWqKp4ws6Gfd=8XGxONbYxKzCfSQEL8yg@mail.gmail.com
So if I disable pulseaudio autostart, and start it from bash, I get these errors

bash-5.0$ pulseaudio
E: [pulseaudio] module-jack-sink.c: jack_client_open() failed.
E: [pulseaudio] module.c: Failed to load module "module-jack-sink"
(argument: ""): initialization failed.
E: [pulseaudio] module-jack-source.c: jack_client_open() failed.
E: [pulseaudio] module.c: Failed to load module "module-jack-source"
(argument: ""): initialization failed.

So pulseaudio is seeing my settings correctly, but some other problem
is preventing it from working.

On Wed, Jul 1, 2020 at 7:01 AM Ricardo Wurmus <rekado@elephly.net> wrote:
Toggle quote (25 lines)
>
>
> Leo Prikler <leo.prikler@student.tugraz.at> writes:
>
> > Am Mittwoch, den 01.07.2020, 04:33 -0500 schrieb Nathan Dehnel:
> >> > Due to a bug with webkit sandboxing, we no longer put daemon.conf
> >> > into
> >> /etc/pulse (my bad), but rather set PULSE_CONFIG to directly point to
> >> it.
> >> I meant to say /gnu/store/<pulse package>/etc/pulse/daemon.conf.
> >>
> >> > I am currently unsure, at which point this variable
> >> gets updated (I still think you need to reboot)
> >>
> >> I rebooted and everything seems the same.
> >>
> >> Maybe the problem is pulse uses Jack1 as a dependency and I'm trying
> >> to use Jack2.
>
> This should not be a problem. JACK2 only differs for users but not in
> terms of the API when building software. In Guix we only build with
> JACK1 for consistency.
>
> --
> Ricardo
M
M
Maxim Cournoyer wrote on 29 Sep 2022 02:39
(name . Nathan Dehnel)(address . ncdehnel@gmail.com)
87fsgbovy1.fsf@gmail.com
Hello,

Nathan Dehnel <ncdehnel@gmail.com> writes:

Toggle quote (13 lines)
> So if I disable pulseaudio autostart, and start it from bash, I get these errors
>
> bash-5.0$ pulseaudio
> E: [pulseaudio] module-jack-sink.c: jack_client_open() failed.
> E: [pulseaudio] module.c: Failed to load module "module-jack-sink"
> (argument: ""): initialization failed.
> E: [pulseaudio] module-jack-source.c: jack_client_open() failed.
> E: [pulseaudio] module.c: Failed to load module "module-jack-source"
> (argument: ""): initialization failed.
>
> So pulseaudio is seeing my settings correctly, but some other problem
> is preventing it from working.

Seems the original issue got understood, but you still have some
configuration problem to tackle.

Closing this old forgotten issue, although note that the recently
introduce 'extra-script-files' field of the pulseaudio-configuration may
be useful to what you are/were trying to achieve.

Thanks,

Maxim
Closed
?