KGL Unit + USB DAC SABRE ES9023

Search This thread

brbarnyard

Senior Member
Apr 8, 2010
121
20
Hey guys, trying to get this going on my Eonon GA5180F(RK3188 800x480). I'm using a HiFiMeDIY Sabre Tiny USB DAC Digital to Analog Audio Converter ES9023+PCM2706. I finally got it working reliably, but I'm struggling with controlling the volume. I believe the problem lies in alsamixer. When I load the app, there is nothing listed. How do I go about troubleshooting what's going on with alsa?
 

aluver

Senior Member
Aug 30, 2014
151
35
Hey guys, trying to get this going on my Eonon GA5180F(RK3188 800x480). I'm using a HiFiMeDIY Sabre Tiny USB DAC Digital to Analog Audio Converter ES9023+PCM2706. I finally got it working reliably, but I'm struggling with controlling the volume. I believe the problem lies in alsamixer. When I load the app, there is nothing listed. How do I go about troubleshooting what's going on with alsa?

Hi! Did you check what card number your Sabre DAC got in alsa?
try this command from su in terminal:
Code:
su
cat /proc/asound/cards
Sabre should be 2nd for service working ok (if not, tell me)
then, you need to check a volume simple control for your card (DAC)
(again from root)
Code:
alsa_amixer -c2 scontrols
The MTC-Service needs your DAC has scontrol 'PCM' for proper volume regulating.
PS: I have updated MTC-Service with preferences for the ability to change a card number and a volume control name to have more compatibility.
I am going to write a new more complex guide for USB Audio.

oops! I just have another idea. Your Sabre has PCM2706 as usb to I2s converter, so es9023 DAC connected to that through I2s digital interface. Align to PCM2706 datasheet it can't control the volume on I2s, but at analog out only. In that case, your last chance is to make a software volume configuration within alsa's asound.conf. I made it for my PCM2706 already. But you need have a fully working alsa, with Android SoC routing to it. I have had to replace some .so libraries for that. But I have RK3066, and I couldn't try will it works on RK3188 or not...
So, if you are want to try it, you must be familiar to repair of your ROM.
Whatever, I need some time to translate my guide from russian forum http://4pda.ru/forum/index.php?showtopic=695716&view=findpost&p=48937554
 
Last edited:
  • Like
Reactions: brbarnyard

brbarnyard

Senior Member
Apr 8, 2010
121
20
Hi! Did you check what card number your Sabre DAC got in alsa?
try this command from su in terminal:
Code:
su
cat /proc/asound/cards
Sabre should be 2nd for service working ok (if not, tell me)
then, you need to check a volume simple control for your card (DAC)
(again from root)
Code:
alsa_amixer -c2 scontrols
The MTC-Service needs your DAC has scontrol 'PCM' for proper volume regulating.
PS: I have updated MTC-Service with preferences for the ability to change a card number and a volume control name to have more compatibility.
I am going to write a new more complex guide for USB Audio.

Mine is card 2, but when I run alsamixer, there is nothing listed. I'd there supposed to be? I'll try the scontrols command later, and post back
Thanks!

Sent from my XT1575 using Tapatalk
 

brbarnyard

Senior Member
Apr 8, 2010
121
20
Hi! Did you check what card number your Sabre DAC got in alsa?
try this command from su in terminal:
Code:
su
cat /proc/asound/cards
Sabre should be 2nd for service working ok (if not, tell me)
then, you need to check a volume simple control for your card (DAC)
(again from root)
Code:
alsa_amixer -c2 scontrols
The MTC-Service needs your DAC has scontrol 'PCM' for proper volume regulating.
PS: I have updated MTC-Service with preferences for the ability to change a card number and a volume control name to have more compatibility.
I am going to write a new more complex guide for USB Audio.

