Android 5.1 head unit >>> USB Audio (DAC) output

Search This thread

WILD9

Senior Member
Nov 23, 2008
82
17
Any update on this thread ?
I made some sort of experiance, on Joying HU , the 2GB Rockchip Sofia version (10.1" screen) :
Using info from https: // source.android.com/devices/audio/usb.html - i looked into the "audio_policy.conf" file on the Joying, and for sure , there was no reference to any USB audio interface.
I am no android expert .. but i edited this file , with the info gathered from the link above , and after a reboot - the HU did indeed send the audio to the USB port.
Audio from all the apps i tred , was routed to the USB interface (Radio , DAB player,Kodi etc..)
The bad thing (?) - there was no volume control , all audio is at max level.
An external volume control could possibly remedy this.. i will look into it

Frank

This is very interesting, hope someone cleverer than me can pick this up and run with it, if volume control could be implemented this could be a break through. I assume radio and Bluetooth output still don't work through the DAC though?

edit:
You mention the radio (analogue?) does work, that's surprising, what about Bluetooth phone calls?
 

frankienones

Member
Sep 3, 2008
33
6
Aalesund
This is very interesting, hope someone cleverer than me can pick this up and run with it, if volume control could be implemented this could be a break through. I assume radio and Bluetooth output still don't work through the DAC though?

edit:
You mention the radio (analogue?) does work, that's surprising, what about Bluetooth phone calls?

..sorry , haven't tried yet :eek:
 

WILD9

Senior Member
Nov 23, 2008
82
17
From reading around the subject it seems DAC compatibility with Android L and onward devices is a bit hit and miss depending on the host device and the DAC. I've seen several cases where certain combinations of device and DAC function in the way you describe with no volume control and many where the volume control works properly so it may just be a case of trying different DACs. What device are you using?
 

DanB0y

Senior Member
Jul 20, 2016
104
27
Montreal
Any update on this thread ?
I made some sort of experiance, on Joying HU , the 2GB Rockchip Sofia version (10.1" screen) :
Using info from https: // source.android.com/devices/audio/usb.html - i looked into the "audio_policy.conf" file on the Joying, and for sure , there was no reference to any USB audio interface.
I am no android expert .. but i edited this file , with the info gathered from the link above , and after a reboot - the HU did indeed send the audio to the USB port.
Audio from all the apps i tred , was routed to the USB interface (Radio , DAB player,Kodi etc..)
The bad thing (?) - there was no volume control , all audio is at max level.
An external volume control could possibly remedy this.. i will look into it

Frank

Hi Frank,

Could you copy/paste the content of your audio_policy.conf file here ?

Thanks :)
 

frankienones

Member
Sep 3, 2008
33
6
Aalesund
Hi Frank,

Could you copy/paste the content of your audio_policy.conf file here ?

Thanks :)

sure: the only difference is the "usb" part :
----------------
# Global configuration section: lists input and output devices always present on the device
# as well as the output device selected by default.
# Devices are designated by a string that corresponds to the enum in audio.h

global_configuration {
attached_output_devices AUDIO_DEVICE_OUT_SPEAKER
default_output_device AUDIO_DEVICE_OUT_SPEAKER
attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_REMOTE_SUBMIX|AUDIO_DEVICE_IN_BLUETOOTH_A2DP
}

# audio hardware module section: contains descriptors for all audio hw modules present on the
# device. Each hw module node is named after the corresponding hw module library base name.
# For instance, "primary" corresponds to audio.primary.<device>.so.
# The "primary" module is mandatory and must include at least one output with
# AUDIO_OUTPUT_FLAG_PRIMARY flag.
# Each module descriptor contains one or more output profile descriptors and zero or more
# input profile descriptors. Each profile lists all the parameters supported by a given output
# or input stream category.
# The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding
# to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n".

