I have figured out my own problem.
I had /dev/snd/hwC0D0
mapped in my x11.profile to get sound working in one of my containers. I expected those mappings to show when I did a lxc config show ...
but it doesn’t so I didn’t realize it at first. I later checked my profile and found it.
But the way I worked around the problem was to change the order of the sound cards by creating the file /etc/modprobe.d/sound.conf
with the following contents:
options snd_hda_intel index=0
options snd_usb_audio index=1
That keeps the default sound card (0) the same whether I am on the dock or not, so the file /dev/snd/hwC0D0
exists in both cases and I can keep the mapping in the profile.