Udev and Pulse
To use a USB DAC (digital-analog audio converter) in Sailfish OS it is necessary to set up udev to respond to the device being plugged in and turn off the internal sound card.
You need to become root:
# devel-su // root
# echo 'ATTRS{id}=="mtsndcard", ENV{PULSE_IGNORE}="1"' > /etc/udev/rules.d/89-pulseaudio-usb.rules
# cd /etc/pulse/xpolicy.conf.d
# mv usbaudio.conf.disabled usbaudio.conf
# exit // back to user
# pactl load-module module-udev-detect
The last command should be done at system boot through pulse. Sadly none of the following work and you need to execute that pactl load command after reboot.
edit .config/pulse/default.pa
.include /etc/pulse/default.pa
load-module module-udev-detect
edit /home/defaultuser/.config/systemd/user/pulse_udev.service
[Unit]
Description=udev-pactl-start-usb-dac
[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/usr/bin/pactl load-module module-udev-detect
[Install]
WantedBy=multi-user.target
Then run
systemctl --user enable pulse_udev.service
Article discussion: USB DAC playback on Sailfish OS Forum