audio_hw_modules {
primary {
outputs {
primary {
sampling_rates 48000 | 44100
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_FM
flags AUDIO_OUTPUT_FLAG_PRIMARY
}
}
inputs {
primary {
sampling_rates 48000
channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_VOICE_UPLINK|AUIDIO_CHANNEL_IN_VOICE_DNLINK|AUDIO_CHANNEL_IN_VOICE_UPLINK_DNLINK
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_FM_RX|AUDIO_DEVICE_IN_VOICE_CALL
}
}
}
a2dp {
outputs {
a2dp {
sampling_rates 44100
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_ALL_A2DP
}
}
inputs {
primary {
sampling_rates 48000 | 44100
channel_masks AUDIO_CHANNEL_IN_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_BLUETOOTH_A2DP
}
}
}
usb {
outputs {
usb_accessory {
sampling_rates 44100
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_USB_ACCESSORY
}
usb_device {
sampling_rates dynamic
channel_masks dynamic
formats dynamic
devices AUDIO_DEVICE_OUT_USB_DEVICE
}
}
inputs {
usb_device {
sampling_rates dynamic
channel_masks AUDIO_CHANNEL_IN_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_USB_DEVICE
}
}
}
r_submix {
outputs {
submix {
sampling_rates 48000
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX
}
}
inputs {
submix {
sampling_rates 48000
channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_REMOTE_SUBMIX
}
}
}
}

---------- Post added at 01:33 AM ---------- Previous post was at 01:21 AM ----------

From reading around the subject it seems DAC compatibility with Android L and onward devices is a bit hit and miss depending on the host device and the DAC. I've seen several cases where certain combinations of device and DAC function in the way you describe with no volume control and many where the volume control works properly so it may just be a case of trying different DACs. What device are you using?

I am using the ASUS Xonar U3
P_500.jpg


I was thinking of trying another one , and ordered a cheap chinese usb dac , from ebay...

Frank
 
  • Like
Reactions: AssassinsLament

AssassinsLament

Inactive Recognized Developer
Jun 8, 2007
939
628
Twin Cities
Thanks for the tip on this one guys, I did the same and my UCA202 works with my joying also, except for the volume part too. The thing is, if I change the volume on the system with a remote, in the settings, or something other than the volume knob, the sound does lower and go higher, but soon after, the joying takes control of the volume again and turns it all the way up to max. My initial thoughts are that the volume knob is directly wired to the outputs on the back of the joying, and thus it doesn't use the system's volume settings. The joying software basically takes control of the system's sound levels and limits us from manually changing the volume without the volume buttons or knob on the headunit.

I'm thinking there might be a way to intercept volume knob turns and apply them to the system's volume controls.
 

WILD9

Senior Member
Nov 23, 2008
82
17
Thanks for the tip on this one guys, I did the same and my UCA202 works with my joying also, except for the volume part too. The thing is, if I change the volume on the system with a remote, in the settings, or something other than the volume knob, the sound does lower and go higher, but soon after, the joying takes control of the volume again and turns it all the way up to max. My initial thoughts are that the volume knob is directly wired to the outputs on the back of the joying, and thus it doesn't use the system's volume settings. The joying software basically takes control of the system's sound levels and limits us from manually changing the volume without the volume buttons or knob on the headunit.

I'm thinking there might be a way to intercept volume knob turns and apply them to the system's volume controls.

If that's the case then this thread might be an appropriate place to find the solution as the modification is intercepting and redirecting button inputs.
 

AssassinsLament

Inactive Recognized Developer
Jun 8, 2007
939
628
Twin Cities
If that's the case then this thread might be an appropriate place to find the solution as the modification is intercepting and redirecting button inputs.

Yep, I thought the same. I'll have to message gustden and see if there is any volume commands being sent. There should be because you see an on screen volume indicator when you turn the knob, also the SystemUI has a built in volume icon on the taskbar that controls Joying's volume also.
 

WILD9

Senior Member
Nov 23, 2008
82
17
Yep, I thought the same. I'll have to message gustden and see if there is any volume commands being sent. There should be because you see an on screen volume indicator when you turn the knob, also the SystemUI has a built in volume icon on the taskbar that controls Joying's volume also.

Out of interest have you tried the DAC with bluetooth?
 

kampfschachtel

