Pulseaudio custom config not being used after reboot

  • So I created a file named custom.conf under /storage/.config/pulse-daemon.conf.d with the following parameters :

    pactl load-module module-udev-detect

    pactl set-default-sink alsa_output.0.hdmi-stereo

    pactl set-default-source alsa_output.0.hdmi-stereo.monitor

    These are the commands I have to execute so that I can play Audio on my TV through Raspberry using Bluetooth on my Smartphone.

    Once I execute these commands everything works fine, untill I reboot, then it goes back to not working.

    Im I missing something as to why custom.conf is not being used during boot ?

    RaspberryPi 400 running LibreELEC-9.95.5 Kodi 19.1

  • Create this /storage/.config/autostart.sh instead:

    Bash
    #!/bin/sh
    
    (
        pactl load-module module-udev-detect
        pactl set-default-sink alsa_output.0.hdmi-stereo
        pactl set-default-source alsa_output.0.hdmi-stereo.monitor
    ) &
  • Create this /storage/.config/autostart.sh instead:

    Bash
    #!/bin/sh
    
    (
        pactl load-module module-udev-detect
        pactl set-default-sink alsa_output.0.hdmi-stereo
        pactl set-default-source alsa_output.0.hdmi-stereo.monitor
    ) &

    Thanks, it worked.

    I'm not sure what the issue is (no logs are provided which might give clues) but using autostart.sh should never be preferred over system.d, as the later provides better control over when things are executed.

    The Problem is solved, but since I am here to learn I would like to also know why it didnt work before.

    I have enabled debug logs and restarted my raspberry.

    From the log file that I got I cut out the part where it is loading pulseaudio and attached it here.

    I have found nothing else related to pulseaudio, custom.conf ( name of my file that is supposed to be used ) or /storage/.config/pulse-daemon.conf.d as a location within the log file.

    If the provided cut of the log is not enough, is there anything in particular I should be looking for in the uncut log ?

  • You can only change configurations of daemon.conf.

    IMO it is not possible to extend or change the *.pa files. The work around of calling pactl <command> is needed.

  • IMO it is not possible to extend or change the *.pa files.

    It is possible to extend *.pa files with this little workaround:

    Code: /storage/.config/pulse-daemon.conf.d/custom.conf
    default-script-file = /storage/.config/pulse-daemon.conf.d/custom.pa
    Code: /storage/.config/pulse-daemon.conf.d/custom.pa
    #!/usr/bin/pulseaudio -nF
    
    .fail
    .include /etc/pulse/default.pa
    
    # extend default startup script
    load-module module-rtp-recv latency_msec=250 sap_address=0.0.0.0