Ubuntu – Pulseaudio doesn’t load settings on startup

alsamicrophonepulseaudiosoundstartup

I'm having a problem with Pulseaudio recently, every time i boot up my machine pulseaudio doesn't load the changes i made to default.pa nor system.pa, i created a remap-source module to load custom settings because my laptop's mic input works on the right channel only so i had to configure it. every time i reinstalled my OS i always do that and it worked, not until recently.

here's the output of pacmd list-sources | grep name:

    name: <alsa_output.pci-0000_00_1f.3.analog-stereo.monitor>
    name: <alsa_input.pci-0000_00_1f.3.analog-stereo>

and here's the changes i made to default.pa

load-module module-remap-source master=alsa_input.pci-0000_00_1f.3.analog-stereo source_name=mono channels=1 channel_map=right

set-default-source mono

small piece of output i found on journalctl

Sep 01 21:54:23 MIYUKI pulseaudio[1244]: Most likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers.
Sep 01 21:54:23 MIYUKI pulseaudio[1244]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
Sep 01 21:55:23 MIYUKI pulseaudio[1244]: ICE default IO error handler doing an exit(), pid = 1244, errno = 11
Sep 01 21:55:23 MIYUKI systemd[1233]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE
Sep 01 21:55:23 MIYUKI systemd[1233]: pulseaudio.service: Failed with result 'exit-code'.
Sep 01 21:55:23 MIYUKI systemd[1233]: pulseaudio.service: Failed to schedule restart job: Unit pulseaudio.socket is masked.
Sep 01 21:55:23 MIYUKI systemd[1233]: pulseaudio.service: Failed with result 'exit-code'.
Sep 01 21:55:50 MIYUKI pulseaudio[1201]: Master source not found.
Sep 01 21:55:50 MIYUKI pulseaudio[1201]: Failed to load module "module-remap-source" (argument: "master=alsa_input.pci-0000_00_1f.3.analog-stereo source_name=mono channels=1 channel_map=right"): initialization failed.
Sep 01 21:55:50 MIYUKI pulseaudio[1201]: Source mono does not exist.
Sep 01 21:55:50 MIYUKI pulseaudio[1201]: Failed to load module "module-alsa-card" (argument: "device_id="0" name="pci-0000_00_1f.3" card_name="alsa_card.pci-0000_00_1f.3" namereg_fail=false tsched=no fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=no avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
Sep 01 21:55:54 MIYUKI pulseaudio[1201]: After module unload, module 'module-null-sink' was still loaded!
Sep 01 21:55:54 MIYUKI systemd[1171]: pulseaudio.service: Succeeded.
Sep 01 21:55:54 MIYUKI pulseaudio[1249]: Master source not found.
Sep 01 21:55:54 MIYUKI pulseaudio[1249]: Failed to load module "module-remap-source" (argument: "master=alsa_input.pci-0000_00_1f.3.analog-stereo source_name=mono channels=1 channel_map=right"): initialization failed.
Sep 01 21:55:56 MIYUKI plasma_session[1337]: org.kde.plasma.session: Starting autostart service  "/etc/xdg/autostart/pulseaudio.desktop" ("/usr/bin/start-pulseaudio-x11")
Sep 01 22:02:12 MIYUKI systemd[1238]: pulseaudio.service: Succeeded.

i already tried to move the settings to other folder like ~/.config/pulse, unmask and mask the process but still no luck.
the only workaround is to add new line into my login script (.zlogin or .zprofile) :

pulseaudio --kill
pulseaudio --start

strangely it works after i kill pulseaudio. but the script gets executed everytime i log in and i don't want it to be like that, it annoys me every time i run a new terminal session (because the script also gets executed when i open a terminal session like on Android Studio or Visual Studio Code) and it'll keeps showing popups. i'm sorry for my bad english.
anyone know how to solve this?

Best Answer

I had the same problem as you. I'm using Ubuntu 20.04, and in my case the changes that I did to default.pa was the next ones:

load-module module-echo-cancel source_name=noechosource sink_name=noechosink
set-default-source noechosource
set-default-sink noechosink

Besides, these changes were also included in system.pa. Like in your case, every time I login, I had to execute pulseaudio -k to make pulseaudio load these settings. What I did to solve this problem was to modify the ~/.profile and add these lines at the end of the file:

chrome_open=$(pgrep chrome)
if [ -z "$chrome_open" ]
then
    pulseaudio -k
fi

So every time I login and if Chrome is not open, this command is executed. I use this if statement because if Chorme is open and pulseaudio -k is executed, it is necessary to reload it. I don't know if this is the best solution but it works for me and I hope this answer helps someone like us.