oops! I just have another idea. Your Sabre has PCM2706 as usb to I2s converter, so es9023 DAC connected to that through I2s digital interface. Align to PCM2706 datasheet it can't control the volume on I2s, but at analog out only. In that case, your last chance is to make a software volume configuration within alsa's asound.conf. I made it for my PCM2706 already. But you need have a fully working alsa, with Android SoC routing to it. I have had to replace some .so libraries for that. But I have RK3066, and I couldn't try will it works on RK3188 or not...
So, if you are want to try it, you must be familiar to repair of your ROM.
Whatever, I need some time to translate my guide from russian forum http://4pda.ru/forum/index.php?showtopic=695716&view=findpost&p=48937554
Sure, I'm willing to try! Let me know what I need to do.
Edit: Would it be better at this point to exchange this one and get another? If so, what would be your recommendation?

Not sure if it matters, but here's the output of the alsa_amixer command:
u0_a115@rk3188:/ $ su
root@rk3188:/ # alsa_amixer -c2 scontrols
Simple mixer control 'PCM',0
 
Last edited:

aluver

Senior Member
Aug 30, 2014
151
35
Sure, I'm willing to try! Let me know what I need to do.
Edit: Would it be better at this point to exchange this one and get another? If so, what would be your recommendation?

Not sure if it matters, but here's the output of the alsa_amixer command:
u0_a115@rk3188:/ $ su
root@rk3188:/ # alsa_amixer -c2 scontrols
Simple mixer control 'PCM',0

My thoughts was right. You have a volume simple control 'PCM', but it will not affect to EA9023 DAC-chip.
I think you have a good chance to get it working because all libraries of RK3188 must be exchangeable to RK3066.
Let's try. I'll post a DIY, need some time to translate. You may create a backup.
 

aluver

Senior Member
Aug 30, 2014
151
35
Updated DIY for USB Audio

Updated guidance on obtaining working USB Audio for our HU (tested on RK3066, should work on RK3188).
This method differs from the old by more intelligently routing audio through the library ALSA and by updated solution for volume management (custom MTCService edition with USB Audio preferences).
Note, there are two variants here. The Variant 1 is the best (fully working ALSA with software volume control for any DAC). The Variant 2 is for those, who has working USB-DAC and wants to control its volume with a minimal changes in the system files (but this way alsa is not working as should and is not configurable). For the Variant 2 should be used USB-DACs or USB-SPDIF converters with capability of hardware mixing (audio class - realized volume controls). Note, that not all USB receiver chips have this function. I.e. PCM2706 can do a volume regulating only at analog output, not on digital (spdif, i2s). So, take care about proper choice of a DAC.
I recall, before you start, think about a backup. I'm not ready to be responsible for the results of your actions.
So, to redirect all the sounds of Android on the USB-device (sound card, DAC), you must:
1. Make sure you have Android version 4.4.2 or 4.4.4 (think 4.2.2 is already no one ).
2. Check you have root, install Root Explorer (or ES with root options on) and a Terminal emulator.
3. In Root explorer (ES) Copy modules (drivers) for support USB Audio (*.ko) from the included file to /system/lib/modules/, set their permissions to 0644 (rw-r-r-).
4. Try to load the modules manually from a Terminal for shure in that order:
Code:
u0_a71@android:/ $ su
root@android:/ # insmod /system/lib/modules/snd-hwdep.ko
root@android:/ # insmod /system/lib/modules/snd-rawmidi.ko
root@android:/ # insmod /system/lib/modules/snd-usbmidi-lib.ko
root@android:/ # insmod /system/lib/modules/snd-usb-audio.ko
If the device will reboot when the commands are activated, these drivers do not suit you (although the probability of this is negligible, because we have the same system, and all the "bumps" has already collected by me)
If the system is silently ate the commands - it's OK, go on.
5 . Connect USB-DAC to one of the rear USB-ports, designed for 3G / Wifi (as we definitely need a port to support USB-host).
6. In the Terminal, enter the following command and see whether our device is defined, and if so, what number.
Code:
root@android:/ # ls dev/snd
controlC0
controlC1
controlC2
pcmC0D0c
pcmC0D0p
pcmC1D0p
pcmC2D0c
pcmC2D0p
timer
root@android:/ # cat /proc/asound/cards
0 [RK29WM8731 ]: RK29_WM8731 - RK29_WM8731
RK29_WM8731
1 [RKHDMII2S ]: RK-HDMI-I2S - RK-HDMI-I2S
RK-HDMI-I2S
2 [Headset ]: USB-Audio - Plantronics Headset
Plantronics Plantronics Headset at usb-usb20_host-1.3, full speed
root@android:/ #
As is evident from the responses of the system, my Plantronics USB-Headset received address pcmC2D0p - ie Card 2 Device 0. In connection with the same architecture of our radios, we all should be similar, unless this is single USB-Audio device in the system. The assigned card number is important, because alsa configuration for routing and volume control service is tied to the card 2.
7. To make the driver modules *.ko loaded at every system startup, you need to edit the script /system/etc/install-recovery.sh, be sure to check then its resolution 0755, otherwise you risk losing your root-permissions. Add the lines loading modules closer to beginning of the script for faster pick-up USB-DAC in the boot process.
An example of my script install-recovery.sh
Code:
#!/system/bin/sh

