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.

Linux: streaming audio with aac codec

Tool/software: Linux

Hi,

Thank to your tuto :

WL18xx TI Bluetooth Stack AUDM Demo App, I managed to connect (and stream) my android phone and my iphone.

Now I want to use aac codec with my iphone. I checked BTPS_CONFIGURATION_AUD_SUPPORT_AAC was equal to 1, it was OK.

I add acc decoder (faad) in my gstreamer plugin list. I made sure the plugin works by listening to a local aac file.

gst-launch-1.0 -v --gst-debug-level=2 filesrc location=/etc/pa/Jumpin.aac ! faad ! volume volume=0.2 ! alsasink

I inspired from the command line in your tuto

gst-launch-1.0 -v --gst-debug-level=2 ss1a2dpsrc deccaps=aacdeccaps ! ss1rtplatmdepay checkmuxfragments=false ! capsfilter name=aacdeccaps ! faad ! alsasink device="hw:0,0"

with error :

gst-launch-1.0 -v --gst-debug-level=3 ss1a2dpsrc deccaps=aac ! ss1rtplatmdepay checkmuxfragments=false ! capsfilter name=aac ! 
faad ! alsasink device="hw:0,0"
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
0:00:00.172757917  3382  0x104c460 FIXME                default gstutils.c:3766:gst_pad_create_stream_id_internal:<a2dpsource0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
New clock: GstSystemClock
/GstPipeline:pipeline0/GstA2DPSource:a2dpsource0.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)4000\,\ encoding-name\=\(string\)MP4A-LATM"
/GstPipeline:pipeline0/GstRtpLatmDepayload:rtplatmdepayload0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)4000\,\ encoding-name\=\(string\)MP4A-LATM"
Device Flags:  0x80000008
Connect State: TRUE
Device Name:   iphone-5se-dev
Device Flags:  0x80000009
Device Flags:  0x8000000D
Paired State : TRUE
Device Flags:  0x8000001D
Encrypt State: TRUE
/GstPipeline:pipeline0/GstCapsFilter:aac: caps = "audio/x-sbc\,\ rate\=\(int\)44100\,\ mode\=\(string\)stereo\,\ channels\=\(int\)2\,\ subbands\=\(int\)8\,\ blocks\=\(int\)16\,\ allocation\=\(string\)loudness\,\ bitpool\=\(int\)53"
0:00:22.629164211  3382  0x104c460 ERROR                default LATM.c:447:ReadAudioSpecificConfig: RTP Depayload Error: Audio Object Type 23 is not supported. Depayloading Stopped.
^[[A^[[B^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:43.973116338
Setting pipeline to PAUSED ...

In my log I saw "audio/x-sbc", is it a negotiated capabilities problem ?

Best regards,

Thomas

  • Thomas,

    According to the A2DP profile specification, the default codec is SBC. The SNK and SRC devices can negotiate any other device like AAC. Unless two devices successfully negotiate to use the AAC codec, the connection stays SBC.

    Moreover, the macros in the BTPSCFG.h are read-only and they just indicate if certain features are enabled in the compiled stack. For instructions follow the LinuxAUDM demo guide wiki.
    processors.wiki.ti.com/.../WL18xx_TI_Bluetooth_Stack_AUDM_Demo_App

    Best regards,
    Vihang
  • Thanks Vihang,

    I changed the other flag AAC_SUPPORT_ENABLED (1) in BTPMMODC.c.

    I cleaned and built the SS1BTPM. I downloaded this binary and libgstss1bluetooth.so.

    And I had the same problem (I tried with one Ipad et one Iphone):

    gst-launch-1.0 -v --gst-debug-level=2 ss1a2dpsrc deccaps=aacdeccaps ! ss1rtplatmdepay checkmuxfragments=
    false ! capsfilter name=aacdeccaps ! faad ! alsasink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    /GstPipeline:pipeline0/GstA2DPSource:a2dpsource0.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)4000\,\ encoding-name\=\(string\)MP4A-LATM"
    /GstPipeline:pipeline0/GstRtpLatmDepayload:rtplatmdepayload0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)4000\,\ encoding-name\=\(string\)MP4A-LATM"
    COD:           0x000000
    Device Flags:  0x8000018D
    Connect State: TRUE
    Device Flags:  0x8000019D
    Encrypt State: TRUE
    /GstPipeline:pipeline0/GstCapsFilter:aacdeccaps: caps = "audio/x-sbc\,\ rate\=\(int\)44100\,\ mode\=\(string\)stereo\,\ channels\=\(int\)2\,\ subbands\=\(int\)8\,\ blocks\=\(int\)16\,\ allocation\=\(string\)loudness\,\ bitpool\=\(int\)53"
    0:00:27.873413420   828   0x841460 ERROR                default LATM.c:447:ReadAudioSpecificConfig: RTP Depayload Error: Audio Object Type 23 is not supported. Depayloading Stopped.
    

    Help me please,  I have no idea.

    Best regards,

    Thomas.

  • Thomas,

    Please capture a Bluetooth sniffer log that covers the profile level negotiation. First, you need to make sure that the AAC codec is being negotiated correctly between the two devices.

    Best regards,
    Vihang
  • Vihang,

    thank you for your answer.

    Firstly, I recorded log in the ipad. I saw codecs available (SBC, AAC)

    Jan 12 15:20:05 iPad mediaserverd(BTAudioHALPlugin)[25] <Notice>: Set plugin audio capture to: disabled
    Jan 12 15:20:05 iPad mediaserverd(BTAudioHALPlugin)[25] <Notice>: Set absolute volume to  supported for device mAudioObjectID 532
    Jan 12 15:20:05 iPad mediaserverd(BTAudioHALPlugin)[25] <Notice>: BT set ecnr is disabled. AG will do EC/NR.
    Jan 12 15:20:05 iPad mediaserverd(BTAudioHALPlugin)[25] <Notice>: AllowScoForTBT No for mAudioObjectID 532
    Jan 12 15:20:05 iPad mediaserverd(BTAudioHALPlugin)[25] <Notice>: Codecs available. NBS (CVSD): 1, WBS (mSBC): 1, UWBS (AAC-ELD): 0
    Jan 12 15:20:05 iPad mediaserverd(BTAudioHALPlugin)[25] <Notice>: New HFP device with mAudioObjectID 532 created
    Jan 12 15:20:05 iPad mediaserverd(CoreAudio)[25] <Notice>: HALS_Device.cpp:110:Activate:  HALS_Device::Activate: activating device 1550: F0:C7:7F:06:B9:24-tsco
    Jan 12 15:20:05 iPad mediaserverd(BTAudioHALPlugin)[25] <Notice>: Set plugin audio capture to: disabled
    Jan 12 15:20:05 iPad mediaserverd(BTAudioHALPlugin)[25] <Notice>: Set absolute volume to not supported for device mAudioObjectID 538
    Jan 12 15:20:05 iPad mediaserverd(BTAudioHALPlugin)[25] <Notice>: SetPhysicalFormatSBCProperties
    Jan 12 15:20:05 iPad mediaserverd(BTAudioHALPlugin)[25] <Notice>: New A2DP device with mAudioObjectID 538 created

    Secondly, With the TI LinuxAUDM  application, I set log (EnableBluetoothDebug 1 3 0 FTSDebugLog.btsnoop).

    In thi slog I saw only SBC negociation.

    If necessary, documents in full:

    log ipad.log

    FTSDebugWLxx.log

    Best regards,

    Thomas