Problem with USB DAC playback

Hello!

I have a problem with my Xperia 10 iii and connecting it to my USB DAC (Scarlett 2i2).

There’s no audio output to the monitors. Song will play through speaker. Using media player. Straight USB C cable. Works on another android device as it should, plug’n’play.

Solutions, please? :slight_smile:

2 Likes

I think either the device is missing drivers in the kernel, or the audio isn’t routed to the device automatically. You could try running dmesg -w and plugging the device in, and seeing what happens. If it gets detected as an audio device, you’ll probably hit this configuration issue, so you’ll need to switch the sink manually. I couldn’t find it with a quick search, but there’s an app for it somewhere.

1 Like

Audio Output Chooser, I think.

4 Likes

How I wish. Tried that to no avail. Thank you for the reply.

I’ll try this tomorrow, thanks

What is deep_buffer?

If you are a music enthusiast, you can download Album Player for linux, follow the instructions and run it directly. It will make your usb dac work perfectly and achieve bit-perfect output. It has a range of audiophile settings and works perfectly on SailfishOS.It definitely has the best sound quality on sailfishOS

2 Likes

For instance:

[defaultuser@VollaPhone ~]$ pacmd list-sinks | grep -e ‘name:’ -e ‘index’ -e ‘Speakers’

    index: 0
	name: <sink.primary_output>
    index: 1
	name: <sink.deep_buffer>
  * index: 2
	name: <sink.null>
1 Like

I have the same problem with my dac connection. My Xperia X works fine. Connecting to usb, it detects the dac and set the output to it. My new Xperia 10 iii fails to connect the dac.

I have looked which modules pulseaudio loads while starting and one module is missing for the 10 iii. The module-udev-detect is never loaded. When I load this module manualy, then it detects the dac. But the audio output still directed to the internal speaker. The audio output app is not helping. What works, is to move sink input with

pactl move-sink-input #stream #dac

But only for one song. To set the dac to default sink was not working.

The question is, why is the detect module never loaded? It is in /etc/pulse/default.pa.

has someone else an idea?

I can also confirm that Audio Output Chooser does not solve the problem!

Finally I got my FIIO KA11 to stable route audio over the DAC (at least until reboot, including listening multiple folders of flac and mp3 files stored on the internal memory and switching to internet radio back and forth) .
I did follow more or less the steps described here:

Beware of typos in the text, e.g. section 3:

‘pactrl load-module module-udev-detect’ is incorrect

‘pactl load-module module-udev-detect’ without r is correct.

1 Like

Dude, don’t cross-post. We heard you the first time.

I initially searched in the DAC thread for a solution. I personally would not look into the device specific 10V and Volla threads when I search for DAC solutions. That was my rationale.
Excuse me if someone feels this to be inappropriate…

1 Like

because JP2 will have no jack, today i got some usb dac just to test how SFOS works with it

pactl list cards

Card #2
	Name: alsa_card.usb-Generic_AB13X_USB_Audio_20210926172016-00
	Driver: module-alsa-card.c
	Owner Module: 41
	Properties:
		alsa.card = "1"
		alsa.card_name = "AB13X USB Audio"
		alsa.long_card_name = "Generic AB13X USB Audio at usb-xhci-hcd.0.auto-1, full speed"
		alsa.driver_name = "snd_usb_audio"
		device.bus_path = "platform-xhci-hcd.0.auto-usb-0:1:1.0"
		sysfs.path = "/devices/platform/soc/4e00000.ssusb/4e00000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1:1.0/sound/card1"
		udev.id = "usb-Generic_AB13X_USB_Audio_20210926172016-00"
		device.bus = "usb"
		device.vendor.id = "001f"
		device.vendor.name = "Generic"
		device.product.id = "0b21"
		device.product.name = "AB13X USB Audio"
		device.serial = "Generic_AB13X_USB_Audio_20210926172016"
		device.string = "1"
		device.description = "AB13X USB Audio"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-usb"
	Profiles:
		input:mono-fallback: Mono Input (sinks: 0, sources: 1, priority: 1, available: yes)
		input:multichannel-input: Multichannel Input (sinks: 0, sources: 1, priority: 1, available: yes)
		output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6500, available: yes)
		output:analog-stereo+input:mono-fallback: Analog Stereo Output + Mono Input (sinks: 1, sources: 1, priority: 6501, available: yes)
		output:analog-stereo+input:multichannel-input: Analog Stereo Output + Multichannel Input (sinks: 1, sources: 1, priority: 6501, available: yes)
		output:iec958-stereo: Digital Stereo (IEC958) Output (sinks: 1, sources: 0, priority: 5500, available: yes)
		output:iec958-stereo+input:mono-fallback: Digital Stereo (IEC958) Output + Mono Input (sinks: 1, sources: 1, priority: 5501, available: yes)
		output:iec958-stereo+input:multichannel-input: Digital Stereo (IEC958) Output + Multichannel Input (sinks: 1, sources: 1, priority: 5501, available: yes)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: output:analog-stereo+input:mono-fallback
	Ports:
		analog-input-mic: Microphone (type: Mic, priority: 8700, latency offset: 0 usec, availability unknown)
			Properties:
				device.icon_name = "audio-input-microphone"
			Part of profile(s): input:mono-fallback, output:analog-stereo+input:mono-fallback, output:iec958-stereo+input:mono-fallback
		analog-output: Analog Output (type: Analog, priority: 9900, latency offset: 0 usec, availability unknown)
			Part of profile(s): output:analog-stereo, output:analog-stereo+input:mono-fallback, output:analog-stereo+input:multichannel-input
		iec958-stereo-output: Digital Output (S/PDIF) (type: SPDIF, priority: 0, latency offset: 0 usec, availability unknown)
			Part of profile(s): output:iec958-stereo, output:iec958-stereo+input:mono-fallback, output:iec958-stereo+input:multichannel-input