# If you're implementing this in a custom kernel/firmware,
# I suggest you use a different script name, and add a service
# to launch it from init.rc

# Launches SuperSU in daemon mode only on Android 4.3+.
# Nothing will happen on 4.2.x or older, unless SELinux+Enforcing.
# If you want to force loading the daemon, use "--daemon" instead

insmod /system/lib/modules/snd-hwdep.ko
insmod /system/lib/modules/snd-rawmidi.ko
insmod /system/lib/modules/snd-usbmidi-lib.ko
insmod /system/lib/modules/snd-usb-audio.ko

/system/xbin/daemonsu --auto-daemon &

# Some apps like to run stuff from this script as well, that will 
# obviously break root - in your code, just search this file
# for "install-recovery-2.sh", and if present, write there instead.

while ! am startservice com.petrows.mtcservice/.ServiceMain; do sleep 1; done

/system/etc/install-recovery-2.sh
8. To organize the routing and volume control we need alsa. Copy the files from the archive RockChip_ALSA.zip relevant folders. Set the permissions for the copied files: iside bin - 0755, etc and lib - 0644, in usr - 0666.
9. This step is only for the Variant 1! Copy / replace files from the appropriate file folders, do not forget to update the permissions "as it was" - 0644 (rw-r-r-) :
/system/etc/ - asound.conf audio_policy.conf
/system/lib/hw/ - acoustics.default.so alsa.default.so audio.a2dp.default.so audio.primary.default.so audio.primary.rk30board.so audio.r_submix.default.so audio.usb.default.so audio_policy.default.so audio_policy.rk30board.so
You will need to remove the file audio.alsa_usb.rk30board.so, because it causes a conflict with the main ALSA.
All of these binaries are taken from minix x5 4.4.2 firmware, where USB-Audio works out of the box.
Config asound.conf adapted to work with a USB card number 2 in the system, and is equipped with software control volume (alsa-plugin softvol), which will work with any cards. So, the used control name is 'SoftMaster' (instead of a hardware volume control of USB-Audio devices - typically 'PCM').
In audio_policy.conf: thrown section alsa_usb due to conflicts, and in the section 'usb_device' the values ​​of flags 'sampling_rates' and 'formats' are changed to 'dynamic' (I have a goal to make 24 bit output in the future, for lossless digital volume control)

10. Well, to make the volume adjustable, copy attached MTC-Service apk, BUT only after clearing the cache, removing data and stopping installed MTCService (if you have it) in the Applications section of Android settings. Delete an old apk. Set permissions 0644 (rw-r-r-) to the new file. The section for USB-Audio's volume control is added in the service settings . It is necessary to turn on the check box 'USB-Audio volume control' in the service settings at the first start, and change the settings - we need the card number 2, Control name for the Variant 2 is SoftMaster, for the Variant 2 - PCM (register is important, by default it is 'PCM'). Playing music must be stopped through configuration process, speaker / ears can be damaged because of 100% volume otherwise.
Service adjusts the volume of HU's own output and USB-Audio synchronously by this console command:
alsa_amixer -c2 'SoftMaster' X%,
where 2 is the number of the sound card (see above);
SoftMaster is the name of the software volume simple control (alsa-plug softvol). For the Variant 2 will be used name PCM or else, accepted for your DAC, you should determine that by this command in Terminal: alsa_amixer -c 2 scontrols;
the X - the volume value, taken from the standard functions getRealMTCVolume (), which cleverly converts a value of Microntek's variable 'av_volume', which we see on the screen when adjusting the volume, from the range [0-30] to the range [0-100], taking into account human's logarithmic perception of the sound. Set as a percentage, that wonderful dock with the values ​​of a variable getRealMTCVolume (), which is from 0 to 100.
Already added in service too:
Buttons steering (keys codes 61, 62) Prev In Cat / Next In Cat now handled in PowerAMP - switching albums by wheel buttons up and down is very convenient. You may have other key codes, write in a personal - I will try to add

