Android 6 and multi channel audio. What worked for me.

   Mixvibes Android applications for Smartphone and Pad: CrossDJ
Forum rules
Click here to join MIxvibes on DISCORD https://discord.gg/gMdQJ2cJqa

Android 6 and multi channel audio. What worked for me.

Postby djzog on 11 Dec 2016, 15:14

Hi everyone,

TLDR: If you can't get multichannel USB audio working with CrossDJ on Android 6+, editing the /system/etc/audio_policy.conf file might help, if your device is rooted, and you don't care about your warranty.

I have been using Mixvibes Cross DJ Android as my portable mini DJ system for a while, and its been great - except the lack of extra output for headphone cue monitoring, without losing stereo. This has limited me to just basic level DJing with it.

The new Cross DJ release with Android 6 multi channel audio support promised to fix that for me!
So I upgraded my trusty Samsung Galaxy Note 8 tablet from Samsung Android 4.2.2 to Cyanogenmod 13 (Android 6.0.1).

And tried multi channel audio.. the first thing I tried was just a stereo USB sound card and hoping cueing would work on the tablets headphone outs, but no dice - a pity this doesn't work, but I guess thats an Android thing.. so now to get a 4 channel sound card...

The only one I have is my Numark Mixtrack Pro.. even though none of the knobs and buttons work, it does show up as a sound card and works.. but it didn't work as a multi channel with my setup.
Even though if I connect to the Linux terminal and check the driver status:
Code: Select all
# cat /proc/asound/card1/stream0
Numark MixTrack Pro at usb-s5p-ohci-1, full speed : USB Audio

Playback:
  Status: Running
    Interface = 1
    Altset = 1
    URBs = 2 [ 5 6 ]
    Packet Size = 376
    Momentary freq = 44100 Hz (0x2c.199a)
  Interface 1
    Altset 1
    Format: S16_LE
    Channels: 4
    Endpoint: 2 OUT (ADAPTIVE)
    Rates: 44100

that tells me it is multi channel (Channels: 4).
But a bit of reading ( i.e. https://source.android.com/devices/audio/usb.html ) and it seems there is a layer of Android stuff on top of linux also setting audio policy, in the file /system/etc/audio_policy.conf

Looking in the /system/etc/audio_policy.conf I see the following section:

Code: Select all
  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 44100
        channel_masks AUDIO_CHANNEL_OUT_STEREO
        formats AUDIO_FORMAT_PCM_16_BIT
        devices AUDIO_DEVICE_OUT_USB_DEVICE|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET|AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET
      }
    }
  }


So as the /system filesystem on my device is mounted read only, I mount it read/write with

Code: Select all
mount -r remount,rw /system


and edit the above lines to say:

Code: Select all
 usb {
    outputs {
      usb_accessory {
        sampling_rates 44100
        # channel_masks AUDIO_CHANNEL_OUT_STEREO
        channel_masks dynamic
        formats AUDIO_FORMAT_PCM_16_BIT
        devices AUDIO_DEVICE_OUT_USB_ACCESSORY
      }
      usb_device {
        sampling_rates 44100
        # channel_masks AUDIO_CHANNEL_OUT_STEREO
        channel_masks dynamic
        formats AUDIO_FORMAT_PCM_16_BIT
        devices AUDIO_DEVICE_OUT_USB_DEVICE|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET|AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET
      }
    }
  }


and reboot the tablet.
The first try it didn't work.. but I dis-connected and reconnected the USB interface from the OTG connector and restarted CrossDJ and I suddenly had the option "Normal" / "Dual" / "Mixer" selecting dual, and the headphone output and main stereo output on my Numark mixtrack pro are now working with CrossDJ.

Now I'll be clear that my tablet is well out of warranty, rooted, and running an non-Samsung rom and I'm comfortable with editing text config files in a terminal , if you aren't familiar with this these hints may not be for you.

Also every time I've done this so far, I've had to start up Cross DJ, stop it, disconnect the USB audio interface and reconnect, and start Cross DJ again, and then the "Normal / Dual / Mixer" options have become available.

Now to find a small, portable 4 channel USB sound card with good sound quality complete my Ultimate portable rig.....

DJ ZOG
music stuff: http://www.zog.net.au/
audio nerd stuff: http://www.minirig.org.au/

main DJ setup is a Dell laptop with Ubuntu Linux and MIXXX software with a Numark Mixtrack Pro DJ interface.
djzog
 
Posts: 2
Joined: 11 Dec 2016, 14:27


Re: Android 6 and multi channel audio. What worked for me.

Postby RoJeC on 11 Dec 2016, 16:09

Thank you for your detailed description, including relevant warnings.

However I will lock this topic for now.

It will be reviewed by Mixvibes (moderators are users only).

To my best knowledge it is intended that users use the app as is.

Tweaking behind the scenes is at risk of the user but not promoted nor supported. As any future update of the OS or the app may create incompatibility.
Ronald

Image

Manual alternative link: ? https://www.mixvibes.com/wp-content/uploads/2017/10/cross-dj-user-manual.pdf
Audio dropouts? Increase audio 'buffer size' value.
FAQ iOS / Android / PC / MAC http://www.mixvibes.com/help/
Soundcard not available/working? Try the 32bit version of Cross (is also installed).
RoJeC
 
Posts: 4926
Joined: 20 May 2011, 08:55
Location: Bussum, Netherlands



Return to Android Discussion




Who is online

Users browsing this forum: No registered users and 54 guests

Board index

 
 
   
 
© 2014 Mixvibes
 
cron