A method and system for controlling a radio frequency power amplifier

By monitoring in real time and controlling the start and stop of the RF power amplifier according to the received signal strength indication value, the problems of power consumption imbalance and signal jitter in the prior art are solved, and low power consumption and stable audio transmission are achieved.

CN122371909APending Publication Date: 2026-07-10SKY WING HK ELECTRONIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SKY WING HK ELECTRONIC CO LTD
Filing Date
2026-04-14
Publication Date
2026-07-10

Smart Images

  • Figure CN122371909A_ABST
    Figure CN122371909A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of radio frequency power amplifier control, and discloses a radio frequency power amplifier control method and system.The method initializes radio frequency power amplifier state variables and GPIO control pins to a closed state, activates a received signal strength indication monitoring task in response to the start of A2DP media stream transmission, obtains a received signal strength indication value of the monitoring task in the current period, and performs enable control on the radio frequency power amplifier according to the received signal strength indication value and the GPIO control pin.The present application eliminates the invalid power consumption interval existing in the existing fixed open mode and connection state control mode, reduces the average power consumption, and guarantees the continuous stability of audio transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of radio frequency power amplifier control technology, and in particular to a radio frequency power amplifier control method and system. Background Technology

[0002] With the widespread adoption of wireless audio technology, Bluetooth audio transmitters are widely used in consumer electronics. To ensure the stability and audio quality of long-distance transmission, these devices typically integrate radio frequency (RF) power amplifiers to amplify the transmitted signal power and overcome path loss and interference. In portable battery-powered devices, power consumption is a core design metric, and the RF power amplifier, as the main source of power consumption in the RF front-end, directly affects the device's battery life.

[0003] Existing technologies control RF power amplifiers using either a fixed-on mode or a connection-state control mode. The fixed-on mode continuously drives the RF power amplifier throughout the device's operation, regardless of the distance between the transmitter and receiver, resulting in maximum power consumption and wasted energy. The connection-state control mode determines the RF power amplifier's on / off state solely based on logical connection events in the Bluetooth protocol stack, completely ignoring the actual quality of the physical layer wireless channel. In scenarios with sufficient signal at close range, activating the RF power amplifier constitutes ineffective power consumption.

[0004] The existing technology has the following technical problems: 1. The control decision lacks real-time awareness of the key channel quality indicator, the strength of the received signal at the physical layer; 2. There is a significant amount of unnecessary overlap between the duty cycle of the RF power amplifier and the actual audio transmission cycle; 3. The lack of anti-shake mechanism in the critical signal strength region may cause audio playback to stutter due to frequent start-stop of the RF power amplifier, making it impossible to achieve the optimal balance between ensuring connection quality and saving energy. Summary of the Invention

[0005] The main objective of this invention is to provide a radio frequency power amplifier control method and system. This invention eliminates a large number of invalid power consumption ranges existing in the current fixed on mode and connection state control mode, reduces average power consumption, and ensures the continuous stability of audio transmission.

[0006] To achieve the above objectives, the present invention provides a radio frequency power amplifier control method, comprising the following steps: Initialize the RF power amplifier state variables and GPIO control pins to the off state, and activate the monitoring task of the received signal strength indicator in response to the start of A2DP media stream transmission state. The received signal strength indication value of the monitoring task in the current period is obtained, and the RF power amplifier is enabled based on the received signal strength indication value and the GPIO control pin.

[0007] Optionally, in a first implementation of the first aspect of the present invention, the RF power amplifier state variables and GPIO control pins are initialized to a closed state, and in response to the start of the A2DP media stream transmission state, the monitoring task of the received signal strength indication is activated, including: Set the RF power amplifier state variable to FALSE and output a low-level signal to the GPIO control pin to drive the RF power amplifier enable terminal to enter the off state. In response to the start of A2DP media stream transmission status, activate the monitoring task for received signal strength indication.

[0008] Optionally, in a second implementation of the first aspect of the present invention, activating a monitoring task for the received signal strength indication in response to the initiation of the A2DP media stream transmission state includes: In response to the A2DP media stream transmission status entering the connected media stream transmission state, the received signal strength indication monitoring activity flag is set to TRUE, and the first received signal strength indication monitoring message with a preset initial delay is sent through the message queue to activate the received signal strength indication monitoring task.

[0009] Optionally, in a third implementation of the first aspect of the present invention, obtaining the received signal strength indication value of the monitoring task in the current period, and performing enable control on the RF power amplifier according to the received signal strength indication value and the GPIO control pin, includes: Check the Bluetooth connection status and call the aptX Adaptive encoder RF signal parameter interface to obtain the received signal strength indication value of the monitoring task in the current period; The received signal strength indication value is compared with a preset low threshold and a preset high threshold to determine whether the RF power amplifier is turned on, turned off, or remains unchanged, and the RF power amplifier is enabled through the GPIO control pin.

[0010] Optionally, in a fourth implementation of the first aspect of the present invention, the received signal strength indication value is compared with a preset low threshold and a preset high threshold to determine whether the RF power amplifier is turned on, turned off, or remains unchanged, and enable control of the RF power amplifier is performed through the GPIO control pin, including: The received signal strength indication value is compared with a preset low threshold and a preset high threshold; When the received signal strength indication value is lower than the preset low threshold, the flag for turning on the RF power amplifier by the received signal strength indication monitoring and control is set to TRUE, and the RF power amplifier is enabled through the GPIO control pin; When the received signal strength indication value is higher than the preset high threshold, the flag for the RF power amplifier to be turned on by the received signal strength indication monitoring and control is set to FALSE, and the RF power amplifier is enabled through the GPIO control pin; When the received signal strength indication value is between the preset low threshold and the preset high threshold, the state variable of the radio frequency power amplifier remains unchanged.