11. Reboot (completely, not slept and woke up :)) and listen to the result.

PS Questions, additions write in a personal, I am here infrequently.
PPS All android sound (players, navigation, pcradio) will go via USB. At HU's analog outputs will left only phone (BT), HU radio and CD. Because of all these sources are not high-quality, I left the rear speakers connected to the front speaker-output of HU (as phone sound goes only to the front outputs). The volume values of the HU's codec and on USB-DAC adjust synchronously.
PPPS If you couldn't get sound using Variant 1, try Variant 2. This may happen in case of differences between the older and newer ROMs (different android bases).

WARNING! After the waking up from sleep (standby), there can also be a problem with the volume or initialization, because the USB power shut off due to the sleep. In the first case you risk getting a good shake for the speakers and the ears (100% volume), in the second - just a lack of the sound. I never use sleep mode, so this problem it is not solved yet (just need to find a way to run one command on the waking - may be someone can tell me).
 

Attachments

  • RockChip_ALSA.zip
    324.3 KB · Views: 175
  • usb_audio_Variant1.zip
    537.4 KB · Views: 158
  • usb_audio_Variant2.zip
    373.3 KB · Views: 116
Last edited:
  • Like
Reactions: hrayr_gan

brbarnyard

Senior Member
Apr 8, 2010
121
20
So, will this work for my situation?
Also, can I add a line to the install-recovery.sh to set the volume at a reasonable level?
Like this: alsa_amixer -c2 'SoftMaster' 5%,
Updated guidance on obtaining working USB Audio for our HU (tested on RK3066, should work on RK3188).
This method differs from the old by more intelligently routing audio through the library ALSA and by updated solution for volume management (MTCService with USB Audio preferences).


Sent from my XT1575 using Tapatalk
 
Last edited:

aluver

Senior Member
Aug 30, 2014
151
35
So, will this work for my situation?
Also, can I add a line to the install-recovery.sh to set the volume at a reasonable level?
Like this: alsa_amixer -c2 'SoftMaster' 5%
Yes, I think it will (as I sad higher, if the libraries from RK3066 will work on RK188). You don't need to set the volume by adding any commands to the install-recovery.sh. The MTC-Service do this job on start - you can set the desired volume in settings (range is 0-30 there).
Make a backup first!
 

brbarnyard

Senior Member
Apr 8, 2010
121
20
Great! You are awesome! I'll try in a bit, and let you know how it goes

Sent from my XT1575 using Tapatalk
 

brbarnyard

Senior Member
Apr 8, 2010
121
20
I went through this step by step at lunch. I may have done something wrong, but there is no sound. Poweramp won't play tracks, and I also tried iHeartRadio, it won't load a station. I can hear a faint whine/hiss when I turn up the volume on my DSP. I didn't have time to revert back, but I will tonight.
Not giving up yet!

Edit: alsamixer still comes up blank

Sent from my XT1575 using Tapatalk
 

aluver

Senior Member
Aug 30, 2014
151
35
Not giving up yet!
Edit: alsamixer still comes up blank
Don't worry about alsamixer. Did you set permissions for all replaced/copied files?
You can check the playback by terminal command
Code:
alsa_aplay /mnt/external_sd/test.wav
But at first, place some little 16-bit/44.1kHz stereo wave-file (not mp3 or else) named test.wav to the gps-card.
Post the result from this command here.
If you can't find a wav, you can try white noise:
Code:
alsa_aplay -f cd -r 44100 -c 2 /dev/urandom
 

brbarnyard

