This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-AM62P-LP: Enable USB Audio MIC in android

Part Number: SK-AM62P-LP

Tool/software:

Dear Team,

We are not yet able to make audio capture via 3.5mm jack. However, we need to have audio recording function soon.

Could you kindly guide us in enabling USB Audio MIC? We will parallely work on fixing analog audio mic.

We tried with both tinycap and soundrecorder app

1|console:/ # tinypcminfo -D 0 -d 0
Info for card 0, device 0:

PCM out:
Access: 0x000009
Format[0]: 0x000444
Format[1]: 0x000001
Format Name: S16_LE, S24_LE, S32_LE, S24_3LE
Subformat: 0x000001
Rate: min=8000Hz max=96000Hz
Channels: min=2 max=2
Sample bits: min=16 max=32
Period size: min=4 max=16384
Period count: min=2 max=32768

PCM in:
Access: 0x000009
Format[0]: 0x000444
Format[1]: 0x000001
Format Name: S16_LE, S24_LE, S32_LE, S24_3LE
Subformat: 0x000001
Rate: min=8000Hz max=96000Hz
Channels: min=2 max=2
Sample bits: min=16 max=32
Period size: min=4 max=16384
Period count: min=2 max=32768

Best regards

Biju 

  • Modified audio_hal_configuration.xml & audio_policy_configuration.xml, adding mixer card and device. And we were able to record through tinycap by specifying card and device:

    adb shell tinycap /sdcard/file.wav -D 1 -d 0

    But still USB microphone is not the default input audio source and cannot record through voice recorder applications.

    audio_hal_configuration.xml
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    <!--
    On the target device this file must be located in /vendor/etc and named
    audio_hal_configuration.xml
    Syntax is based on TinyHAL:
    https://github.com/CirrusLogic/tinyhal/blob/master/audio.example.xml
    Note: not xml elements from TinyHAL are supported.
    -->
    <audiohal>
    <!-- mixer element _must_ appear before any of the other definitions.
    The 'card' attribute is optional and sets the ALSA card number of the mixer
    device - if not given it defaults to 0 -->
    <mixer card="0">
    <!-- init element lists control settings required to initialize the
    hardware and driver. These settings are applied only once when primary HAL
    is first loaded during boot -->
    <init>
    <ctl name="HP Playback Switch" val="1" />
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    audio_policy_configuration.xml
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!-- Copyright (C) 2015 The Android Open Source Project
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    -->
    <audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
    <!-- version section contains a “version” tag in the form “major.minor” e.g version=”1.0” -->
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Did a dumpsys audio and attaching its dump here. I was concerned whether the microphone is muted and then observed a line in the dump stating:

    mic mute FromSwitch=false FromRestrictions=false FromApi=false from system=false  No accessibility service Uids.

    Any idea what this mean in terms of microphone mute state? 

    audio_dump.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    Events log: audio services lifecycle
    09-10 14:27:14:934 AudioService()
    Message handler (watch for unhandled messages):
    Handler (com.android.server.audio.AudioService$AudioHandler) {a6d7999} @ 1122087
    Looper (AudioService, tid 119) {b7e3565}
    (Total messages: 0, polling=true, quitting=false)
    MediaFocusControl dump time: 3:14:12 PM
    Audio Focus stack entries (last is top of stack):
    No external focus policy
    Notify on duck: true
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi,

    we will do some test and check and i come back to you.

    Thanks

  • Hi,

    i just find a fix mostly based on your changes , it's under review internaly , but you can check commit details here : 
    https://gitlab.baylibre.com/baylibre/ti/android/aosp/device/ti/am62x/-/commit/ad7e963da4ee57baa0a150f77fbec29a9b7b2e33
    With this commit i'm able to play audio on jack and capture too. Same with a jabra headset on USB.

    to validate jack mic and ouput and USB headset capture and play too i use Easy voice recorder apps.
    you can find it if you search ' apk easy voice recoder" on google.

    Guillaume