[0011] Optionally, in a fifth implementation of the first aspect of the present invention, when the received signal strength indication value is lower than the preset low threshold, the flag for controlling the RF power amplifier to be turned on by the received signal strength indication monitoring is set to TRUE, and enable control of the RF power amplifier is performed through the GPIO control pin, including: When the received signal strength indication value is lower than the preset low threshold, the flag for turning on the RF power amplifier by the received signal strength indication monitoring and control is set to TRUE, and a high-level signal is output to the GPIO control pin to perform level driving processing on the enable terminal of the RF power amplifier.

[0012] Optionally, in a sixth implementation of the first aspect of the present invention, when the received signal strength indication value is higher than the preset high threshold, the flag for the RF power amplifier to be turned on by the received signal strength indication monitoring is set to FALSE, and enable control of the RF power amplifier is performed through the GPIO control pin, including: When the received signal strength indication value is higher than the preset high threshold, the flag for the RF power amplifier to be turned on by the received signal strength indication monitoring and control is set to FALSE, and a low-level signal is output to the GPIO control pin to perform level drive processing on the RF power amplifier enable terminal.

[0013] Optionally, in a seventh implementation of the first aspect of the present invention, after performing level driving processing on the enable terminal of the RF power amplifier, the method further includes: Send a delayed message to the monitoring task via a message queue to trigger the next monitoring cycle; When the A2DP media stream transmission state exits or the Bluetooth connection is disconnected, the pending delayed messages in the message queue are canceled, and the RF power amplifier is turned off through the GPIO control pin, resetting the RF power amplifier state variable to the off state.

[0014] Optionally, in the eighth implementation of the first aspect of the present invention, when the A2DP media stream transmission state exits or the Bluetooth connection is disconnected, the pending delayed messages in the message queue are canceled, and the RF power amplifier is turned off via the GPIO control pin, resetting the RF power amplifier state variable to the off state, including: In response to an A2DP media stream transmission status exit or Bluetooth connection disconnection event, perform full cancellation processing on all pending messages of type Received Signal Strength Indication Monitoring Task Trigger Message in the message queue, output a low-level signal to the RF power amplifier enable terminal through the GPIO control pin, set the Received Signal Strength Indication Monitoring activity flag and the RF power amplifier control flag to FALSE, and reset the RF power amplifier state variable to the off state.

[0015] The present invention also provides a radio frequency power amplifier control system, comprising: The activation module is used to initialize the RF power amplifier state variables and GPIO control pins to the off state, respond to the start of A2DP media stream transmission state, and activate the monitoring task of received signal strength indication. The enable control module is used to obtain the received signal strength indication value of the monitoring task in the current period, and to perform enable control on the RF power amplifier according to the received signal strength indication value and the GPIO control pin.

[0016] In summary, this invention strictly anchors the start and stop of the periodic monitoring task for received signal strength indication to the lifecycle of the A2DP media stream transmission state. The monitoring task is activated and RF power amplifier control is executed only during actual audio transmission. When the A2DP media stream transmission state exits or the Bluetooth connection is lost, pending delayed messages in the message queue are immediately canceled and the RF power amplifier is turned off. This eliminates a large number of invalid power consumption intervals present in existing fixed-on modes and connection state control modes, reducing average power consumption. Furthermore, through aptX... The Adaptive encoder's RF signal parameter interface acquires the received signal strength indication value in real time, upgrading the control decision from a fixed logic state to closed-loop feedback control based on continuous physical quantities. When the signal strength is below a preset low threshold, the RF power amplifier is activated to enhance transmission power and ensure link stability; when the signal strength is above a preset high threshold, the RF power amplifier is deactivated to save power, realizing on-demand driving of the RF power amplifier based on real-time wireless channel quality. A hysteresis interval mechanism consisting of preset low and high thresholds is employed. When the received signal strength indication value is between the two thresholds, the current value of the RF power amplifier's state variable is directly read as the control decision for the current cycle. The flag indicating that the RF power amplifier is activated by the received signal strength indication remains unchanged, eliminating the frequent jitter switching problem that inevitably exists near the critical point in single-threshold control schemes, ensuring the continuous stability of audio transmission. Through the coordinated management of the received signal strength indication monitoring activity flag and the flag indicating that the RF power amplifier is activated by the received signal strength indication monitoring, the software control state and the actual hardware working state are always consistent, preventing redundant and repetitive control operations. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the steps of a radio frequency power amplifier control method in one embodiment of the present invention; Figure 2 This is a flowchart of the dual threshold comparison of the received signal strength indication value and the RF power amplifier enable control in an embodiment of the present invention; Figure 3 This is a block diagram of the radio frequency power amplifier control system in an embodiment of the present invention.

[0018] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0020] Reference Figure 1This embodiment provides a radio frequency power amplifier control method, including: S1 initializes the RF power amplifier state variables and GPIO control pins to the off state, responds to the start of A2DP media stream transmission state, and activates the monitoring task of received signal strength indication. S2, acquire the received signal strength indication value of the monitoring task in the current cycle, and perform enable control on the RF power amplifier based on the received signal strength indication value and the GPIO control pin.

