CN112512133B - Reverse screen-projection audio control method and device and computer readable storage medium - Google Patents

Reverse screen-projection audio control method and device and computer readable storage medium Download PDF

Info

Publication number
CN112512133B
CN112512133B CN202011293118.XA CN202011293118A CN112512133B CN 112512133 B CN112512133 B CN 112512133B CN 202011293118 A CN202011293118 A CN 202011293118A CN 112512133 B CN112512133 B CN 112512133B
Authority
CN
China
Prior art keywords
state
audio
screen projection
switched
disconnection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011293118.XA
Other languages
Chinese (zh)
Other versions
CN112512133A (en
Inventor
廖松茂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN202011293118.XA priority Critical patent/CN112512133B/en
Publication of CN112512133A publication Critical patent/CN112512133A/en
Application granted granted Critical
Publication of CN112512133B publication Critical patent/CN112512133B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B3/00Line transmission systems
    • H04B3/02Details
    • H04B3/04Control of transmission; Equalising
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/19Connection re-establishment

Abstract

The invention discloses a reverse screen projection audio control method, a device and a computer readable storage medium, wherein the method comprises the following steps: waiting for the switching of the access state from the disconnection state to the connection state within preset waiting time; if the access state is still the disconnection state after the waiting time, restarting the management service of the audio equipment, and if the access state is switched from the disconnection state to the connection state within the waiting time, executing an audio data writing operation; and finally, after the management service is restarted, if the connection state is switched from the disconnection state to the connection state, executing the audio data writing operation. The humanized reverse screen projection audio control scheme is realized, the problem that audio cannot be normally played due to hot plugging of external audio equipment such as earphones is avoided, the fault tolerance of the screen projection function is further improved, and the screen projection use experience of a user is enhanced.

Description

Reverse screen-projection audio control method and device and computer readable storage medium
Technical Field
The present invention relates to the field of mobile communications, and in particular, to a method and apparatus for controlling a reverse screen-projection audio, and a computer-readable storage medium.
Background
In the prior art, along with the continuous development of intelligent terminal equipment, the demand of a user on screen projection application is higher and higher, wherein a reverse screen projection scheme based on the traditional screen projection technology is derived. In the reverse screen projection scheme, especially in the reverse transmission process of audio data, when an external audio device is pulled out and inserted, the audio data can not be processed normally. That is, in the process of reversely projecting the screen, if the earphone or the audio at the screen projecting end performs a hot plug, the screen projecting program cannot normally play the sound any more, and in the prior art, the interface and the callback notification of the earphone and the audio hot plug cannot be directly detected, so that the screen projecting program is always in a waiting state of a dead loop. Meanwhile, even after the external audio device is inserted again, due to the endless loop caused by the operation, the audio interface device is not reinitialized and the sound cannot be played. In order to solve the above technical problem, one solution in the prior art is to cancel the loop waiting for the audio interface to be idle or not, so as to write the audio PCM data, but in this case, the audio may be jammed and have a significant sense of breaking, the audio continuity requirement is high, once there is no data transfer for several milliseconds, the user can perceive the situation, and therefore, the solution of directly removing the loop waiting is not preferable. Therefore, in the prior art, a solution is needed to solve the problem that smooth sound playing and hot plug support can be achieved in the reverse screen projection process.
Disclosure of Invention
In order to solve the technical defects in the prior art, the invention provides a reverse screen-projection audio control method, which comprises the following steps:
monitoring the access state of a screen projection end and audio equipment when an audio interface of the screen projection end is in an idle state;
if the access state is switched from the connection state to the disconnection state, waiting for the switching of the access state from the disconnection state to the connection state within preset waiting time;
if the access state is still the disconnection state after the waiting time, restarting the management service of the audio equipment, and if the access state is switched from the disconnection state to the connection state within the waiting time, executing an audio data writing operation;
and after the management service is restarted, if the connection state is switched from the disconnection state to the connection state, executing the audio data writing operation.
Optionally, the monitoring an access state of the screen projection end and the audio device when the audio interface of the screen projection end is in an idle state includes:
determining a projected end connected with the screen projecting end;
and acquiring audio data sent to the screen projection end by the projected end through the audio interface.
Optionally, the monitoring, when the audio interface of the screen projection end is in an idle state, an access state of the screen projection end and the audio device, further includes:
detecting and identifying audio equipment connected with the screen projection end, wherein the audio equipment comprises an earphone and a loudspeaker;
and analyzing the audio data, and playing screen projection audio through the earphone or the loudspeaker.
Optionally, the monitoring, when the audio interface of the screen projection end is in an idle state, an access state of the screen projection end and the audio device, further includes:
monitoring the working state of the audio interface in real time;
and when the working state is an idle state, determining the access state of the screen projection end and the audio equipment according to the execution state of the audio data writing operation.
Optionally, if the access state is switched from the connection state to the disconnection state, waiting for the access state to be switched from the disconnection state to the connection state within a preset waiting time includes:
if the execution state is that the execution cannot be executed, determining that the access state is switched from the connection state to the disconnection state;
and if the execution state is normal execution, determining that the access state is switched from the disconnection state to the connection state.
Optionally, if the access state is switched from the connection state to the disconnection state, waiting for the access state to be switched from the disconnection state to the connection state within a preset waiting time further includes:
setting the waiting time according to the application environment of the reverse screen projection;
and if the access state is identified to be switched from the connection state to the disconnection state, detecting the switching state of the access state within preset waiting time.
Optionally, if the access state is still the disconnected state after the waiting time elapses, restarting a management service of the audio device, and if the access state is switched from the disconnected state to the connected state within the waiting time, executing an audio data writing operation, where the executing operation includes:
if the switching state is that the access state is still the disconnection state after the waiting time, restarting the management service of the audio equipment;
and if the switching state is that the access state is switched from the disconnection state to the connection state within the waiting time, determining that the audio equipment is recovered to be connected with the screen projection end, and continuously executing the audio data writing operation.
Optionally, after restarting the management service, if the connection state is switched from the disconnection state to the connection state, the audio data writing operation is executed, including:
after the management service is restarted, if the connection state is not switched to the connection state from the disconnection state after the new waiting time, restarting the management service again;
and circularly executing the management service restart and the detection operation of the connection state until the disconnection state is switched to the connection state, and re-executing the audio data writing operation.
The invention also provides a reverse screen projection audio control device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the computer program realizes the steps of the reverse screen projection audio control method according to any one of the above items when being executed by the processor.
The invention also provides a computer readable storage medium, which stores a reverse screen projection audio control program, and when the reverse screen projection audio control program is executed by a processor, the steps of the reverse screen projection audio control method are realized.
By implementing the reverse screen projection audio control method, the device and the computer readable storage medium, the access state of the screen projection end and the audio device is monitored by recognizing that the audio interface of the screen projection end is in an idle state; then, if the access state is switched from the connection state to the disconnection state, waiting for the switching of the access state from the disconnection state to the connection state within a preset waiting time; if the access state is still the disconnection state after the waiting time, restarting the management service of the audio equipment, and if the access state is switched from the disconnection state to the connection state within the waiting time, executing an audio data writing operation; and finally, after the management service is restarted, if the connection state is switched from the disconnection state to the connection state, executing the audio data writing operation. The humanized reverse screen projection audio control scheme is realized, the problem that audio cannot be normally played due to hot plugging of external audio equipment such as earphones is avoided, the fault tolerance of the screen projection function is further improved, and the screen projection use experience of a user is enhanced.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
fig. 1 is a schematic diagram of a hardware structure of a mobile terminal according to the present invention;
fig. 2 is a communication network system architecture diagram provided by an embodiment of the present invention;
FIG. 3 is a flow chart of a first embodiment of a reverse-projection audio control method of the present invention;
FIG. 4 is a flow chart of a second embodiment of a reverse-projection audio control method of the present invention;
FIG. 5 is a flowchart of a third embodiment of a reverse-projection audio control method of the present invention;
FIG. 6 is a flow chart of a fourth embodiment of a reverse-projection audio control method of the present invention;
FIG. 7 is a flow chart of a fifth embodiment of a reverse-projection audio control method of the present invention;
FIG. 8 is a flowchart of a sixth embodiment of a reverse-projection audio control method of the present invention;
FIG. 9 is a flowchart of a seventh embodiment of a reverse-projection audio control method of the present invention;
fig. 10 is a flowchart of an eighth embodiment of a reverse-projection audio control method according to the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000(Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex Long Term Evolution), and TDD-LTE (Time Division duplex Long Term Evolution).
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving gateway) 2034, a PGW (PDN gateway) 2035, and a PCRF (Policy and Charging Rules Function) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and communication network system, the present invention provides various embodiments of the method.
Example one
Fig. 3 is a flowchart of a first embodiment of a reverse-projection audio control method of the present invention. A method of reverse-projection audio control, the method comprising:
s1, monitoring the access state of the screen projection end and the audio equipment when the audio interface of the screen projection end is in an idle state;
s2, if the access state is switched from the connection state to the disconnection state, waiting for the switching of the access state from the disconnection state to the connection state within a preset waiting time;
s3, if the access state is still the disconnection state after the waiting time, restarting the management service of the audio device, and if the access state is switched from the disconnection state to the connection state within the waiting time, performing an audio data writing operation;
and S4, when the management service is restarted, if the connection state is switched from the disconnection state to the connection state, executing the audio data writing operation.
In this embodiment, first, when an audio interface of a screen projection end is in an idle state, monitoring an access state of the screen projection end and an audio device; then, if the access state is switched from the connection state to the disconnection state, waiting for the switching of the access state from the disconnection state to the connection state within a preset waiting time; if the access state is still the disconnection state after the waiting time, restarting the management service of the audio equipment, and if the access state is switched from the disconnection state to the connection state within the waiting time, executing an audio data writing operation; and finally, after the management service is restarted, if the connection state is switched from the disconnection state to the connection state, executing the audio data writing operation.
Optionally, in this embodiment, in view of an existing reverse screen projection application scenario, an external audio device at a screen projection end may enter a dead loop waiting state after being hot plugged and unplugged, because in the prior art, when an output io (input output) of an audio is initialized, that is, after an audio interface of this embodiment, PCM (pulse code modulation) data is sent to io (that is, audio data writing in this embodiment), there may be a state that io is busy, because the data in io has not been played yet, it is necessary to transplant a loop to wait whether io is idle or not at this time, and PCM data writing may be performed only when the io is idle, but once an earphone or a sound is unplugged, the io is idle and always becomes an error state, and because data cannot be written, the external device such as an earphone is unplugged, and data cannot be sent. At this time, the technical solution to be solved by this embodiment is to adopt a waiting timeout strategy, that is, the waiting time in the normal test situation may be 10ms at most, where the 10ms is enough to process the PCM data before the completion of the processing, but when the earphone is pulled out, it is in a permanent waiting period, and the time is unlimited. Therefore, for the above technical problem, the embodiment uses a timer for counting the time of the loop waiting, for example, the timer with a variable of timeCount is set, the timeout threshold of the waiting time is set to 5S, once the timeCount is greater than 5S, the waiting time at this time is exceeded, and the current io cannot write data, that is, the loop can jump out without waiting again.
Similarly, as described in the above example, after the loop is skipped, the related service is re-detected and opened, that is, the original initialization method is called to restart the start, after the start is restarted, if the earphone and the like become the plug-in state again, io is a successful state, if the earphone and the like are still not plugged in, PCM data insertion is not performed, the io is directly returned, the start is restarted continuously until the earphone is plugged in, the start can be directly successful, and the original audio playing is performed after the start is successful, so that the screen-casting application program can still normally play the audio even if the earphone is randomly hot plugged and unplugged.
The method has the advantages that the access state of the screen projection end and the audio equipment is monitored by recognizing that the audio interface of the screen projection end is in an idle state; then, if the access state is switched from the connection state to the disconnection state, waiting for the switching of the access state from the disconnection state to the connection state within a preset waiting time; if the access state is still the disconnection state after the waiting time, restarting the management service of the audio equipment, and if the access state is switched from the disconnection state to the connection state within the waiting time, executing an audio data writing operation; and finally, after the management service is restarted, if the connection state is switched from the disconnection state to the connection state, executing the audio data writing operation. The humanized reverse screen projection audio control scheme is realized, the problem that audio cannot be normally played due to hot plugging of external audio equipment such as earphones is avoided, the fault tolerance of the screen projection function is further improved, and the screen projection use experience of a user is enhanced.
Example two
Fig. 4 is a flowchart of a second embodiment of the reverse screen projection audio control method according to the present invention, where based on the above embodiments, the monitoring of the access state of the screen projection end and the audio device when the audio interface of the screen projection end is in an idle state includes:
s11, determining a projected end connected with the screen projecting end;
and S12, acquiring the audio data sent to the screen projection end by the projected end through the audio interface.
In this embodiment, first, a projected end connected to the screen projection end is determined; and then, acquiring audio data sent to the screen projection end by the projected end through the audio interface.
Optionally, in this embodiment, a projected end connected to the screen projecting end is determined, where the screen projecting end may be an operable device such as a computer, and the projected end may be a conventional mobile device such as a smart phone, so as to determine a reverse screen projecting application scenario of the screen projecting end and the projected end;
optionally, in this embodiment, the audio interface is used to acquire the audio data sent by the cast terminal to the screen casting terminal, where the audio interface may be the io port of the above embodiment, and the audio data may be the PCM data of the above embodiment.
The method has the advantages that the method comprises the steps that the thrown end connected with the screen throwing end is determined; and then, acquiring audio data sent to the screen projection end by the projected end through the audio interface. The method provides a state monitoring basis for realizing a humanized reverse screen projection audio control scheme, avoids the problem that audio cannot be normally played due to hot plugging of external audio equipment such as earphones and the like, further improves the fault-tolerant capability of a screen projection function, and enhances the screen projection use experience of a user.
EXAMPLE III
Fig. 5 is a flowchart of a third embodiment of the reverse screen projection audio control method according to the present invention, where based on the above embodiments, when an audio interface of a screen projection end is in an idle state, the method monitors an access state between the screen projection end and an audio device, and further includes:
s13, detecting and identifying the audio equipment connected with the screen projection end, wherein the audio equipment comprises earphones and a loudspeaker;
and S14, analyzing the audio data, and playing screen projection audio through the earphone or the loudspeaker.
In this embodiment, first, an audio device connected to the screen projection terminal is detected and identified, where the audio device includes an earphone and a speaker; then, the audio data is analyzed, and screen projection audio is played through the earphone or the loudspeaker.
Optionally, in this embodiment, an audio device connected to the screen projection terminal is detected and identified, where the audio device includes an earphone and a speaker, where the earphone or the speaker includes an earphone or a speaker connected by a wire and an earphone or a speaker connected wirelessly by bluetooth or the like;
optionally, in this embodiment, when the earphone or the speaker is a wired earphone or speaker, the plug is a plug of a physical audio plug;
optionally, in this embodiment, when the earphone or the speaker is an earphone or a speaker wirelessly connected via bluetooth or the like, the earphone or the speaker is plugged to disconnect and connect the bluetooth connection.
The method has the advantages that the audio equipment connected with the screen projection end is detected and identified, wherein the audio equipment comprises an earphone and a loudspeaker; then, the audio data is analyzed, and screen projection audio is played through the earphone or the loudspeaker. The method provides a state monitoring and judging basis for realizing a humanized reverse screen projection audio control scheme, avoids the problem that audio cannot be normally played due to hot plugging of external audio equipment such as earphones and the like, further improves the fault-tolerant capability of a screen projection function, and enhances the screen projection use experience of a user.
Example four
Fig. 6 is a flowchart of a fourth embodiment of the reverse screen projection audio control method according to the present invention, where based on the above embodiments, when an audio interface of a screen projection end is in an idle state, the monitoring of an access state between the screen projection end and an audio device further includes:
s15, monitoring the working state of the audio interface in real time;
and S16, when the working state is an idle state, determining the access state of the screen projection end and the audio equipment according to the execution state of the audio data writing operation.
In this embodiment, first, the working state of the audio interface is monitored in real time; and then, when the working state is an idle state, determining the access state of the screen projection end and the audio equipment according to the execution state of the audio data writing operation.
Optionally, in this embodiment, the working state of the audio interface is monitored in real time, where the working state includes an idle state and a non-idle state;
optionally, in this embodiment, when the working state is an idle state, the access state of the screen projection end and the audio device is determined according to the execution state of the audio data writing operation, wherein when the audio data writing operation is normally executed, the access state of the screen projection end and the audio device is determined to be a connection state, and otherwise, the access state is determined to be a disconnection state.
The embodiment has the advantages that the working state of the audio interface is monitored in real time; and then, when the working state is an idle state, determining the access state of the screen projection end and the audio equipment according to the execution state of the audio data writing operation. The method provides a state monitoring and judging condition for realizing a humanized reverse screen projection audio control scheme, avoids the problem that audio cannot be normally played due to hot plugging of external audio equipment such as earphones and the like, further improves the fault-tolerant capability of a screen projection function, and enhances the screen projection use experience of a user.
EXAMPLE five
Fig. 7 is a flowchart of a fifth embodiment of a reverse screen projection audio control method according to the present invention, where based on the above embodiments, if the access state is switched from the connection state to the disconnection state, waiting for the access state to be switched from the disconnection state to the connection state within a preset waiting time includes:
s21, if the execution state is that the execution cannot be executed, determining that the access state is switched from the connection state to the disconnection state;
and S22, if the execution state is normal execution, determining that the access state is switched from the disconnection state to the connection state.
In this embodiment, first, if the execution state is that the execution cannot be executed, it is determined that the access state is switched from the connection state to the disconnection state; and then, if the execution state is normal execution, determining that the access state is switched from the disconnection state to the connection state.
Optionally, in this embodiment, as described in the above example, PCM data writing may be performed only when the audio interface is idle, but once the earphone or the sound is pulled out, the idle audio interface is always in an error state, and data cannot be sent because data cannot be written and the external device such as the earphone is pulled out, and at this time, the change state of the access state is determined by the data writing state. That is, if the execution state is that the execution cannot be executed, it is determined that the access state is switched from the connection state to the disconnection state; and then, if the execution state is normal execution, determining that the access state is switched from the disconnection state to the connection state.
The method has the advantages that the access state is determined to be switched from the connection state to the disconnection state by recognizing that the execution state is unexecutable; and then, if the execution state is normal execution, determining that the access state is switched from the disconnection state to the connection state. The method provides a judgment condition of the connection state for realizing a humanized reverse screen projection audio control scheme, avoids the problem that the audio cannot be normally played due to hot plugging of external audio equipment such as earphones and the like, further improves the fault-tolerant capability of the screen projection function, and enhances the screen projection use experience of a user.
EXAMPLE six
Fig. 8 is a flowchart of a sixth embodiment of the reverse screen projection audio control method according to the present invention, where based on the above embodiments, if the access state is switched from the connection state to the disconnection state, the method waits for the access state to be switched from the disconnection state to the connection state within a preset waiting time, and further includes:
s23, setting the waiting time according to the application environment of the reverse screen projection;
and S24, if the access state is identified to be switched from the connection state to the disconnection state, detecting the switching state of the access state within a preset waiting time.
In the embodiment, first, the waiting time is set according to the application environment of the reverse screen projection; and then, if the access state is identified to be switched from the connection state to the disconnection state, detecting the switching state of the access state within preset waiting time.
Optionally, in this embodiment, the waiting time is set according to an application environment of the reverse screen projection, for example, the corresponding waiting time is determined according to a possible re-access time of the user;
optionally, in this embodiment, an average value of the unplugging/unplugging interval times of the user in the historical time is used as the waiting time;
optionally, in this embodiment, the corresponding waiting time is determined according to different screen-projected contents of the reverse screen projection, for example, when the screen-projected contents are paused, a shorter waiting time is determined to avoid a long waiting time, and when the screen-projected contents continue to be played, a longer waiting time is determined.
The method has the advantages that the waiting time is set through the application environment of the reverse screen projection; and then, if the access state is identified to be switched from the connection state to the disconnection state, detecting the switching state of the access state within preset waiting time. The method provides a recognition scheme of switching states for realizing a humanized reverse screen projection audio control scheme, avoids the problem that audio cannot be played normally due to hot plugging of external audio equipment such as earphones and the like, further improves the fault-tolerant capability of a screen projection function, and enhances the screen projection use experience of a user.
EXAMPLE seven
Fig. 9 is a flowchart of a seventh embodiment of the reverse screen projection audio control method according to the present invention, where based on the above embodiments, if the access state is still the disconnected state after the waiting time elapses, the management service of the audio device is restarted, and if the access state is switched from the disconnected state to the connected state within the waiting time, an audio data write operation is performed, including:
s31, if the switching state is that the access state is still the disconnection state after the waiting time, restarting the management service of the audio equipment;
and S32, if the switching state is that the access state is switched from the disconnection state to the connection state within the waiting time, determining that the audio equipment is restored to be connected with the screen projection end, and continuously executing the audio data writing operation.
In this embodiment, first, if the switching state is that the access state is still the disconnection state after the waiting time, the management service of the audio device is restarted; and then, if the switching state is that the access state is switched from the disconnection state to the connection state within the waiting time, determining that the audio equipment is recovered to be connected with the screen projection end, and continuously executing the audio data writing operation.
Optionally, in this embodiment, after the loop is skipped, the related service is re-detected and opened, that is, the original initialization method is called to restart the start, that is, restart the management service of the audio device, after the start restart, if the earphone and the like become the plugged-in state again, io is a successful state, if the earphone is still not plugged in, PCM data insertion is not performed, the PCM data is directly returned, the start restart is continued until the earphone is plugged in, the start can be directly succeeded, and the original audio playing is performed after the start succeeds, so that the screen-casting application program can still normally play the audio even if the earphone is randomly hot plugged.
The method has the advantages that the management service of the audio equipment is restarted by recognizing that the access state is still the disconnection state after the waiting time if the switching state is the disconnection state; and then, if the switching state is that the access state is switched from the disconnection state to the connection state within the waiting time, determining that the audio equipment is recovered to be connected with the screen projection end, and continuously executing the audio data writing operation. The method provides the executing condition of the audio data writing operation for realizing a humanized reverse screen projection audio control scheme, avoids the problem that the audio cannot be normally played due to hot plugging of external audio equipment such as earphones and the like, further improves the fault-tolerant capability of the screen projection function, and enhances the screen projection use experience of a user.
Example eight
Fig. 10 is a flowchart of an eighth embodiment of a reverse screen projection audio control method according to the present invention, where based on the above embodiments, after the management service is restarted, if the connection state is switched from the disconnection state to the connection state, the audio data writing operation is executed, including:
s41, after restarting the management service, if the connection status is not switched from the disconnection status to the connection status after the new waiting time, restarting the management service again;
and S42, circularly executing the management service restart and the detection operation of the connection state, and executing the audio data writing operation again until the disconnection state is switched to the connection state.
In this embodiment, first, after restarting the management service, if the connection state is not yet switched from the disconnection state to the connection state after the new waiting time, restarting the management service again; and then, circularly executing the management service restart and the detection operation of the connection state until the disconnection state is switched to the connection state, and then re-executing the audio data writing operation.
Optionally, in this embodiment, in the process of cyclically executing the management service restart and the detection operation of the connection state, the waiting time of each time remains unchanged;
optionally, in this embodiment, in the process of executing the management service restart and the detection operation of the connection state in a loop, the waiting duration of the waiting time is gradually increased.
The method has the advantages that after the management service is restarted, if the connection state is not switched from the disconnection state to the connection state after the new waiting time, the management service is restarted again; and then, circularly executing the management service restart and the detection operation of the connection state until the disconnection state is switched to the connection state, and then re-executing the audio data writing operation. The method provides the executing condition of the audio data writing operation for realizing a humanized reverse screen projection audio control scheme, avoids the problem that the audio cannot be normally played due to hot plugging of external audio equipment such as earphones and the like, further improves the fault-tolerant capability of the screen projection function, and enhances the screen projection use experience of a user.
Example nine
Based on the above embodiment, the present invention further provides a reverse-projection audio control device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the reverse-projection audio control method according to any one of the above embodiments.
It should be noted that the device embodiment and the method embodiment belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment, and technical features in the method embodiment are correspondingly applicable in the device embodiment, which is not described herein again.
Example ten
Based on the above embodiment, the present invention further provides a computer-readable storage medium, in which a reverse-projection audio control program is stored, and when being executed by a processor, the reverse-projection audio control program implements the steps of the reverse-projection audio control method according to any one of the above embodiments.
It should be noted that the media embodiment and the method embodiment belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment, and technical features in the method embodiment are correspondingly applicable in the media embodiment, which is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A method for reverse-projection audio control, the method comprising:
monitoring the access state of a screen projection end and audio equipment when an audio interface of the screen projection end is in an idle state;
if the access state is switched from the connection state to the disconnection state, waiting for the switching of the access state from the disconnection state to the connection state within preset waiting time;
if the access state is still the disconnection state after the waiting time, restarting the management service of the audio equipment, and if the access state is switched from the disconnection state to the connection state within the waiting time, executing an audio data writing operation;
and after the management service is restarted, if the connection state is switched from the disconnection state to the connection state, executing the audio data writing operation.
2. The method for controlling audio by reverse screen projection according to claim 1, wherein the monitoring of the access state of the screen projection terminal and the audio device when the audio interface of the screen projection terminal is in an idle state comprises:
determining a projected end connected with the screen projecting end;
and acquiring audio data sent to the screen projection end by the projected end through the audio interface.
3. The method for controlling audio by reverse screen projection according to claim 2, wherein the monitoring of the access state between the screen projection terminal and the audio device when the audio interface of the screen projection terminal is in an idle state further comprises:
detecting and identifying audio equipment connected with the screen projection end, wherein the audio equipment comprises an earphone and a loudspeaker;
and analyzing the audio data, and playing screen projection audio through the earphone or the loudspeaker.
4. The method for controlling audio by reverse screen projection according to claim 3, wherein the monitoring of the access state between the screen projection terminal and the audio device when the audio interface of the screen projection terminal is in an idle state further comprises:
monitoring the working state of the audio interface in real time;
and when the working state is an idle state, determining the access state of the screen projection end and the audio equipment according to the execution state of the audio data writing operation.
5. The audio control method for reverse screen projection according to claim 4, wherein if the connection status is switched from the connection status to the disconnection status, waiting for the connection status to be switched from the disconnection status to the connection status within a preset waiting time includes:
if the execution state is that the execution cannot be executed, determining that the access state is switched from the connection state to the disconnection state;
and if the execution state is normal execution, determining that the access state is switched from the disconnection state to the connection state.
6. The audio control method for reverse screen projection according to claim 5, wherein if the connection status is switched from the connection status to the disconnection status, the method waits for the connection status to be switched from the disconnection status to the connection status within a preset waiting time, further comprising:
setting the waiting time according to the application environment of the reverse screen projection;
and if the access state is identified to be switched from the connection state to the disconnection state, detecting the switching state of the access state within preset waiting time.
7. The method for controlling audio by reverse screen projection according to claim 6, wherein the restarting the management service of the audio device if the access state is still the disconnected state after the waiting time, and performing an audio data writing operation if the access state is switched from the disconnected state to the connected state within the waiting time includes:
if the switching state is that the access state is still the disconnection state after the waiting time, restarting the management service of the audio equipment;
and if the switching state is that the access state is switched from the disconnection state to the connection state within the waiting time, determining that the audio equipment is recovered to be connected with the screen projection end, and continuously executing the audio data writing operation.
8. The method for controlling audio frequency of a reverse screen projection according to claim 7, wherein after the management service is restarted, if the connection status is switched from the disconnection status to the connection status, the audio data writing operation is executed, and the method includes:
after the management service is restarted, if the connection state is not switched to the connection state from the disconnection state after the new waiting time, restarting the management service again;
and circularly executing the management service restart and the detection operation of the connection state until the disconnection state is switched to the connection state, and re-executing the audio data writing operation.
9. A reverse-projection audio control apparatus, characterized in that the apparatus comprises a memory, a processor and a computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, implements the steps of the reverse-projection audio control method according to any one of claims 1 to 8.
10. A computer-readable storage medium, having stored thereon a reverse-projection audio control program which, when executed by a processor, implements the steps of the reverse-projection audio control method of any one of claims 1 to 8.
CN202011293118.XA 2020-11-18 2020-11-18 Reverse screen-projection audio control method and device and computer readable storage medium Active CN112512133B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011293118.XA CN112512133B (en) 2020-11-18 2020-11-18 Reverse screen-projection audio control method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011293118.XA CN112512133B (en) 2020-11-18 2020-11-18 Reverse screen-projection audio control method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112512133A CN112512133A (en) 2021-03-16
CN112512133B true CN112512133B (en) 2022-04-19

