Score:0

Ubuntu 20.04 loading ALSA source in PulseAudio fails on startup but works after restarting PulseAudio

lv flag

I am trying to set my default source to be a virtual dsnoop device (dmic_sv) defined in ~/.asoundrc, and I have added to ~/.config/pulse/default.pa the following lines:

# Tried placing the line below both before and after `load-module module-udev-detect tsched=0`,
# but it didn't make a difference
load-module module-alsa-source device=dmic_sv

...
set-default-source alsa_input.dmic_sv

At boot, PulseAudio can't find dmic_sv so it fails to load it and set it as the default source, but restarting PulseAudio fixes the problem. I suspect that PulseAudio is loading before ALSA, so restarting PulseAudio after ALSA has loaded is why it works, but I haven't found a good way of fixing it (only the hack below which waits for dmic_sv to appear in the output of arecord -L, and then restarts PulseAudio).

while ! arecord -L | grep dmic_sv > /dev/null
do
    echo "Waiting for dmic_sv..."
    sleep 2
done
killall pulseaudio

Any assistance configuring it the proper way so I don't have to use the hack would be much appreciated!

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.