[0021] In one example, the RF power amplifier state variables and GPIO control pins are initialized to the off state. In response to the start of the A2DP media stream transmission state, a monitoring task for received signal strength indication is activated, including: Set the RF power amplifier state variable to FALSE and output a low-level signal to the GPIO control pin to drive the RF power amplifier enable terminal to enter the off state. In response to the start of A2DP media stream transmission status, activate the monitoring task for received signal strength indication.

[0022] In this example, during the system initialization process, a synchronous reset operation is performed on the software state variables and hardware control pins related to the RF power amplifier. Specifically, after the RF power amplifier dynamic control module is loaded, the state variable rf_pa_enabled_by_rssi, which records the RF power amplifier's on / off state controlled by the received signal strength, is explicitly assigned the value FALSE. This makes the state variable logically indicate that the RF power amplifier is currently in the off state. At the same time, by calling the appSmPioEnableControl(PIO_FOR_RF_POWER, FALSE) function, a low-level signal is output to the corresponding general-purpose input / output pin PIO_FOR_RF_POWER of the RF power amplifier. Since the enable pin of the RF power amplifier chip uses a high-level active control method, when PIO_FOR_RF_POWER outputs a low level, the enable pin of the RF power amplifier is pulled low, thereby driving the RF power amplifier into the off state. This stops the RF front-end from power amplification, eliminating unnecessary current consumption before the device establishes audio transmission. During this process, the software state variable rf_pa_enabled_by_rssi is kept completely consistent with the GPIO physical level state. After completing the initialization and shutdown actions, the system enters the Bluetooth protocol stack runtime phase and listens for media stream state change events in the A2DP (Advanced Audio Distribution Protocol) audio stream management module. When it detects that A2DP has entered the CONNECTED_MEDIA_STREAMING media stream transmission state, it indicates that audio data has started to be actually transmitted through the Bluetooth link. At this time, the system responds by calling the appA2dpEnterConnectedMediaStreamingForSource() function. Inside this function, the usbDongleSmStartRssiMonitor() interface is triggered to start the Received Signal Strength Indicator (RSSI) monitoring task. Before starting the monitoring task, the rssi_mo The `nitor_active` state variable is set to `TRUE` to indicate that the monitoring function has entered an active state. At the same time, it is confirmed that the RF power amplifier is still in the off state as the initial monitoring baseline. Then, the `MessageSendLater` function is called through the message queue mechanism to send a message of type `SM_INTERNAL_RSSI_MONITOR` with a delay of 100 milliseconds. This allows the system to start the first RSSI sampling after the media stream stabilizes. The 100-millisecond delay is used to avoid signal fluctuations at the moment the audio stream is established from interfering with the judgment. Subsequently, a continuous monitoring closed loop is formed through a 500-millisecond periodic scheduling. This ensures that the received signal strength monitoring task is activated only when the A2DP media stream is actually started, so that the RF power amplifier control logic is precisely bound to the audio transmission lifecycle.

[0023] In one example, in response to the initiation of the A2DP media stream transmission status, a monitoring task for received signal strength indication is activated, including: In response to the A2DP media stream transmission status entering the connected media stream transmission state, the received signal strength indication monitoring activity flag is set to TRUE, and the first received signal strength indication monitoring message with a preset initial delay is sent through the message queue to activate the received signal strength indication monitoring task.

[0024] In this example, to ensure that the Received Signal Strength Indicator (RSI) monitoring task is activated only during actual audio transmission and consistent with the A2DP (Advanced Audio Distribution Protocol) media stream lifecycle, the A2DP audio stream management module listens for media stream state transition events. When the A2DP media stream transmission state enters the CONNECTED_MEDIA_STREAMING state, the A2DP audio stream management module triggers the monitoring startup process through the key function appA2dpEnterConnectedMediaStreamingForSource(), which is crucial for entering the media stream transmission state. Within this process, the RSI monitoring management module calls the u function... The sbDongleSmStartRssiMonitor() interface enters the event in response state. At the software level, it explicitly sets the received signal strength indicator monitoring activity flag rssi_monitor_active to TRUE, so that the value of rssi_monitor_active provides a unique and repeatable basis for judging the activity status of the monitoring task. At the same time, after setting rssi_monitor_active to TRUE, it performs consistency processing on the initial operating environment of the monitoring task, including confirming that the software state and hardware control related to the RF power amplifier control are at a known initial shutdown baseline, so as to avoid control deviations caused by historical residual states when monitoring is just started. The system relies on a message queue mechanism to trigger the monitoring task for the first time. Specifically, inside usbDongleSmStartRssiMonitor(), a monitoring message of type SM_INTERNAL_RSSI_MONITOR is sent to the message queue through the MessageSendLater function. A preset initial delay of 100 milliseconds is configured for the monitoring message. After the delay expires, the monitoring message is distributed to the processing entry of usbDongleSmHandleRssiMonitor() in the received signal strength indication monitoring processing module. After the A2DP media stream status stabilizes, the first received signal strength indication sampling and subsequent RF power amplifier control logic are started. The preset initial delay of 100 milliseconds is used to suppress the impact of transient fluctuations in the newly established media stream on the received signal strength indication sampling results and improve the reliability of the first judgment. Thus, in the same control link where the A2DP connected media stream transmission status is confirmed, rssi_monitor_active is set, the first monitoring message is sent, and the monitoring task is activated.