Family

ID=74956793

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011293118.XA Active CN112512133B (en) 2020-11-18 2020-11-18 Reverse screen-projection audio control method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112512133B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113179307B (en) * 2021-04-23 2023-10-20 努比亚技术有限公司 Audio delay control method, equipment and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106792055A (en) * 2016-12-28 2017-05-31 福建星网视易信息系统有限公司 Screen method, equipment and system are thrown in real time
CN107479909A (en) * 2017-06-26 2017-12-15 珠海格力电器股份有限公司 A kind of method, apparatus and intelligent terminal for closing multimedia application
WO2018014471A1 (en) * 2016-07-20 2018-01-25 中兴通讯股份有限公司 Terminal, terminal peripheral, signal sending and receiving method, and data transmission system
CN109032555A (en) * 2018-07-06 2018-12-18 广州视源电子科技股份有限公司 Throw screen sound intermediate frequency data processing method, device, storage medium and electronic equipment
CN111447487A (en) * 2020-04-02 2020-07-24 深圳创维-Rgb电子有限公司 Reverse screen projection method and system for smart screen, smart screen and readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246417B (en) * 2007-02-13 2010-09-29 艾威梯科技(北京)有限公司 Method and system for non-intermittence software switch of audio data flow input/output
US9806795B2 (en) * 2013-08-05 2017-10-31 Microsoft Technology Licensing, Llc Automated earpiece cache management

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018014471A1 (en) * 2016-07-20 2018-01-25 中兴通讯股份有限公司 Terminal, terminal peripheral, signal sending and receiving method, and data transmission system
CN106792055A (en) * 2016-12-28 2017-05-31 福建星网视易信息系统有限公司 Screen method, equipment and system are thrown in real time
CN107479909A (en) * 2017-06-26 2017-12-15 珠海格力电器股份有限公司 A kind of method, apparatus and intelligent terminal for closing multimedia application
CN109032555A (en) * 2018-07-06 2018-12-18 广州视源电子科技股份有限公司 Throw screen sound intermediate frequency data processing method, device, storage medium and electronic equipment
CN111447487A (en) * 2020-04-02 2020-07-24 深圳创维-Rgb电子有限公司 Reverse screen projection method and system for smart screen, smart screen and readable storage medium