Senior Member
Mar 6, 2017
175
18
Wädenswil
This is very interesting, hope someone cleverer than me can pick this up and run with it, if volume control could be implemented this could be a break through. I assume radio and Bluetooth output still don't work through the DAC though?

edit:
You mention the radio (analogue?) does work, that's surprising, what about Bluetooth phone calls?

the volume control issue sounds to me like a problem of who is controling the USB stream: Joying or DAC?
Would be interessting to try an asynchrone USB DAC as it will take over the control and the timing.
Another source for the issue can be that some DAC's are using analog volume controls but some are using digital volume control. Difference is the analog volume control happens after the DAC has transfered digital to analog, means the analog output signal is modified in the level but digital input is continous and steady in level. The digital volume control reduces the level of the digital input signal means the level/volume control is done before the DAC and the DAC's analog section is just amplifing the input with a fixed output factor.
To me it looks like the USB-DAC first takes over the volume in a digital way (volume gets reduced by reducing the digital input signal), volume gets effectivly reduced and then joying unit takes over the control and delivers a continous digital signal (as it has analog volume control) and the input of the digital volume controlled DAC gets the full input level which gives you the max. volume output level. Looks like an asynchrone DAC (which takes over the control of timing and USB stream permanently) with analog volume control would be the way to go/solution.
Normally the small form factor and cheaper DACs are using digital volume control as cheaper to realize (reduces number of parts needed) and therefor also smaller, more expensive ones use analog volume control as you need a real preamp for this and it doesn't reduce the dynamic range of the signal as digital volume control does.
Would try myself but I am in hospital for next 3 weeks...
 
Last edited:

arshish1612

Senior Member
Jun 30, 2016
80
15
the volume control issue sounds to me like a problem of who is controling the USB stream: Joying or DAC?
Would be interessting to try an asynchrone USB DAC as it will take over the control and the timing.
Another source for the issue can be that some DAC's are using analog volume controls but some are using digital volume control. Difference is the analog volume control happens after the DAC has transfered digital to analog, means the analog output signal is modified in the level but digital input is continous and steady in level. The digital volume control reduces the level of the digital input signal means the level/volume control is done before the DAC and the DAC's analog section is just amplifing the input with a fixed output factor.
To me it looks like the USB-DAC first takes over the volume in a digital way (volume gets reduced by reducing the digital input signal), volume gets effectivly reduced and then joying unit takes over the control and delivers a continous digital signal (as it has analog volume control) and the input of the digital volume controlled DAC gets the full input level which gives you the max. volume output level. Looks like an asynchrone DAC (which takes over the control of timing and USB stream permanently) with analog volume control would be the way to go/solution.
Normally the small form factor and cheaper DACs are using digital volume control as cheaper to realize (reduces number of parts needed) and therefor also smaller, more expensive ones use analog volume control as you need a real preamp for this and it doesn't reduce the dynamic range of the signal as digital volume control does.
Would try myself but I am in hospital for next 3 weeks...

Any update on this??
 

freetomfr

Member
Mar 24, 2008
7
0
sure: the only difference is the "usb" part :
----------------
# Global configuration section: lists input and output devices always present on the device
# as well as the output device selected by default.
# Devices are designated by a string that corresponds to the enum in audio.h

global_configuration {
attached_output_devices AUDIO_DEVICE_OUT_SPEAKER
default_output_device AUDIO_DEVICE_OUT_SPEAKER
attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_REMOTE_SUBMIX|AUDIO_DEVICE_IN_BLUETOOTH_A2DP
}

# audio hardware module section: contains descriptors for all audio hw modules present on the
# device. Each hw module node is named after the corresponding hw module library base name.
# For instance, "primary" corresponds to audio.primary.<device>.so.
# The "primary" module is mandatory and must include at least one output with
# AUDIO_OUTPUT_FLAG_PRIMARY flag.
# Each module descriptor contains one or more output profile descriptors and zero or more
# input profile descriptors. Each profile lists all the parameters supported by a given output
# or input stream category.
# The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding
# to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n".