Senior Member
Apr 8, 2010
121
20
Don't worry about alsamixer. Did you set permissions for all replaced/copied files?
You can check the playback by terminal command
Code:
alsa_aplay /mnt/external_sd/test.wav
But at first, place some little 16-bit/44.1kHz stereo wave-file (not mp3 or else) named test.wav to the gps-card.
Post the result from this command here.
If you can't find a wav, you can try white noise:
Code:
alsa_aplay -f cd -r 44100 -c 2 /dev/urandom

I believe I set all the permissions, but I'll check again. It'll be a while until I get to try, but I really appreciate your help!

Sent from my XT1575 using Tapatalk
 

brbarnyard

Senior Member
Apr 8, 2010
121
20
So, I recopied all of the files, and checked the permissions.
This is is the output:
alsa_aplay /mnt/external_sd/test.wav
tmp-mksh: 127: not found
tmp-mksh: root@rk3188:/: not found

What did I mess up?


Sent from my XT1575 using Tapatalk
 

aluver

Senior Member
Aug 30, 2014
151
35
So, I recopied all of the files, and checked the permissions.
This is is the output:
alsa_aplay /mnt/external_sd/test.wav
tmp-mksh: 127: not found
tmp-mksh: root@rk3188:/: not found

What did I mess up?


Sent from my XT1575 using Tapatalk
Check the path to the test.wav (can be done in ES explorer in the file properties) or try with the white noise as I wrote above.
Check the file alsa_aplay exists in /system/bin
 

brbarnyard

Senior Member
Apr 8, 2010
121
20
I reverted back to a system with working USB, and I'll try again in the morning. Determined to get this working!

Sent from my XT1575 using Tapatalk
 

brbarnyard

Senior Member
Apr 8, 2010
121
20
alsa_aplay isn't in /bin, it's in/xbin. Should I move it? I went back and copied the files from your zip one at a time, and 'audio.primary.rk30board.so' is the one that makes the audio stop working.

Sent from my XT1575 using Tapatalk
 

aluver

Senior Member
Aug 30, 2014
151
35
alsa_aplay isn't in /bin, it's in/xbin. Should I move it? I went back and copied the files from your zip one at a time, and 'audio.primary.rk30board.so' is the one that makes the audio stop working.
No, you should not. There is no difference, bin or xbin. Did you try alsa_aplay command again? I need to understand what problem do you have. I will see that on alsa_aplay's answers.
Try to start with
Code:
su
alsa_aplay -h
alsa_aplay -f cd -r 44100 -c 2 /dev/urandom
alsa_aplay /mnt/external_sd/test.wav
and copy here your terminal's text
 
Last edited:

brbarnyard

Senior Member
Apr 8, 2010
121
20
Code:
u0_a115@rk3188:/ $ su
root@rk3188:/ # alsa_aplay -f cd -r 44100 -c 2 /dev/urandom
Playing raw data '/dev/urandom' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

I don't hear anything, and it doesn't say anything after that. Should the space be there between '-c 2'?

Sent from my XT1575 using Tapatalk
 

aluver

Senior Member
Aug 30, 2014
151
35
Code:
u0_a115@rk3188:/ $ su
root@rk3188:/ # alsa_aplay -f cd -r 44100 -c 2 /dev/urandom
Playing raw data '/dev/urandom' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

