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.

omap4460 pandaboard 4AI.1.4_OMAP4 : audio issue

Other Parts Discussed in Thread: 4460, TWL6040

HI,

   I use the http://omappedia.org/wiki/4AI.1.4_OMAP4_Icecream_Sandwich_Panda_Notes for my 4460 pandaboard.

  I have look at file mydroid/device/ti/common-open/audio/audio_hw.c

  and i know it will send the audio to hdmi only......  but there are some issue:

 1. how can i switch to bluetooth? when i connect to the bluetooth, the sound can't switch to bluetooth...

 2. when i use tinymix to change the config, it does...but after a monent.... it backs to original...why ?

 3. where is the audio_policy.conf ?  I can't find it.....

 

 

 

  • Hi Sunny,

    There is an app to enable audio bluetooth, but it will only work if you have your display connected to the DVI port, because if you connect HDMI all the audio will go to the HDMI.

    Try connecting the display/monitor/TV to the DVI port and pair your bluetooth device.

    Then open the BluetoothSCOA application and check the "Enable Music via Media Player" option

    Finally go to the Music Player app and start playback

    You should be able to listen your music.

  • thanks.....

    in http://e2e.ti.com/support/omap/f/849/t/206874.aspx you said that modify the mydroid/device/ti/common-open/audio/audio_hw.c can get the audio to the handset .

    but i failed......can you help me ? and also i want the audio to the handset and the hdmi at the same time.....

  • Yes, I said that because it is the place where to do it, by default it sets the audio to the speakers by default because it is the same audio_hw used for blaze and blaze tablet and those devices have speakers and a way to detect when a headset is plugged in. For panda the plugin method is not in the connector, although there is a test point you can pull to low (GND) to simulate it has detect a headset and it should switch the audio to the headset as it happen in the blaze and blaze tablet, but remember that you have to use DVI port.

    This audio_hw is a a simple Audio HAL that is currently opening only one audio card port for playback, the default is the use of OMAP's ABE, but once you connect HDMI that audio card will be used. If you want to send same audio to both cards you have to make some changes in this audio_hw to open both cards and probably also in the AudioFlinger to send the audio to both outputs.

    Hope this info can help.

  • thanks

    but i am the stranger to the AudioFlinger, could you mind give me some guid to make the  audio to both cards ??

    also i want to know that why we need to use the  BluetoothSCOA to make Bluetooth work ? can it work immediately when the Bluetooth connect to the board ? thanks......

     

  • You may avoid to have to change AudioFlinger by sending the audio to all cards in the write call in audio_hw.c, but you will need an array of all your open pcm's, I have seen something in device/samsung/tuna/audio/audio_hw.c, maybe you can take that as an example.

    You have to use that application to set the audio path in the ABE and enable the BT for audio.

  • thanks... I have solved the problem...

    in order to set the audio to the headset , i have change audio_hw.c and the driver twl6040.c..

    at first i just think that change the audio_hw.c can make the audio to the headset ,but it fail.

    later i found that  "Headset Stereophone" out  is always 0..... so it may relate to the driver twl6040.c..

    and if the jack is not detected...the driver twl6040.c will make it 0..... the route can't be connected and the the power can't be up either

    here is the log:

    **********************************************************

    [   25.926849] dapm_find_playback_paths * 1: MM_DL_LP -> (null) -> MM_DL VMixer
    [   25.934478] dapm_find_playback_paths   2: MM_DL VMixer -> Media Playback -> Voice Capture Mixer
    [   25.943878] dapm_find_playback_paths   2: MM_DL VMixer -> Multimedia -> DL2 Mixer
    [   25.951934] dapm_find_playback_paths * 2: MM_DL VMixer -> Multimedia -> DL1 Mixer
    [   25.960021] dapm_find_playback_paths * 3: DL1 Mixer -> Playback -> Sidetone Mixer
    [   25.968078] dapm_find_playback_paths * 4: Sidetone Mixer -> Switch -> DL1 PDM
    [   25.975799] dapm_find_playback_paths * 5: DL1 PDM -> (null) -> PDM_DL1
    [   25.982940] dapm_find_playback_paths   4: Sidetone Mixer -> Switch -> DL1 MM_EXT
    [   25.990936] dapm_find_playback_paths   4: Sidetone Mixer -> Switch -> DL1 BT_VX
    [   25.998870] dapm_find_playback_paths * 1: MM_DL_LP -> (null) -> MM_DL VMixer
    [   26.006530] dapm_find_playback_paths * 1: MM_DL_LP -> (null) -> MM_DL VMixer
    [   26.014160] dapm_find_playback_paths * 1: MM_DL_LP -> (null) -> MM_DL VMixer
    [   26.056274] dapm_generic_check_power w name Headset Stereophone in 0 out 0
    [   26.063812] dapm_generic_check_power w name Ext Spk in 0 out 1
    [   26.071228] dapm_generic_check_power w name Headset Stereophone in 2 out 0
    [   26.078796] dapm_generic_check_power w name Ext Spk in 0 out 1
    [   26.086303] dapm_generic_check_power w name Headset Stereophone in 2 out 0

    *************************************************************************************************************

  • Is good to read that you got it working. Thanks for the information also.

  • Hi sunny , 

    Were you able to play audio over Bluetooth SCO connection ? 

  • Sorry I didn't mean where I meant were .. 

    How were you able to do so ?? Just by following the instructions above or you did some modifications to the software ?

  • Hi sunny sour,

    I met a problem as you did.No sound when I insert headset.

    Could you decrible how you modify audio_hw.c and twl6040.c to enable headset.

    Thanks...

  • Hi, I got the same problem, can you tell me how you make headset work? Thank you very much!

  • Guys,

    Here is a patch that avoid to have to change the hardware (the pin to detect headset have to go to GND) https://gforge.ti.com/gf/download/frsrelease/961/6237/kernelpanda8.patch

    After that just make sure the audio_hw.c set the path to headset and audio should be play there

  • Hi sunny sour,

    I met same problem, no sound when I insert headset with dvi monitor.

    Could you decrible how you modify audio_hw.c and twl6040.c to enable headset.

    Thanks

    Shashi

  • send me an email sunjianbo@che08.com

  • just replace your select_input_device and select_output_device function in audio hw.c to :

    http://pastebin.com/uPa2m3eR

  •  Hi Israel Cepeda,

    I'm newbie with android, you said:"but once you connect HDMI that audio card will be used", and actually i test with my board, the HDMI card is alway high priority to sound. But i found this code  segment in mydroid/hardware/libhardware_legacy/audio/AudioPolicyManagerBase.cpp. it's below:

    #ifdef OMAP_ENHANCEMENT //DOLBY_DDPDEC51_MULTICHANNEL

    // Here we are following what Android does to choose endpoint if multiple devices are connected
    // for example if both Headphone/Headset and HDMI are plugged in, Android
    // chooses Headphone/Headset over HDMI. The below logic does the same i.e Headphone/Headset
    // is given high priority over other devices.
    //
    // This method must be modified if we consider other audio output devices eg. Bluetooth, usb_audio etc.
    // or this method can be avoided if we find a suitable place in AOSP that gives audio output device after
    // strategy, so that we can call setDolbySystemProperty directly from that place.
    //
    // Returns AudioSystem::DEVICE_OUT_DEFAULT, if the strategy for handling the current value of
    // mAvailableOutputDevices is not implemented.
    audio_devices_t AudioPolicyManagerBase::getDeviceFromHardCodedStrategy()
    {
        if (mAvailableOutputDevices & AUDIO_DEVICE_OUT_WIRED_HEADPHONE)
            return AUDIO_DEVICE_OUT_WIRED_HEADPHONE;
        else if (mAvailableOutputDevices & AUDIO_DEVICE_OUT_WIRED_HEADSET)
            return AUDIO_DEVICE_OUT_WIRED_HEADSET;
        else if (mAvailableOutputDevices & AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET)
            return AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
        else if (mAvailableOutputDevices & AUDIO_DEVICE_OUT_AUX_DIGITAL)
            return AUDIO_DEVICE_OUT_AUX_DIGITAL;
        else if (mAvailableOutputDevices & AUDIO_DEVICE_OUT_SPEAKER)
            return AUDIO_DEVICE_OUT_SPEAKER;
        else
            return AUDIO_DEVICE_OUT_DEFAULT;
    }
    This code show that: Headphone/Headset is given high priority over other devices. I can't understand.Could you explain to me about this?

    Thank in advance!