Android device as a receiver for A2DP profile

后端 未结 3 700
遥遥无期
遥遥无期 2020-11-27 18:19

Basically, what I am trying to do right now is use an android device as an A2DP receiver and when pairing established, android plays sound that is received from a transmitte

3条回答
  •  再見小時候
    2020-11-27 18:42

    Since Android L the BlueDriod stack does support A2DP sink, but it is disabled by default.

    To enable it do the following:

    /* Enable bluetooth av sink. */
    #define BTA_AV_SINK_INCLUDED TRUE
    

    in /external/bluetooth/bluedroid/include/bt_target.h. This enables sink support in the bluetooth stack.

    Also you have to do this change:

    
    true
    

    in /packages/apps/Bluetooth/res/values/config.xml. This enables the particular UI.

    Now you can pair your devices and start streaming. Unfortunately you will hear no sound although you'll receive the packets. The reason is that there is no audio route for A2DP sink. In the commit message of this patch https://android-review.googlesource.com/#/c/98161/ you can find a sample implementation on how to fix this.

    Here is a list of these changes:

    • https://android-review.googlesource.com/#/c/97832/
    • https://android-review.googlesource.com/#/c/97853/
    • https://android-review.googlesource.com/#/c/97833/
    • https://android-review.googlesource.com/#/c/98130/
    • https://android-review.googlesource.com/#/c/98131/

提交回复
热议问题