[0025] In one example, the received signal strength indication value of the monitoring task in the current period is obtained, and enable control of the RF power amplifier is performed based on the received signal strength indication value and the GPIO control pin, including: Check the Bluetooth connection status and call the aptX Adaptive encoder RF signal parameter interface to obtain the received signal strength indication value of the monitoring task in the current period; The received signal strength indicator value is compared with the preset low threshold and the preset high threshold to determine whether the RF power amplifier is turned on, turned off, or remains unchanged, and the RF power amplifier is enabled through the GPIO control pin.

[0026] In this example, at the beginning of each monitoring cycle, the process enters the received signal strength indication monitoring processing entry usbDongleSmHandleRssiMonitor(). At the start of this entry, a Bluetooth connection status check is performed to ensure that monitoring and control actions only occur when the link is valid. Specifically, the Bluetooth connection status is obtained by calling SinkService_IsConnected(). If the return value is FALSE, it indicates that the Bluetooth link has been interrupted, immediately stopping the received signal strength indication sampling and RF power amplifier control flow for this cycle and transitioning to the connection disconnection processing path to avoid meaningless control overhead in an invalid link state. If the return value is TRUE, it indicates that the Bluetooth link is in a valid connection state, and then aptX is called. The Kymera_AptxAdEncoderGetRfSignalParams() interface of the Adaptive encoder reads the Received Signal Strength Indicator (RSSI) value corresponding to the current audio transmission link from the encoder's internal RF signal parameter structure. This value represents the received power level of the peer link packets received at the local end and serves as a link quality proxy. The unit of the RSSI value is dBm, and the closer the value is to 0, the stronger the received signal, and the more negative the value, the weaker the received signal. Therefore, the RSSI value can be used as a physical quantity input to determine whether RF power amplifier gain assistance is needed.The received signal strength indicator (RSSI) is compared with preset low thresholds RSSI_THRESHOLD_LOW = -100 dBm and RSSI_THRESHOLD_HIGH = -50 dBm to generate control decisions for the RF power amplifier. When RSSI is less than -100 dBm, the wireless channel signal strength is determined to be significantly attenuated, and the RF power amplifier needs to be turned on to improve the anti-interference capability of the transmit link. In this case, the desired state of the RF power amplifier is set to on, and the RF power amplifier state variable (rf_pa_enabled_by_rssi) is synchronously updated to TRUE to record the result of the RF power amplifier being turned on by the received signal strength indicator. Simultaneously, appSmPioEnableControl(PIO_FOR_RF_POWER, TRUE) is called to output a high-level signal to the GPIO control pin PIO_FOR_RF_POWER to drive the RF power amplifier enable pin into the working state. When RSSI is greater than -50 dBm... When the RSSI is between -100 dBm and -50 dBm and includes the endpoint, it is determined that the received signal strength indicator value is in the hysteresis range and the RF power amplifier needs to be turned off to eliminate unnecessary power consumption. At this time, the desired state of the RF power amplifier is set to off and the state variable rf_pa_enabled_by_rssi is updated to FALSE. At the same time, appSmPioEnableControl(PIO_FOR_RF_POWER, FALSE) is called to output a low-level signal to PIO_FOR_RF_POWER to drive the RF power amplifier enable terminal to enter the off state. When the RSSI is between -100 dBm and -50 dBm and includes the endpoint, it is determined that the received signal strength indicator value is in the hysteresis range and the RF power amplifier state remains unchanged. That is, the desired state of the RF power amplifier inherits the current value of rf_pa_enabled_by_rssi and keeps the output level of the GPIO control pin unchanged. In this way, the 50 dBm hysteresis range formed between the low threshold and the high threshold is used to suppress the frequent switching of the critical region. After completing threshold comparison, decision generation, and GPIO enable control operations, the value of rf_pa_enabled_by_rssi is kept consistent with the actual output level of PIO_FOR_RF_POWER to achieve synchronization of the RF power amplifier's hardware and software states. Then, the MessageSendLater is called again through the message queue to deliver the subsequent SM_INTERNAL_RSSI_MONITOR message to maintain the periodic operation of the 500-millisecond monitoring interval.

[0027] In one example, the received signal strength indication value is compared with preset low thresholds and preset high thresholds to determine whether the RF power amplifier is on, off, or unchanged. Enable control of the RF power amplifier is performed via GPIO control pins, including: Compare the received signal strength indication value with the preset low threshold and the preset high threshold; When the received signal strength indicator value is lower than the preset low threshold, the flag for the RF power amplifier to be turned on by the received signal strength indicator monitoring and control is set to TRUE, and the RF power amplifier is enabled through the GPIO control pin. When the received signal strength indicator value is higher than the preset high threshold, the flag for the RF power amplifier to be turned on by the received signal strength indicator monitoring and control is set to FALSE, and the RF power amplifier is enabled through the GPIO control pin. When the received signal strength indication value is between the preset low threshold and the preset high threshold, the state variable of the RF power amplifier remains unchanged.