Also Published As

Publication number Publication date
CN112512133A (en) 2021-03-16

Similar Documents

Publication Publication Date Title
CN108683806B (en) Anti-disturbing method, mobile terminal and computer readable storage medium
CN112346685B (en) Screen-off and screen-projection control method and device and computer readable storage medium
CN112799577B (en) Method, terminal and storage medium for projecting small window
CN109088997B (en) Game audio control method, terminal and computer readable storage medium
CN112394896A (en) Method and device for controlling reverse screen projection frame rate and computer readable storage medium
CN108536383B (en) Game control method, game control equipment and computer readable storage medium
CN113438747A (en) Processing method, processing apparatus, and storage medium
CN109889651B (en) Notification message processing method, terminal and computer readable storage medium
CN112102780B (en) Display frame rate regulation and control method, device and computer readable storage medium
CN110677897A (en) Network search control method, terminal and computer readable storage medium
CN112512133B (en) Reverse screen-projection audio control method and device and computer readable storage medium
CN112689191A (en) Screen projection control method, terminal and computer readable storage medium
CN112423211A (en) Multi-audio transmission control method, equipment and computer readable storage medium
CN112395106A (en) Process management method, mobile terminal, and computer-readable storage medium
CN111970738A (en) Network switching control method, equipment and computer readable storage medium
CN109151201B (en) Anti-addiction method, mobile terminal and computer storage medium
CN112346824A (en) Screen projection application control method and device and computer readable storage medium
CN108897451B (en) Main and auxiliary display screen identification method, mobile terminal and computer readable storage medium
CN107580106B (en) Call control method, mobile terminal and computer readable storage medium
CN112333326B (en) Screen projection display control method and device and computer readable storage medium
CN114307136A (en) Game screen-throwing power consumption control method and device and computer readable storage medium
CN113485667A (en) Method for screen projection display of terminal, terminal and storage medium
CN112887776A (en) Method and equipment for reducing audio delay and computer-readable storage medium
CN109286907B (en) Incoming call processing method, terminal, server and computer readable storage medium
CN113163477A (en) Price tag dormancy control method and equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant