Loading system/audio_hal_interface/le_audio_software.cc +24 −0 Original line number Diff line number Diff line Loading @@ -347,6 +347,18 @@ void LeAudioClientInterface::Sink::SuspendedForReconfiguration() { ->StreamSuspended(aidl::BluetoothAudioCtrlAck::SUCCESS_RECONFIGURATION); } void LeAudioClientInterface::Sink::ReconfigurationComplete() { // This is needed only for AIDL since SuspendedForReconfiguration() // already calls StreamSuspended(SUCCESS_FINISHED) for HIDL if (HalVersionManager::GetHalTransport() == BluetoothAudioHalTransport::AIDL) { // FIXME: For now we have to workaround the missing API and use // StreamSuspended() with SUCCESS_FINISHED ack code. get_aidl_client_interface(is_broadcaster_) ->StreamSuspended(aidl::BluetoothAudioCtrlAck::SUCCESS_FINISHED); } } size_t LeAudioClientInterface::Sink::Read(uint8_t* p_buf, uint32_t len) { if (HalVersionManager::GetHalTransport() == BluetoothAudioHalTransport::HIDL) { Loading Loading @@ -456,6 +468,18 @@ void LeAudioClientInterface::Source::SuspendedForReconfiguration() { aidl::BluetoothAudioCtrlAck::SUCCESS_RECONFIGURATION); } void LeAudioClientInterface::Source::ReconfigurationComplete() { // This is needed only for AIDL since SuspendedForReconfiguration() // already calls StreamSuspended(SUCCESS_FINISHED) for HIDL if (HalVersionManager::GetHalTransport() == BluetoothAudioHalTransport::AIDL) { // FIXME: For now we have to workaround the missing API and use // StreamSuspended() with SUCCESS_FINISHED ack code. aidl::le_audio::LeAudioSourceTransport::interface->StreamSuspended( aidl::BluetoothAudioCtrlAck::SUCCESS_FINISHED); } } void LeAudioClientInterface::Source::ConfirmStreamingRequest() { if (HalVersionManager::GetHalTransport() == BluetoothAudioHalTransport::HIDL) { Loading system/audio_hal_interface/le_audio_software.h +3 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ class LeAudioClientInterface { virtual void UpdateAudioConfigToHal( const ::le_audio::offload_config& config) = 0; virtual void SuspendedForReconfiguration() = 0; virtual void ReconfigurationComplete() = 0; }; public: Loading @@ -103,6 +104,7 @@ class LeAudioClientInterface { void UpdateBroadcastAudioConfigToHal( const ::le_audio::broadcast_offload_config& config); void SuspendedForReconfiguration() override; void ReconfigurationComplete() override; // Read the stream of bytes sinked to us by the upper layers size_t Read(uint8_t* p_buf, uint32_t len); bool IsBroadcaster() { return is_broadcaster_; } Loading @@ -124,6 +126,7 @@ class LeAudioClientInterface { void UpdateAudioConfigToHal( const ::le_audio::offload_config& config) override; void SuspendedForReconfiguration() override; void ReconfigurationComplete() override; // Source the given stream of bytes to be sinked into the upper layers size_t Write(const uint8_t* p_buf, uint32_t len); }; Loading system/bta/le_audio/client.cc +23 −2 Original line number Diff line number Diff line Loading @@ -405,6 +405,15 @@ class LeAudioClientImpl : public LeAudioClient { } } static void ReconfigurationComplete(uint8_t directions) { if (directions & le_audio::types::kLeAudioDirectionSink) { leAudioClientAudioSource->ReconfigurationComplete(); } if (directions & le_audio::types::kLeAudioDirectionSource) { leAudioClientAudioSink->ReconfigurationComplete(); } } void CancelStreamingRequest() { if (audio_sender_state_ >= AudioState::READY_TO_START) { leAudioClientAudioSource->CancelStreamingRequest(); Loading Loading @@ -3548,14 +3557,26 @@ class LeAudioClientImpl : public LeAudioClient { /** Stop Audio but don't release all the Audio resources */ SuspendAudio(); break; case GroupStreamStatus::CONFIGURED_BY_USER: case GroupStreamStatus::CONFIGURED_BY_USER: { // Check which directions were suspended uint8_t previously_active_directions = 0; if (audio_sender_state_ >= AudioState::READY_TO_START) { previously_active_directions |= le_audio::types::kLeAudioDirectionSink; } if (audio_receiver_state_ >= AudioState::READY_TO_START) { previously_active_directions |= le_audio::types::kLeAudioDirectionSource; } /* We are done with reconfiguration. * Clean state and if Audio HAL is waiting, cancel the request * so Audio HAL can Resume again. */ CancelStreamingRequest(); HandlePendingAvailableContexts(group); break; ReconfigurationComplete(previously_active_directions); } break; case GroupStreamStatus::CONFIGURED_AUTONOMOUS: /* This state is notified only when * groups stays into CONFIGURED state after Loading system/bta/le_audio/client_audio.cc +22 −0 Original line number Diff line number Diff line Loading @@ -449,6 +449,17 @@ void LeAudioClientAudioSource::SuspendedForReconfiguration() { sinkClientInterface_->SuspendedForReconfiguration(); } void LeAudioClientAudioSource::ReconfigurationComplete() { LOG(INFO) << __func__; if ((sinkClientInterface_ == nullptr) || (le_audio_sink_hal_state != HAL_STARTED)) { LOG(ERROR) << "LE audio device HAL was not started!"; return; } sinkClientInterface_->ReconfigurationComplete(); } void LeAudioClientAudioSource::CancelStreamingRequest() { LOG(INFO) << __func__; if ((sinkClientInterface_ == nullptr) || Loading Loading @@ -703,3 +714,14 @@ void LeAudioUnicastClientAudioSink::SuspendedForReconfiguration() { sourceClientInterface_->SuspendedForReconfiguration(); } void LeAudioUnicastClientAudioSink::ReconfigurationComplete() { LOG(INFO) << __func__; if ((sourceClientInterface_ == nullptr) || (le_audio_source_hal_state != HAL_STARTED)) { LOG(ERROR) << "LE audio device HAL was not started!"; return; } sourceClientInterface_->ReconfigurationComplete(); } system/bta/le_audio/client_audio.h +2 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,7 @@ class LeAudioClientAudioSource { virtual void UpdateBroadcastAudioConfigToHal( const ::le_audio::broadcast_offload_config& config); virtual void SuspendedForReconfiguration(); virtual void ReconfigurationComplete(); static void DebugDump(int fd); Loading Loading @@ -170,6 +171,7 @@ class LeAudioUnicastClientAudioSink { virtual void UpdateRemoteDelay(uint16_t remote_delay_ms); virtual void UpdateAudioConfigToHal(const ::le_audio::offload_config& config); virtual void SuspendedForReconfiguration(); virtual void ReconfigurationComplete(); static void DebugDump(int fd); Loading Loading
system/audio_hal_interface/le_audio_software.cc +24 −0 Original line number Diff line number Diff line Loading @@ -347,6 +347,18 @@ void LeAudioClientInterface::Sink::SuspendedForReconfiguration() { ->StreamSuspended(aidl::BluetoothAudioCtrlAck::SUCCESS_RECONFIGURATION); } void LeAudioClientInterface::Sink::ReconfigurationComplete() { // This is needed only for AIDL since SuspendedForReconfiguration() // already calls StreamSuspended(SUCCESS_FINISHED) for HIDL if (HalVersionManager::GetHalTransport() == BluetoothAudioHalTransport::AIDL) { // FIXME: For now we have to workaround the missing API and use // StreamSuspended() with SUCCESS_FINISHED ack code. get_aidl_client_interface(is_broadcaster_) ->StreamSuspended(aidl::BluetoothAudioCtrlAck::SUCCESS_FINISHED); } } size_t LeAudioClientInterface::Sink::Read(uint8_t* p_buf, uint32_t len) { if (HalVersionManager::GetHalTransport() == BluetoothAudioHalTransport::HIDL) { Loading Loading @@ -456,6 +468,18 @@ void LeAudioClientInterface::Source::SuspendedForReconfiguration() { aidl::BluetoothAudioCtrlAck::SUCCESS_RECONFIGURATION); } void LeAudioClientInterface::Source::ReconfigurationComplete() { // This is needed only for AIDL since SuspendedForReconfiguration() // already calls StreamSuspended(SUCCESS_FINISHED) for HIDL if (HalVersionManager::GetHalTransport() == BluetoothAudioHalTransport::AIDL) { // FIXME: For now we have to workaround the missing API and use // StreamSuspended() with SUCCESS_FINISHED ack code. aidl::le_audio::LeAudioSourceTransport::interface->StreamSuspended( aidl::BluetoothAudioCtrlAck::SUCCESS_FINISHED); } } void LeAudioClientInterface::Source::ConfirmStreamingRequest() { if (HalVersionManager::GetHalTransport() == BluetoothAudioHalTransport::HIDL) { Loading
system/audio_hal_interface/le_audio_software.h +3 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ class LeAudioClientInterface { virtual void UpdateAudioConfigToHal( const ::le_audio::offload_config& config) = 0; virtual void SuspendedForReconfiguration() = 0; virtual void ReconfigurationComplete() = 0; }; public: Loading @@ -103,6 +104,7 @@ class LeAudioClientInterface { void UpdateBroadcastAudioConfigToHal( const ::le_audio::broadcast_offload_config& config); void SuspendedForReconfiguration() override; void ReconfigurationComplete() override; // Read the stream of bytes sinked to us by the upper layers size_t Read(uint8_t* p_buf, uint32_t len); bool IsBroadcaster() { return is_broadcaster_; } Loading @@ -124,6 +126,7 @@ class LeAudioClientInterface { void UpdateAudioConfigToHal( const ::le_audio::offload_config& config) override; void SuspendedForReconfiguration() override; void ReconfigurationComplete() override; // Source the given stream of bytes to be sinked into the upper layers size_t Write(const uint8_t* p_buf, uint32_t len); }; Loading
system/bta/le_audio/client.cc +23 −2 Original line number Diff line number Diff line Loading @@ -405,6 +405,15 @@ class LeAudioClientImpl : public LeAudioClient { } } static void ReconfigurationComplete(uint8_t directions) { if (directions & le_audio::types::kLeAudioDirectionSink) { leAudioClientAudioSource->ReconfigurationComplete(); } if (directions & le_audio::types::kLeAudioDirectionSource) { leAudioClientAudioSink->ReconfigurationComplete(); } } void CancelStreamingRequest() { if (audio_sender_state_ >= AudioState::READY_TO_START) { leAudioClientAudioSource->CancelStreamingRequest(); Loading Loading @@ -3548,14 +3557,26 @@ class LeAudioClientImpl : public LeAudioClient { /** Stop Audio but don't release all the Audio resources */ SuspendAudio(); break; case GroupStreamStatus::CONFIGURED_BY_USER: case GroupStreamStatus::CONFIGURED_BY_USER: { // Check which directions were suspended uint8_t previously_active_directions = 0; if (audio_sender_state_ >= AudioState::READY_TO_START) { previously_active_directions |= le_audio::types::kLeAudioDirectionSink; } if (audio_receiver_state_ >= AudioState::READY_TO_START) { previously_active_directions |= le_audio::types::kLeAudioDirectionSource; } /* We are done with reconfiguration. * Clean state and if Audio HAL is waiting, cancel the request * so Audio HAL can Resume again. */ CancelStreamingRequest(); HandlePendingAvailableContexts(group); break; ReconfigurationComplete(previously_active_directions); } break; case GroupStreamStatus::CONFIGURED_AUTONOMOUS: /* This state is notified only when * groups stays into CONFIGURED state after Loading
system/bta/le_audio/client_audio.cc +22 −0 Original line number Diff line number Diff line Loading @@ -449,6 +449,17 @@ void LeAudioClientAudioSource::SuspendedForReconfiguration() { sinkClientInterface_->SuspendedForReconfiguration(); } void LeAudioClientAudioSource::ReconfigurationComplete() { LOG(INFO) << __func__; if ((sinkClientInterface_ == nullptr) || (le_audio_sink_hal_state != HAL_STARTED)) { LOG(ERROR) << "LE audio device HAL was not started!"; return; } sinkClientInterface_->ReconfigurationComplete(); } void LeAudioClientAudioSource::CancelStreamingRequest() { LOG(INFO) << __func__; if ((sinkClientInterface_ == nullptr) || Loading Loading @@ -703,3 +714,14 @@ void LeAudioUnicastClientAudioSink::SuspendedForReconfiguration() { sourceClientInterface_->SuspendedForReconfiguration(); } void LeAudioUnicastClientAudioSink::ReconfigurationComplete() { LOG(INFO) << __func__; if ((sourceClientInterface_ == nullptr) || (le_audio_source_hal_state != HAL_STARTED)) { LOG(ERROR) << "LE audio device HAL was not started!"; return; } sourceClientInterface_->ReconfigurationComplete(); }
system/bta/le_audio/client_audio.h +2 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,7 @@ class LeAudioClientAudioSource { virtual void UpdateBroadcastAudioConfigToHal( const ::le_audio::broadcast_offload_config& config); virtual void SuspendedForReconfiguration(); virtual void ReconfigurationComplete(); static void DebugDump(int fd); Loading Loading @@ -170,6 +171,7 @@ class LeAudioUnicastClientAudioSink { virtual void UpdateRemoteDelay(uint16_t remote_delay_ms); virtual void UpdateAudioConfigToHal(const ::le_audio::offload_config& config); virtual void SuspendedForReconfiguration(); virtual void ReconfigurationComplete(); static void DebugDump(int fd); Loading