[0028] In this example, the Received Signal Strength Indicator (RSSI) value for the current period is read and compared with a preset low threshold (RSSI_THRESHOLD_LOW = -100 dBm) and a preset high threshold (RSSI_THRESHOLD_HIGH = -50 dBm). A dual-threshold hysteresis judgment mechanism is constructed to generate control decisions for the RF power amplifier. Specifically, when the RSSI value is lower than the preset low threshold (RSSI < -100 dBm), the flag `rf_pa_enabled_by_rssi`, which controls the RF power amplifier to be on by RSSI monitoring, is set to TRUE. This ensures that `rf_pa_enabled_by_rssi` records the RF power amplifier's on state at the software level and provides a traceable state reference for "maintaining the current state" during the hysteresis interval. Simultaneously, the GPIO control function `appSmPioEnableControl(PIO_FOR_RF_POWER, ...` is used. The system outputs a high-level signal to the GPIO control pin PIO_FOR_RF_POWER (TRUE) to drive the RF power amplifier enable pin into the working state and complete the enable control of the RF power amplifier. After the GPIO control action is completed, the system maintains the value of rf_pa_enabled_by_rssi as TRUE to ensure that the software state variable is consistent with the actual hardware output level. When the received signal strength indicator value is higher than the preset high threshold (RSSI>-50 dBm), the flag rf_pa_enabled_by_rssi, which controls the RF power amplifier to be turned on by the received signal strength indicator, is set to FALSE. This allows rf_pa_enabled_by_rssi to record in the software that the RF power amplifier should be in the off state to avoid unnecessary power consumption in scenarios with sufficient signal. At the same time, by calling appSmPioEnableControl(PIO_FOR_RF_POWER, The PIO_FOR_RF_POWER outputs a low-level signal (FALSE) to drive the RF power amplifier enable pin to enter the off state and complete the RF power amplifier enable control. After the GPIO control action is completed, the rf_pa_enabled_by_rssi value is kept at FALSE to achieve synchronous update of the RF power amplifier state variables and GPIO physical level. When the received signal strength indication value is between the preset low threshold and the preset high threshold and includes the endpoint (i.e., -100 dBm ≤ RSSI ≤ -50 dBm), it is determined that the received signal strength indication value has entered the hysteresis range and the RF power amplifier state variables remain unchanged. That is, rf_pa_enabled_by_rssi is not set or cleared and the output level of PIO_FOR_RF_POWER is not changed, so that the RF power amplifier maintains the on or off state established in the previous monitoring cycle.

[0029] Figure 2 This is a flowchart of a dual-threshold comparison and RF power amplifier enable control based on the received signal strength indication value. Starting with the received signal strength indication value, it determines whether the value is lower than a preset low threshold. If so, it sequentially executes three operations: setting the RF power amplifier enable flag to TRUE, controlling the GPIO control pin to output a high-level signal, and driving the RF power amplifier enable terminal into the enabled state. If not, it further determines whether the received signal strength indication value is higher than a preset high threshold. If so, it sequentially executes three operations: setting the RF power amplifier enable flag to TRUE, controlling the GPIO control pin to output a high-level signal, and driving the RF power amplifier enable terminal into the enabled state. If the received signal strength indication value is between the preset low threshold and the preset high threshold, it is determined that the current signal strength is in the lag range, the current value of the RF power amplifier state variable remains unchanged, and no enable control operation is performed.

[0030] In one example, when the received signal strength indication value is lower than a preset low threshold, the flag controlling the RF power amplifier to be turned on by the received signal strength indication monitoring is set to TRUE. Enable control of the RF power amplifier is then performed via the GPIO control pin, including: When the received signal strength indication value is lower than the preset low threshold, the flag for turning on the RF power amplifier by the received signal strength indication monitoring control is set to TRUE, and a high-level signal is output to the GPIO control pin to perform level drive processing on the enable terminal of the RF power amplifier.