audio_hw_modules {
primary {
outputs {
primary {
sampling_rates 48000 | 44100
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_FM
flags AUDIO_OUTPUT_FLAG_PRIMARY
}
}
inputs {
primary {
sampling_rates 48000
channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_VOICE_UPLINK|AUIDIO_CHANNEL_IN_VOICE_DNLINK|AUDIO_CHANNEL_IN_VOICE_UPLINK_DNLINK
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_FM_RX|AUDIO_DEVICE_IN_VOICE_CALL
}
}
}
a2dp {
outputs {
a2dp {
sampling_rates 44100
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_ALL_A2DP
}
}
inputs {
primary {
sampling_rates 48000 | 44100
channel_masks AUDIO_CHANNEL_IN_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_BLUETOOTH_A2DP
}
}
}
usb {
outputs {
usb_accessory {
sampling_rates 44100
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_USB_ACCESSORY
}
usb_device {
sampling_rates dynamic
channel_masks dynamic
formats dynamic
devices AUDIO_DEVICE_OUT_USB_DEVICE
}
}
inputs {
usb_device {
sampling_rates dynamic
channel_masks AUDIO_CHANNEL_IN_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_USB_DEVICE
}
}
}
r_submix {
outputs {
submix {
sampling_rates 48000
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX
}
}
inputs {
submix {
sampling_rates 48000
channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_REMOTE_SUBMIX
}
}
}
}

---------- Post added at 01:33 AM ---------- Previous post was at 01:21 AM ----------



I am using the ASUS Xonar U3

I was thinking of trying another one , and ordered a cheap chinese usb dac , from ebay...

Frank

I have an ATOTO Android 6.0 Head Unit and I have the same problem : no sound on my external sound car with all apps except Neutron when I turn on USB direct mode. I have my audio_policy.conf file but I don"t see what I have to modify. Could you help me please?

The file is attached to this post (txt format). Do I have to root it to modify the file?

Thanks
 

Attachments

  • audio_policy.txt
    5.7 KB · Views: 29

rewen

Senior Member
Apr 19, 2010
213
20
Barrie
I have an ATOTO Android 6.0 Head Unit and I have the same problem : no sound on my external sound car with all apps except Neutron when I turn on USB direct mode. I have my audio_policy.conf file but I don"t see what I have to modify. Could you help me please?

The file is attached to this post (txt format). Do I have to root it to modify the file?

Thanks

