• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Turning Android phone into a USB DAC

duo8

Member
Joined
Feb 27, 2018
Messages
94
Likes
48
My V30 recently broke. But not entirely, it's just the touchscreen. So I tried to find other uses for it.
One of the features I've always wished it had is the ability to operate as a USB DAC. Much like those Android DAPs.

There's a feature in the linux kernel that would facilitate this, the USB gadget driver and its UAC1/UAC2 feature. Unfortunately the V30 doesn't come with the UAC features built in. I tried compiling the LG-provided kernel to include them, but gave up eventually, the errors were just too much.
I remember there's a DSP project out there using a RPi as the processor and interface. It also uses the same driver to act as a USB Audio device.

Anyway, have any of you tried this? The first step would be to enable the UAC features in the USB gadget driver, I think, which shouldn't be hard if you have a working setup for compiling your phone's kernel.
 

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,745
Likes
3,032
I don't know if there's anything in Android that makes using the gadget audio difficult. It may be lacking the tools necessary to connect the gadget interface to the DAC. You could try tracking down the author of an unofficial LineageOS port to see if they're willing to enable the necessary kernel module(s). Some are willing to do this while others want to stick to upstream options only. In any case they can probably give you some pointers on the build process.

It may be easier with one of the purer linux options like PostmarketOS (PmOS), although it doesn't look like anyone's tried building it for the V30 yet. That at least should have the necessary tools. I haven't actually tried audio in that direction though (PinePhone with Mobian in this case)
https://wiki.postmarketos.org/wiki/Devices
 
D

Deleted member 43441

Guest
My V30 recently broke. But not entirely, it's just the touchscreen. So I tried to find other uses for it.
One of the features I've always wished it had is the ability to operate as a USB DAC. Much like those Android DAPs.

There's a feature in the linux kernel that would facilitate this, the USB gadget driver and its UAC1/UAC2 feature. Unfortunately the V30 doesn't come with the UAC features built in. I tried compiling the LG-provided kernel to include them, but gave up eventually, the errors were just too much.
I remember there's a DSP project out there using a RPi as the processor and interface. It also uses the same driver to act as a USB Audio device.

Anyway, have any of you tried this? The first step would be to enable the UAC features in the USB gadget driver, I think, which shouldn't be hard if you have a working setup for compiling your phone's kernel.
I want to add to the other comments, that not all android devices play Hi-Rez files easily. Look into that and you’ll see what I’m talking about, but more of them are playing nicely with Hi-Rez than they ever have. There is also a nice Hi-Rez player on the Google play store that you can Used to play the Hi-Rez files, as long as your phone/device can pass them. I have a nice android based DAP that I USB to my DAC, and then into my home theater preamp. That set up sounds stunning, I also use my iOS devices and they may sound equally as good.
 
OP
D

duo8

Member
Joined
Feb 27, 2018
Messages
94
Likes
48
I don't know if there's anything in Android that makes using the gadget audio difficult. It may be lacking the tools necessary to connect the gadget interface to the DAC. You could try tracking down the author of an unofficial LineageOS port to see if they're willing to enable the necessary kernel module(s). Some are willing to do this while others want to stick to upstream options only. In any case they can probably give you some pointers on the build process.

It may be easier with one of the purer linux options like PostmarketOS (PmOS), although it doesn't look like anyone's tried building it for the V30 yet. That at least should have the necessary tools. I haven't actually tried audio in that direction though (PinePhone with Mobian in this case)
https://wiki.postmarketos.org/wiki/Devices
A pmOS port would be nice, but mainline support for the SD835 seems lacking.
The SD845 is rather well supported however, someone with a V35/V40 might have better luck.
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
501
Likes
323
The audio gadget requires:

* new kernel (5.17 at least) for reasonably-working uac2 gadget patches.
* good support of the DWC3 USB IP core in SD835 - again linux code
* loopback application between the gadget audio capture and phone audio playback, supporting the async feedback control of the gadget. I.e. the latest alsaloop or camilladsp, compiled for that ARM and running there (i.e. fully rooted phone)

IMO it's highly unlikely all these conditions can be satisfied without some extreme hacking effort.
 

somebodyelse

Major Contributor
Joined
Dec 5, 2018
Messages
3,745
Likes
3,032
I think PmOS has points 1 and 3 covered - other SD835 devices like the OnePlus 5 are using a near-upstream kernel with 5.17 available, and alsaloop at least shouldn't be a problem. I doubt camilladsp is packaged but their toolchain at least supports rust. The level of DWC3 support in that kernel is another matter, but could be checked by someone with one of the phones with an existing port. For the V30 I think it's the rest of the process of porting PmOS to new hardware that's likely to need the extreme hacking effort.
 

Saidera

Senior Member
Joined
Jul 18, 2020
Messages
388
Likes
309
Location
Adelaide, South Australia, Australia
I wish phones could easily be used as USB DACs - NW-WM1AM2 uses Android and has USB DAC functionality.
 
Top Bottom