pactl list sinks

Sink #6
	State: RUNNING
	Name: alsa_output.usb-Generic_AB13X_USB_Audio_20210926172016-00.analog-stereo
	Description: AB13X USB Audio Analog Stereo
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 48000Hz
	Channel Map: front-left,front-right
	Owner Module: 26
	Mute: no
	Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: alsa_output.usb-Generic_AB13X_USB_Audio_20210926172016-00.analog-stereo.monitor
	Latency: 70961 usec, configured 90000 usec
	Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "USB Audio"
		alsa.id = "USB Audio"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "1"
		alsa.card_name = "AB13X USB Audio"
		alsa.long_card_name = "Generic AB13X USB Audio at usb-xhci-hcd.1.auto-1, full speed"
		alsa.driver_name = "snd_usb_audio"
		device.bus_path = "platform-xhci-hcd.1.auto-usb-0:1:1.0"
		sysfs.path = "/devices/platform/soc/4e00000.ssusb/4e00000.dwc3/xhci-hcd.1.auto/usb1/1-1/1-1:1.0/sound/card1"
		udev.id = "usb-Generic_AB13X_USB_Audio_20210926172016-00"
		device.bus = "usb"
		device.vendor.id = "001f"
		device.vendor.name = "Generic"
		device.product.id = "0b21"
		device.product.name = "AB13X USB Audio"
		device.serial = "Generic_AB13X_USB_Audio_20210926172016"
		device.string = "front:1"
		device.buffering.buffer_size = "384000"
		device.buffering.fragment_size = "192000"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		device.description = "AB13X USB Audio Analog Stereo"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-usb"
	Ports:
		analog-output: Analog Output (type: Analog, priority: 9900, availability unknown)
	Active Port: analog-output
	Formats:
		pcm

Xperia 10ii, works right after plug but volume control does not work except mute, plays on max regardless what i set via UI/buttons
i have to change audio profile to get volume controls working:
pactl set-card-profile alsa_card.usb-Generic_AB13X_USB_Audio_20210926172016-00 output:iec958-stereo

Xperia10V does not work until i change default sink or move input to sink
pactl set-default-sink alsa_output.usb-Generic_AB13X_USB_Audio_20210926172016-00.analog-stereo
then quickly re-plug DAC
or
pactl list sink-inputs
then use given Sink Input #number:
pactl move-sink-input [number] alsa_card.usb-Generic_AB13X_USB_Audio_20210926172016-00

ofcourse still not fixed: Audio during call not routed to USB DAC headset - #17 by koza

if i plug charger the soundcard disappear and phone ask for usb mode

edit:
purchased Apple usb-c to jack (Part number: MW2Q3ZM/A) :

Xperia10ii volume control works
Xperia10V still need to set default sink via pactl

on both phones i have to set volume to max because it is always silent, then i still can adjust volume via UI/buttons
default volume after plug:
Xperia10ii
Volume: front-left: 14119 / 22% / -40.00 dB, front-right: 14119 / 22% / -40.00 dB
Xperia10V
Volume: front-left: 30419 / 46% / -20.00 dB, front-right: 30419 / 46% / -20.00 dB

pactl set-sink-volume alsa_output.usb-Apple__Inc._USB-C_to_3.5mm_Headphone_Jack_Adapter_DWH504202DRL1MQAF-00.analog-stereo 100%

Volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB

edit2:

Xperia10V on next song plays again from speakerphone, so set-default-sink is not enough :frowning: any idea?

6 Likes

I’m also testing usb dacs, not just because of the J2 but, the volla 22 at os version 5 doesn’t output over the 3.5mm jack. Sigh. This dac works ’ Stouchi USB Type C to 3.5 mm Headphone Adapter’ found on Amazon Germany for < 5 Euro. I used the instructions from oesf.org.

page not found :thinking:

Yeah, it’s a bit flaky. I’ve started to document at:
Udev and Pulse | SailfishOS community wiki I haven’t gotten the last (persist /usr/bin/pactl load-module module-udev-detect) finished, but it’s the same content.

Edit: the apple dongle recommended by @Mister_Magister also works. It’s not as loud as the ‘Stouchi’ but it works with the same procedure.

2 Likes

Apple dongle has hardware volume control and it defaults to 40%. check in alsamixer (you have to specify the device otherwise it won’t open) if it’s 100%

2 Likes

As i posted before default volume for apple dac is at 22 on Xperia10ii and 46 on Xperia 10V

You need to run

pactl set-sink-volume alsa_output.usb-Apple__Inc._USB-C_to_3.5mm_Headphone_Jack_Adapter_DWH504202DRL1MQAF-00.analog-stereo 100%

(Change it to your exact sink name)

1 Like

Ok, the procedure I followed holds for playlists in media play, happycamper (mepris) etc. I’ll paste it here.

devel-su
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

 pactl load-module module-udev-detect

The last command should be done by pulse but it seems that it’s not being done (ie. as the user). I’m testing a couple of setups. (ie. /etc/oneshot.d/100000/late/pactl-load-udev).

In any case, with the udev rule and the usbaudio.conf I have persistent use of the codec and volume control works fine.

1 Like