I don't hear anything, and it doesn't say anything after that. Should the space be there between '-c 2'?
Yes, it's OK! Repeat the same with -v key:
Code:
alsa_aplay -f cd -r 44100 -c 2 [B]-v[/B] /dev/urandom
and post the output
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Install fresh rom, 1. USB Audio Player PRO and 2. Clear data MTC and 3. install new RK3066 HeadUnit (2.15 from google play)
    But cant controls volume and song with SRC, settings select this player

    What wrong i do?
    The google play version of MTC-service can't control UAPP volume.
    This is my edition of MTC-service with UAPP control support (include the volume) MTC-service-UAPP
    1. Stop your 2.15 service in Android Settings - Apps
    2. Clear it's cache and Data
    3. Copy the new apk somewhere to /system/usr/ with Root Explorer
    4. Set it's permissions to 0644 (rw-r--r--)
    5. Copy it to /system/app/ (overwrite old)
    At first run go to service settings and choose UAPP in Control methods and start service.
    Note! In case UAPP doesn't have any method except hooking rocker volume buttons pressess I can't do normal volume regulating. The steering wheel controls are working through microcontroller unit, that tells to Android part about keypresses and MTC-service then sends broadcast event about that. This my edition of MTC-service catches that broadcast events and generates "input keyevent 24/25" so UAPP can change the volume by steps by SWC. But the problem is the volume of STREAM_MEDIA also changing and I can't make HU's MCU volume was not changed too. So, that is not usefull. All three different volumes are changing at one time. And HU has 30 steps, Android mixer (STREAM_VOLUME) - only 15, and UAPP - 20,40 etc. So that is not good method I think.
    I wrote to eXtream Software Development and asked to make a function (API?) to set directly the volume value of the UAPP in percents (or any other scale) from other service without of use of volume keyevents emulation. But them "simply have no time for this at the moment".
    So, if you will not like this way, you can use my DIY guide on page 5 to make fully working Android USB Audio - there is no such problems.
    1
    Now that I sorted all out, I want to make a short DIY for other users that want to do this.


    You have in the archive almost everything you need.

    From playstore you have to download a script Manager, I use SManager.


    1. First you have to copy all the files from archive "system.rar" to the unit with Root Explorer, in root/system.
    2. You have to install a script Manager application. I use SManager.
    3. With script manager, you have to set-up to run at startup with SU privilleges the file "DAC.sh". You can copy the "dac.sh" file anywere you like on the internal memory.
    4. You have to install the MTC Service app from the archive (thank you @aluver for this). This is in fact a modified Headunit app.
    5. After copying all the files, you have to set 0644 permissions to all .ko files, or install the AlsaMixer app from playstore. Link directly to AlsaMixer: https://play.google.com/store/apps/details?id=com.skvalex.alsamixer (again, thank to @aluver for this info)
    6. Now, after the script runs, all should work.
    1
    Hey guys, trying to get this going on my Eonon GA5180F(RK3188 800x480). I'm using a HiFiMeDIY Sabre Tiny USB DAC Digital to Analog Audio Converter ES9023+PCM2706. I finally got it working reliably, but I'm struggling with controlling the volume. I believe the problem lies in alsamixer. When I load the app, there is nothing listed. How do I go about troubleshooting what's going on with alsa?

    Hi! Did you check what card number your Sabre DAC got in alsa?
    try this command from su in terminal:
    Code:
    su
    cat /proc/asound/cards
    Sabre should be 2nd for service working ok (if not, tell me)
    then, you need to check a volume simple control for your card (DAC)
    (again from root)
    Code:
    alsa_amixer -c2 scontrols
    The MTC-Service needs your DAC has scontrol 'PCM' for proper volume regulating.
    PS: I have updated MTC-Service with preferences for the ability to change a card number and a volume control name to have more compatibility.
    I am going to write a new more complex guide for USB Audio.

    oops! I just have another idea. Your Sabre has PCM2706 as usb to I2s converter, so es9023 DAC connected to that through I2s digital interface. Align to PCM2706 datasheet it can't control the volume on I2s, but at analog out only. In that case, your last chance is to make a software volume configuration within alsa's asound.conf. I made it for my PCM2706 already. But you need have a fully working alsa, with Android SoC routing to it. I have had to replace some .so libraries for that. But I have RK3066, and I couldn't try will it works on RK3188 or not...
    So, if you are want to try it, you must be familiar to repair of your ROM.
    Whatever, I need some time to translate my guide from russian forum http://4pda.ru/forum/index.php?showtopic=695716&view=findpost&p=48937554
    1
    Mine is card 2, but when I run alsamixer, there is nothing listed. I'd there supposed to be? I'll try the scontrols command later, and post back
    look at my post's last edit.
    1
    Updated DIY for USB Audio

    Updated guidance on obtaining working USB Audio for our HU (tested on RK3066, should work on RK3188).
    This method differs from the old by more intelligently routing audio through the library ALSA and by updated solution for volume management (custom MTCService edition with USB Audio preferences).
    Note, there are two variants here. The Variant 1 is the best (fully working ALSA with software volume control for any DAC). The Variant 2 is for those, who has working USB-DAC and wants to control its volume with a minimal changes in the system files (but this way alsa is not working as should and is not configurable). For the Variant 2 should be used USB-DACs or USB-SPDIF converters with capability of hardware mixing (audio class - realized volume controls). Note, that not all USB receiver chips have this function. I.e. PCM2706 can do a volume regulating only at analog output, not on digital (spdif, i2s). So, take care about proper choice of a DAC.
    I recall, before you start, think about a backup. I'm not ready to be responsible for the results of your actions.
    So, to redirect all the sounds of Android on the USB-device (sound card, DAC), you must:
    1. Make sure you have Android version 4.4.2 or 4.4.4 (think 4.2.2 is already no one ).
    2. Check you have root, install Root Explorer (or ES with root options on) and a Terminal emulator.
    3. In Root explorer (ES) Copy modules (drivers) for support USB Audio (*.ko) from the included file to /system/lib/modules/, set their permissions to 0644 (rw-r-r-).
    4. Try to load the modules manually from a Terminal for shure in that order:
    Code:
    u0_a71@android:/ $ su
    root@android:/ # insmod /system/lib/modules/snd-hwdep.ko
    root@android:/ # insmod /system/lib/modules/snd-rawmidi.ko
    root@android:/ # insmod /system/lib/modules/snd-usbmidi-lib.ko
    root@android:/ # insmod /system/lib/modules/snd-usb-audio.ko
    If the device will reboot when the commands are activated, these drivers do not suit you (although the probability of this is negligible, because we have the same system, and all the "bumps" has already collected by me)
    If the system is silently ate the commands - it's OK, go on.
    5 . Connect USB-DAC to one of the rear USB-ports, designed for 3G / Wifi (as we definitely need a port to support USB-host).
    6. In the Terminal, enter the following command and see whether our device is defined, and if so, what number.
    Code:
    root@android:/ # ls dev/snd
    controlC0
    controlC1
    controlC2
    pcmC0D0c
    pcmC0D0p
    pcmC1D0p
    pcmC2D0c
    pcmC2D0p
    timer
    root@android:/ # cat /proc/asound/cards
    0 [RK29WM8731 ]: RK29_WM8731 - RK29_WM8731
    RK29_WM8731
    1 [RKHDMII2S ]: RK-HDMI-I2S - RK-HDMI-I2S
    RK-HDMI-I2S
    2 [Headset ]: USB-Audio - Plantronics Headset
    Plantronics Plantronics Headset at usb-usb20_host-1.3, full speed
    root@android:/ #
    As is evident from the responses of the system, my Plantronics USB-Headset received address pcmC2D0p - ie Card 2 Device 0. In connection with the same architecture of our radios, we all should be similar, unless this is single USB-Audio device in the system. The assigned card number is important, because alsa configuration for routing and volume control service is tied to the card 2.
    7. To make the driver modules *.ko loaded at every system startup, you need to edit the script /system/etc/install-recovery.sh, be sure to check then its resolution 0755, otherwise you risk losing your root-permissions. Add the lines loading modules closer to beginning of the script for faster pick-up USB-DAC in the boot process.
    An example of my script install-recovery.sh
    Code:
    #!/system/bin/sh
    
    # If you're implementing this in a custom kernel/firmware,
    # I suggest you use a different script name, and add a service
    # to launch it from init.rc
    
    # Launches SuperSU in daemon mode only on Android 4.3+.
    # Nothing will happen on 4.2.x or older, unless SELinux+Enforcing.
    # If you want to force loading the daemon, use "--daemon" instead
    
    insmod /system/lib/modules/snd-hwdep.ko
    insmod /system/lib/modules/snd-rawmidi.ko
    insmod /system/lib/modules/snd-usbmidi-lib.ko
    insmod /system/lib/modules/snd-usb-audio.ko
    
    /system/xbin/daemonsu --auto-daemon &
    
    # Some apps like to run stuff from this script as well, that will 
    # obviously break root - in your code, just search this file
    # for "install-recovery-2.sh", and if present, write there instead.
    
    while ! am startservice com.petrows.mtcservice/.ServiceMain; do sleep 1; done
    
    /system/etc/install-recovery-2.sh
    8. To organize the routing and volume control we need alsa. Copy the files from the archive RockChip_ALSA.zip relevant folders. Set the permissions for the copied files: iside bin - 0755, etc and lib - 0644, in usr - 0666.
    9. This step is only for the Variant 1! Copy / replace files from the appropriate file folders, do not forget to update the permissions "as it was" - 0644 (rw-r-r-) :
    /system/etc/ - asound.conf audio_policy.conf
    /system/lib/hw/ - acoustics.default.so alsa.default.so audio.a2dp.default.so audio.primary.default.so audio.primary.rk30board.so audio.r_submix.default.so audio.usb.default.so audio_policy.default.so audio_policy.rk30board.so
    You will need to remove the file audio.alsa_usb.rk30board.so, because it causes a conflict with the main ALSA.
    All of these binaries are taken from minix x5 4.4.2 firmware, where USB-Audio works out of the box.
    Config asound.conf adapted to work with a USB card number 2 in the system, and is equipped with software control volume (alsa-plugin softvol), which will work with any cards. So, the used control name is 'SoftMaster' (instead of a hardware volume control of USB-Audio devices - typically 'PCM').
    In audio_policy.conf: thrown section alsa_usb due to conflicts, and in the section 'usb_device' the values ​​of flags 'sampling_rates' and 'formats' are changed to 'dynamic' (I have a goal to make 24 bit output in the future, for lossless digital volume control)

    10. Well, to make the volume adjustable, copy attached MTC-Service apk, BUT only after clearing the cache, removing data and stopping installed MTCService (if you have it) in the Applications section of Android settings. Delete an old apk. Set permissions 0644 (rw-r-r-) to the new file. The section for USB-Audio's volume control is added in the service settings . It is necessary to turn on the check box 'USB-Audio volume control' in the service settings at the first start, and change the settings - we need the card number 2, Control name for the Variant 2 is SoftMaster, for the Variant 2 - PCM (register is important, by default it is 'PCM'). Playing music must be stopped through configuration process, speaker / ears can be damaged because of 100% volume otherwise.
    Service adjusts the volume of HU's own output and USB-Audio synchronously by this console command:
    alsa_amixer -c2 'SoftMaster' X%,
    where 2 is the number of the sound card (see above);
    SoftMaster is the name of the software volume simple control (alsa-plug softvol). For the Variant 2 will be used name PCM or else, accepted for your DAC, you should determine that by this command in Terminal: alsa_amixer -c 2 scontrols;
    the X - the volume value, taken from the standard functions getRealMTCVolume (), which cleverly converts a value of Microntek's variable 'av_volume', which we see on the screen when adjusting the volume, from the range [0-30] to the range [0-100], taking into account human's logarithmic perception of the sound. Set as a percentage, that wonderful dock with the values ​​of a variable getRealMTCVolume (), which is from 0 to 100.
    Already added in service too:
    Buttons steering (keys codes 61, 62) Prev In Cat / Next In Cat now handled in PowerAMP - switching albums by wheel buttons up and down is very convenient. You may have other key codes, write in a personal - I will try to add

    11. Reboot (completely, not slept and woke up :)) and listen to the result.

    PS Questions, additions write in a personal, I am here infrequently.
    PPS All android sound (players, navigation, pcradio) will go via USB. At HU's analog outputs will left only phone (BT), HU radio and CD. Because of all these sources are not high-quality, I left the rear speakers connected to the front speaker-output of HU (as phone sound goes only to the front outputs). The volume values of the HU's codec and on USB-DAC adjust synchronously.
    PPPS If you couldn't get sound using Variant 1, try Variant 2. This may happen in case of differences between the older and newer ROMs (different android bases).

    WARNING! After the waking up from sleep (standby), there can also be a problem with the volume or initialization, because the USB power shut off due to the sleep. In the first case you risk getting a good shake for the speakers and the ears (100% volume), in the second - just a lack of the sound. I never use sleep mode, so this problem it is not solved yet (just need to find a way to run one command on the waking - may be someone can tell me).