[0031] In this example, the received signal strength indicator value is compared with a preset low threshold RSSI_THRESHOLD_LOW=-100dBm to form a threshold trigger condition. When the comparison result satisfies RSSI<-100 dBm, it is determined that the signal strength of the current wireless link is in a significantly attenuated range and the power margin of the transmit link needs to be increased through the RF power amplifier. Thus, at the software level, the flag rf_pa_enabled_by_rssi, which controls the RF power amplifier to be turned on by the received signal strength indicator monitoring, is set to TRUE. This makes rf_pa_enabled_by_rssi the only valid state record in this cycle and is used to characterize that the RF power amplifier should be in the on state. At the same time, the setting operation of rf_pa_enabled_by_rssi also serves as a reference input to keep the state unchanged in the subsequent hysteresis range determination, so that the system can still maintain a stable predetermined state when the received signal strength indicator value returns to between -100 dBm and -50 dBm. After setting rf_pa_enabled_by_rssi to TRUE, at the hardware level, the GPIO control module calls appSmPioEnableControl(PIO_FOR_RF_POWER, The system displays `TRUE` and outputs a high-level signal to the GPIO control pin `PIO_FOR_RF_POWER`. Since the enable pin of the RF power amplifier uses high-level active logic, the high-level output of `PIO_FOR_RF_POWER` creates a clear level drive for the RF power amplifier's enable pin, causing the RF power amplifier to switch from the off state to the enabled state and begin power amplification of the wireless audio transmission RF signal. Simultaneously, to prevent control drift caused by inconsistencies between software state variables and hardware output levels, `rf_pa_enabled_by_rssi` is kept at `TRUE` after the GPIO level drive processing is complete, and this value is used as the result of the synchronous update of the RF power amplifier's state variables. This ensures that the logical meaning of `rf_pa_enabled_by_rssi` is consistent with the actual output level of `PIO_FOR_RF_POWER`, thereby completing low-threshold trigger determination, setting `rf_pa_enabled_by_rssi`, high-level output of `PIO_FOR_RF_POWER`, level drive enable pin, and synchronous update of the RF power amplifier's state variables within the same control link.

[0032] In one example, when the received signal strength indication value is higher than a preset high threshold, the flag controlling the RF power amplifier to be turned on by the received signal strength indication monitoring is set to FALSE. Enable control of the RF power amplifier is then performed via the GPIO control pin, including: When the received signal strength indication value is higher than the preset high threshold, the flag for the RF power amplifier to be turned on by the received signal strength indication monitoring and control is set to FALSE, and a low-level signal is output to the GPIO control pin to perform level drive processing on the RF power amplifier enable terminal.

[0033] In this example, the received signal strength indicator value is compared with a preset high threshold RSSI_THRESHOLD_HIGH=-50dBm to generate a high threshold trigger condition. When the comparison result satisfies RSSI>-50 dBm, it is determined that the signal strength of the current wireless link is in the sufficient range and no additional gain is required from the RF power amplifier. Therefore, at the software level, the flag rf_pa_enabled_by_rssi, which controls the RF power amplifier to be turned on by the received signal strength indicator monitoring, is set to FALSE. This makes rf_pa_enabled_by_rssi logically record that the RF power amplifier should be in the off state and serve as an inheritance reference when the state remains unchanged in the hysteresis range. At the same time, setting rf_pa_enabled_by_rssi to FALSE also eliminates the historical state residue of the RF power amplifier being turned on due to weak signal, avoiding maintaining high power consumption in scenarios where the signal has recovered well. After clearing rf_pa_enabled_by_rssi, the GPIO control module calls appSmPioEnableControl(PIO_FOR_RF_POWER, The system outputs a low-level signal to the GPIO control pin PIO_FOR_RF_POWER (FALSE). Since the enable pin of the RF power amplifier uses high-level active logic, the low-level output of PIO_FOR_RF_POWER creates a clear shutdown level drive for the RF power amplifier's enable pin, causing the RF power amplifier to switch from the enabled state to the off state and stop amplifying the power of the wireless audio transmission RF signal. This eliminates the quiescent current consumption of the RF power amplifier and reduces system power consumption. At the same time, to maintain the consistency between the software control state and the hardware level output and to avoid state drift caused by periodic lag judgment, after the GPIO level drive processing is completed, the value of rf_pa_enabled_by_rssi is maintained at FALSE and this value is used as the synchronous update result of the RF power amplifier's state variables, so that the logical meaning of rf_pa_enabled_by_rssi is consistent with the actual low-level output state of PIO_FOR_RF_POWER.

[0034] In one example, after synchronously updating the RF power amplifier state variables, the process also includes: Send a delayed message to the monitoring task via a message queue to trigger the next monitoring cycle; When the A2DP media stream transmission state exits or the Bluetooth connection is disconnected, the pending delayed messages in the message queue are canceled, and the RF power amplifier is turned off via the GPIO control pin, resetting the RF power amplifier state variable to the off state.

[0035] In this example, a delayed message is sent to the monitoring task via a message queue mechanism at the end of the monitoring processing function usbDongleSmHandleRssiMonitor() to trigger the next monitoring cycle. Specifically, MessageSendLater is called with SM_INTERNAL_RSSI_MONITOR as the message type to deliver the next monitoring trigger request to the message queue. A preset delay of 500 milliseconds is set for this message, ensuring that SM_INTERNAL_RSSI_MONITOR is dispatched and re-enters usbDongleSmHandleRssiMonitor after 500 milliseconds. The `tor()` function's entry point implements periodic monitoring and scheduling at 500-millisecond intervals, and can promptly execute the next round of received signal strength indicator sampling and RF power amplifier control when link quality changes. Simultaneously, to avoid continuing meaningless monitoring and control when audio transmission stops or the link fails, thus avoiding unnecessary processing overhead and power consumption risks, a unified monitoring termination and resource release process is executed when two termination conditions occur: A2DP media stream transmission status exit and Bluetooth connection disconnection. Specifically, when the A2DP audio stream management module detects that the media stream transmission status has exited from `CONNECTED_MEDIA_STREAMING`, the system exits the media stream transmission... The key function `appA2dpExitConnectedMediaStreaming()` triggers a call to `usbDongleSmStopRssiMonitor()` to terminate the received signal strength indicator monitoring task. Inside `usbDongleSmStopRssiMonitor()`, the received signal strength indicator monitoring activity flag `rssi_monitor_active` is first set to `FALSE` to indicate that the monitoring task is no longer active. Then, `MessageCancelAll` is called to cancel all undistributed `SM_INTERNAL_RSSI_MONITOR` pending delayed messages in the message queue, thereby cutting off the periodic monitoring scheduling chain and preventing the monitoring processing entry from being passively triggered after the media stream has exited. Similarly, when the monitoring processing module calls `SinkService_IsConnected()` at the beginning of each cycle to check the Bluetooth connection status and finds that the return value is `FALSE`, the system determines that the Bluetooth connection has been disconnected and immediately enters the disconnection processing path. Thus, `MessageCancelAll` is also executed to cancel the `SM_INTERNAL_RSSI_MONITOR` pending delayed messages, ensuring that no subsequent cycles are triggered after the link is interrupted, causing idle operation.After completing message queue cleanup, the RF power amplifier is turned off via the GPIO control pin to achieve hardware-level power consumption convergence. Specifically, appSmPioEnableControl(PIO_FOR_RF_POWER, FALSE) is called to output a low-level signal to PIO_FOR_RF_POWER and drive the RF power amplifier enable pin to enter the off state, causing the RF power amplifier to stop working and eliminating the static current consumption during the link invalid phase. At the same time, to ensure that the software state is consistent with the hardware control state and to provide a deterministic initial state reference for the next media stream startup, the RF power amplifier is reset from the received signal strength indication monitoring control flag rf_pa_enabled_by_rssi to FALSE, and this reset result is synchronized with the low-level output state of PIO_FOR_RF_POWER. Thus, a closed-loop end-of-line process of delayed message cancellation, RF power amplifier shutdown, and RF power amplifier state variable reset is achieved under the conditions of media stream exit or connection disconnection.

[0036] In one example, when the A2DP media stream transmission state exits or the Bluetooth connection is lost, pending delayed messages in the message queue are canceled, and the RF power amplifier is turned off via the GPIO control pin, resetting the RF power amplifier state variable to the off state, including: In response to A2DP media stream transmission status exit or Bluetooth connection disconnection events, perform full cancellation processing on all pending messages in the message queue of type Received Signal Strength Indication Monitoring Task Trigger Message, output a low-level signal to the RF power amplifier enable terminal through the GPIO control pin, set the Received Signal Strength Indication Monitoring activity flag and the RF power amplifier control flag to FALSE, and reset the RF power amplifier status variable to the off state.

[0037] In this example, when the A2DP (Advanced Audio Distribution Protocol) media stream transmission status exit is detected or the Bluetooth connection status check at the beginning of the monitoring cycle finds a link disconnection, in order to ensure that the received signal strength indicator of the monitoring task is consistent with the actual audio transmission lifecycle and to avoid continuing to trigger the monitoring processing entry in an invalid state, the monitoring termination and status reset process is entered in the corresponding event response path. Specifically, in the scenario of A2DP media stream transmission status exit, the A2DP audio stream management module triggers usbDongleSmStopRssiMonitor() through appA2dpExitConnectedMediaStreaming() to execute the monitoring stop process. In the scenario of Bluetooth connection disconnection, webDongleSmHandleRssiMonitor()... After the `onitor()` function calls `SinkService_IsConnected()` and receives a `FALSE` return value, it also proceeds to the termination handling logic equivalent to `usbDongleSmStopRssiMonitor()`. Therefore, under both types of termination events, it uniformly performs a full cancellation process on all `SM_INTERNAL_RSSI_MONITOR` received signal strength indication monitoring task trigger messages in the message queue. Specifically, it uses `MessageCancelAll` to clear and cancel all undistributed `SM_INTERNAL_RSSI_MONITOR` pending delayed messages in the message queue, thus completely cutting off the trigger chain for subsequent cycles and preventing residual delayed messages from continuing to drive the monitoring task after the media stream has exited or the connection has been broken. After completing the full cancellation of the message queue, it performs a hardware shutdown of the RF power amplifier to achieve power convergence, i.e., it calls `appSmPioEnableControl(PIO_FOR_RF_POWER, ...` The system outputs a low-level signal to the RF power amplifier enable pin via the GPIO control pin PIO_FOR_RF_POWER (FALSE). Since the enable pin is active high, the low-level output creates a clear shutdown level for the RF power amplifier enable pin, causing the RF power amplifier to enter the off state. Simultaneously, to ensure consistency between the software logic state and the hardware physical state and to provide a definite initial reference for the next A2DP media stream transmission state re-entry, the received signal strength indicator monitoring activity flag rssi_monitor_active is set to FALSE to indicate that the monitoring task has exited the active state. The flag rf_pa_enabled_by_rssi, which controls the RF power amplifier to be turned on by the received signal strength indicator monitoring, is also set to FALSE to clear the start-up record driven by the received signal strength indicator monitoring, ensuring that the value of rf_pa_enabled_by_rssi is synchronized with the RF power amplifier shutdown state corresponding to the low-level output of PIO_FOR_RF_POWER.

[0038] Reference Figure 3 This embodiment provides a radio frequency power amplifier control system, including: Activation module 1 is used to initialize the RF power amplifier state variables and GPIO control pins to the off state, respond to the start of A2DP media stream transmission state, and activate the monitoring task of received signal strength indication. Enable control module 2 is used to obtain the received signal strength indication value of the monitoring task in the current cycle, and perform enable control on the RF power amplifier according to the received signal strength indication value and the GPIO control pin.

[0039] In this embodiment, the specific implementation of each unit in the above system embodiment is described in the above method embodiment, and will not be repeated here.

[0040] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, system, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, system, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, system, article, or method that includes that element.

[0041] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for controlling a radio frequency power amplifier, characterized in that, include: Initialize the RF power amplifier state variables and GPIO control pins to the off state, and activate the monitoring task of the received signal strength indicator in response to the start of A2DP media stream transmission state. The received signal strength indication value of the monitoring task in the current period is obtained, and the RF power amplifier is enabled based on the received signal strength indication value and the GPIO control pin.

2. The radio frequency power amplifier control method according to claim 1, characterized in that, Initialize the RF power amplifier state variables and GPIO control pins to the off state, respond to the start of A2DP media stream transmission, and activate the monitoring task for received signal strength indication, including: Set the RF power amplifier state variable to FALSE and output a low-level signal to the GPIO control pin to drive the RF power amplifier enable terminal to enter the off state. In response to the start of A2DP media stream transmission status, activate the monitoring task for received signal strength indication.

3. The radio frequency power amplifier control method according to claim 2, characterized in that, In response to the activation of the A2DP media stream transmission status, the monitoring task for the received signal strength indication is activated, including: In response to the A2DP media stream transmission status entering the connected media stream transmission state, the received signal strength indication monitoring activity flag is set to TRUE, and the first received signal strength indication monitoring message with a preset initial delay is sent through the message queue to activate the received signal strength indication monitoring task.

4. The radio frequency power amplifier control method according to claim 1, characterized in that, Acquire the received signal strength indication value of the monitoring task in the current period, and perform enable control on the RF power amplifier based on the received signal strength indication value and the GPIO control pin, including: Check the Bluetooth connection status and call the aptX Adaptive encoder RF signal parameter interface to obtain the received signal strength indication value of the monitoring task in the current period; The received signal strength indication value is compared with a preset low threshold and a preset high threshold to determine whether the RF power amplifier is turned on, turned off, or remains unchanged, and the RF power amplifier is enabled through the GPIO control pin.

5. The radio frequency power amplifier control method according to claim 4, characterized in that, The received signal strength indication value is compared with a preset low threshold and a preset high threshold to determine whether the RF power amplifier is on, off, or unchanged. Enable control of the RF power amplifier is then performed via the GPIO control pin, including: The received signal strength indication value is compared with a preset low threshold and a preset high threshold; When the received signal strength indication value is lower than the preset low threshold, the flag for turning on the RF power amplifier by the received signal strength indication monitoring and control is set to TRUE, and the RF power amplifier is enabled through the GPIO control pin; When the received signal strength indication value is higher than the preset high threshold, the flag for the RF power amplifier to be turned on by the received signal strength indication monitoring and control is set to FALSE, and the RF power amplifier is enabled through the GPIO control pin; When the received signal strength indication value is between the preset low threshold and the preset high threshold, the state variable of the radio frequency power amplifier remains unchanged.

6. The radio frequency power amplifier control method according to claim 5, characterized in that, When the received signal strength indication value is lower than the preset low threshold, the flag for controlling the RF power amplifier to be turned on by the received signal strength indication monitoring is set to TRUE, and the RF power amplifier is enabled via the GPIO control pin, including: When the received signal strength indication value is lower than the preset low threshold, the flag for turning on the RF power amplifier by the received signal strength indication monitoring and control is set to TRUE, and a high-level signal is output to the GPIO control pin to perform level driving processing on the enable terminal of the RF power amplifier.

7. The radio frequency power amplifier control method according to claim 5, characterized in that, When the received signal strength indication value is higher than the preset high threshold, the flag for controlling the RF power amplifier to be turned on by the received signal strength indication monitoring is set to FALSE, and the RF power amplifier is enabled via the GPIO control pin, including: When the received signal strength indication value is higher than the preset high threshold, the flag for the RF power amplifier to be turned on by the received signal strength indication monitoring and control is set to FALSE, and a low-level signal is output to the GPIO control pin to perform level drive processing on the RF power amplifier enable terminal.

8. The radio frequency power amplifier control method according to claim 1, characterized in that, After performing level drive processing on the enable pin of the RF power amplifier, the following is also included: Send a delayed message to the monitoring task via a message queue to trigger the next monitoring cycle; When the A2DP media stream transmission state exits or the Bluetooth connection is disconnected, the pending delayed messages in the message queue are canceled, and the RF power amplifier is turned off through the GPIO control pin, resetting the RF power amplifier state variable to the off state.

9. The radio frequency power amplifier control method according to claim 8, characterized in that, When exiting the A2DP media stream transmission state or disconnecting the Bluetooth connection, the pending delayed messages in the message queue are canceled, and the RF power amplifier is turned off via the GPIO control pin, resetting the RF power amplifier state variable to the off state, including: In response to an A2DP media stream transmission status exit or Bluetooth connection disconnection event, perform full cancellation processing on all pending messages of type Received Signal Strength Indication Monitoring Task Trigger Message in the message queue, output a low-level signal to the RF power amplifier enable terminal through the GPIO control pin, set the Received Signal Strength Indication Monitoring activity flag and the RF power amplifier control flag to FALSE, and reset the RF power amplifier state variable to the off state.

10. A radio frequency power amplifier control system, characterized in that, The steps for implementing the radio frequency power amplifier control method according to any one of claims 1 to 9 include: The activation module is used to initialize the RF power amplifier state variables and GPIO control pins to the off state, respond to the start of A2DP media stream transmission state, and activate the monitoring task of received signal strength indication. The enable control module is used to obtain the received signal strength indication value of the monitoring task in the current period, and to perform enable control on the RF power amplifier according to the received signal strength indication value and the GPIO control pin.