A2DP Sink not working

Hi, I am trying to get a2dp sink working but when I connect the device to my phone the Bluetooth app crashes because of avrcp:

2011-01-01 13:51:48.717 5514-5560/com.android.bluetooth W/bt_btif: bta_av_open_rc: Using the new AVRCP Profile
2011-01-01 13:51:48.717 5514-5566/com.android.bluetooth I/bt_btif_a2dp_sink: btif_a2dp_sink_start_session_delayed
2011-01-01 13:51:48.717 5514-5560/com.android.bluetooth A/bt_stack: [FATAL:avrcp_service.cc(317)] Check failed: instance_.
2011-01-01 13:51:48.717 5514-5560/com.android.bluetooth A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 5560 (btu message loo), pid 5514 (droid.bluetooth)
2011-01-01 13:51:48.775 5591-5591/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2011-01-01 13:51:48.775 5591-5591/? A/DEBUG: Build fingerprint: ‘OnePlus/OnePlus6/OnePlus6:8.1.0/OPM1.171019.011/06140300:user/release-keys’
2011-01-01 13:51:48.775 5591-5591/? A/DEBUG: Revision: ‘0’
2011-01-01 13:51:48.775 5591-5591/? A/DEBUG: ABI: ‘arm’
2011-01-01 13:51:48.775 5591-5591/? A/DEBUG: pid: 5514, tid: 5560, name: btu message loo >>> com.android.bluetooth <<<
2011-01-01 13:51:48.775 5591-5591/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2011-01-01 13:51:48.775 5591-5591/? A/DEBUG: Abort message: '[FATAL:avrcp_service.cc(317)] Check failed: instance_.

2011-01-01 13:51:48.775 5591-5591/? A/DEBUG: r0 00000000 r1 000015b8 r2 00000006 r3 a5325918
2011-01-01 13:51:48.775 5591-5591/? A/DEBUG: r4 0000158a r5 000015b8 r6 876b59b4 r7 0000010c
2011-01-01 13:51:48.776 5591-5591/? A/DEBUG: r8 876b59ec r9 876b5e2c r10 876b59e0 r11 876b5e28
2011-01-01 13:51:48.776 5591-5591/? A/DEBUG: ip 00000041 sp 876b59a0 lr a52b40e5 pc a52abe72
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: backtrace:
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #00 pc 0001ce72 /system/lib/libc.so (abort+62)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #01 pc 0007b64b /system/lib/libchrome.so (base::debug::BreakDebugger()+10)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #02 pc 0008b311 /system/lib/libchrome.so (logging::LogMessage::~LogMessage()+748)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #03 pc 000ac99f /system/lib/libbluetooth.so (bluetooth::avrcp::AvrcpService::Get()+42)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #04 pc 0004ce97 /system/lib/libbluetooth.so (bta_av_open_rc(tBTA_AV_SCB*, tBTA_AV_DATA*)+234)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #05 pc 000553c3 /system/lib/libbluetooth.so (bta_av_ssm_execute(tBTA_AV_SCB*, unsigned short, tBTA_AV_DATA*)+374)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #06 pc 00053bdf /system/lib/libbluetooth.so (bta_av_hdl_event(BT_HDR*)+210)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #07 pc 0008e2e5 /system/lib/libbluetooth.so (bta_sys_event(BT_HDR*)+56)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #08 pc 0007c58b /system/lib/libchrome.so (base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*)+162)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #09 pc 0008e10d /system/lib/libchrome.so (base::MessageLoop::RunTask(base::PendingTask*)+324)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #10 pc 0008e34b /system/lib/libchrome.so (base::MessageLoop::DeferOrRunPendingTask(base::PendingTask)+26)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #11 pc 0008e5ef /system/lib/libchrome.so (base::MessageLoop::DoWork()+218)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #12 pc 0008f2f3 /system/lib/libchrome.so (base::MessagePumpDefault::Run(base::MessagePump::Delegate*)+98)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #13 pc 0008def7 /system/lib/libchrome.so (base::MessageLoop::RunHandler()+62)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #14 pc 000a1d0b /system/lib/libchrome.so (base::RunLoop::Run()+78)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #15 pc 0015beb9 /system/lib/libbluetooth.so (btu_message_loop_run(void*)+188)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #16 pc 001ab7d5 /system/lib/libbluetooth.so (work_queue_read_cb(void*)+52)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #17 pc 001aa393 /system/lib/libbluetooth.so (run_reactor(reactor_t*, int)+218)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #18 pc 001aa28d /system/lib/libbluetooth.so (reactor_start(reactor_t*)+44)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #19 pc 001ab427 /system/lib/libbluetooth.so (run_thread(void*)+142)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #20 pc 00063c15 /system/lib/libc.so (__pthread_start(void*)+22)
2011-01-01 13:51:48.809 5591-5591/? A/DEBUG: #21 pc 0001e065 /system/lib/libc.so (__start_thread+22)

I hope someone can help me

After commenting out the avrcp get method and replacing it in system/bt/bta/av/bta_av_aact, a2dp works but the AudioFlinger shuts it down after a minute when playing music:

I/AudioFlinger: BUFFER TIMEOUT: remove(2) from active list on thread 0xa17038c0