I think what frankienones did was add missing usb area to his file. Yours already has that. Maybe what you need to do is change the default?
Code:
default_output_device AUDIO_DEVICE_OUT_SPEAKER
to
Code:
default_output_device AUDIO_DEVICE_OUT_USB_ACCESSORY
(or maybe AUDIO_DEVICE_OUT_USB_DEVICE, not sure which, you have both listed in your file)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Yeah I know what overkill sounds like haha
    For frontstage 3way I got a 4ch Pioneer Premier PRS-X340 running 2x NE25-VTS04 Peerless tweets and 2x NE95W-04 3in Peerless mids, another Pioneer old scholl amp pushing 2x175w for 7in Wavecor woofers. In the trunk is a JBL GTO14001, 1500Wrms @2ohm pushing a 15In Alpine Type-R sub in 3.5cuft tuned @21hz

    All my amps are very good condition used gear found on classifieds too, you can dig some real treasors for very little money sometimes !

    I've been looking all around the web since last week for how to route every sounds of the HU to a USB DAC, translating and reading about 500 pages worth of XDA/Russian Android forums, spent last nights editing config files all around my HU System folder, I tried the how-to link I posted in OP for MTCB units, nothing to do.. I really think the Kernel must be enabled for USB Audio for it to work, my DAC shows up in USB devices info but not in the audio output devices.

    Well, I'm still happy because my FLAC music collection plays incredibly well :D i dont car that much for FM Radio SQ, I only wish I'd be able to listen to Spotify or Kodi on the DAC.

    Im r eally glad if I could be any help to you and will keep this thread updated if I find something !

    Any update on this thread ?
    I made some sort of experiance, on Joying HU , the 2GB Rockchip Sofia version (10.1" screen) :
    Using info from https: // source.android.com/devices/audio/usb.html - i looked into the "audio_policy.conf" file on the Joying, and for sure , there was no reference to any USB audio interface.
    I am no android expert .. but i edited this file , with the info gathered from the link above , and after a reboot - the HU did indeed send the audio to the USB port.
    Audio from all the apps i tred , was routed to the USB interface (Radio , DAB player,Kodi etc..)
    The bad thing (?) - there was no volume control , all audio is at max level.
    An external volume control could possibly remedy this.. i will look into it

    Frank
    1
    SPDIF to C-DSP SPDIF Input would give you 4V at the MiniDSP RCA outputs :)
    1
    well you have convinced me to give this a shot. The USB DAC + 25 ft coax cable only set me back $35 on amazon. So even if this doesn't work I won't be mad.

    The potential for 4V of CLEAN pre-out voltage is too enticing to pass up. The line driver works, but like I said it's another box that needs power/space/etc. The USB DAC also allows me to take the HU sound processor fully out of my signal chain.

    I am unfortunately using android 4.4, so dont think I can help you much, but I will let you know if this works nonetheless.

    If it dont work natively, I'm 99% sure it will work with the Neutron music player. Install it and then go to hardware settings and enable Direct USB Driver. :good:
    1
    well I tested this today and I am very pleased with the results. I really do notice a difference in SQ. It sounds "cleaner" and fuller.

    Only major thing I notice is the overall volume seems really high over SPDIF. Only place I can adjust the volume now is with the DSP, but even then, I find I need to turn the gain down on the SPDIF inputs to get an acceptable volume. This is even with gain all the way down on my amps. This leads to a bit of clipping on the highs.

    Did you make any adjustments in neutron player or the DSP to get an acceptable volume? Or do you get by with just adjusting the DSP master volume?

    Now I just need to see if I can get all my sound to route through. I like to listen to streaming music too but I don't think I can go back to using analog pre-outs.
    Great ! Now you're in the same boat as me lol
    (Except for the clipping, I have no problem with that)

    What is the model of your amps ? I have my gain to around 1/3 in the amps (They're up to 6.5V input sensitivity) and spdif input gain is at 0.

    For your sound routing, you can sum the rca inputs and the spdif input together in the DSP :) And then you use your input levels to match the loudness. That way, you'll be able to listen excellent SQ music from Neutron and still hear BT phone calls, Youtube, navigation etc trough the analog inputs.
    1
    Great ! Now you're in the same boat as me lol
    (Except for the clipping, I have no problem with that)

    What is the model of your amps ? I have my gain to around 1/3 in the amps (They're up to 6.5V input sensitivity) and spdif input gain is at 0.

    For your sound routing, you can sum the rca inputs and the spdif input together in the DSP :) And then you use your input levels to match the loudness. That way, you'll be able to listen excellent SQ music from Neutron and still hear BT phone calls, Youtube, navigation etc trough the analog inputs.

    Yes! This is exactly what I have done. I spoke too soon also. The clipping was more a tuning issue than anything (changed cross-over on tweeters & lowered their output a bit). I was able to set the gain on SPDIF back to 0.

    Man it sounds really good now. I haven't any real tuning yet outside of setting gains and cross-overs. I think once I tune the system it'll take it over the top.

    I have a mosconi as100.4 on the tweeters and mids, and a alpine mrv-m500 on the sub. (i have one other amp I am replacing to power mid woofer, should arrive tomorrow). It's a total overkill system, but I find great deals on used gear on diymobileaudio classifieds so I keep upgrading lol.

    So now I will use neutron for majority of listening, and by mixing channels together on the analogs I already had connected, I get acceptable SQ for phone calls and streaming music. I have no desire to mod my system files the way it was shown in that thread you linked. Looks too risky. I am okay with this new arrangement since 90+% of my listening is my personal music collection.

    Really appreciate you making this thread. I always knew my system was capable of sounding better and this did the trick. I will let you know if I figure anything else out that could be useful.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone