A method and apparatus for audio synchronous playing
By combining the Audio Hardware Abstraction Layer (Audiohal) with the Bluetooth protocol stack, the problem of inconsistent audio playback across multiple devices is solved, enabling synchronized playback between devices and improving the user experience.
Patent Information
- Application Number
- CN202211421654.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-14
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2042-11-14
AI Technical Summary
When using multiple audio playback devices in large events, inconsistent audio playback can occur due to asynchronous latency and mutual interference between the devices, affecting the user experience.
Audio data is sent to the first audio playback device via the Audio Hardware Abstraction Layer (Audiohal) using the Bluetooth protocol stack, and then sent to the second device upon successful transmission, ensuring synchronized playback across the devices.
It reduces Bluetooth transmission latency, enabling multiple devices to play audio simultaneously and improving the user experience.
Smart Images

Figure CN115835095B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of audio communication technology, in particular to a method and device for audio synchronous playing. BACKGROUND
[0002] Currently, multiple audio playing devices (such as sound boxes) are needed to be used simultaneously in some large activities. Since the activity site is large, if a second audio playing device is used, a long audio connection line needs to be used, which is inconvenient to carry and assemble, and the use feeling is not good. In order to make the user have a better experience, the second audio playing device and the first audio playing device are usually used simultaneously.
[0003] Since the delay time of each device playing audio is different, and the delay time is easily accumulated by mutual interference between multiple devices, the multiple devices are not synchronized when playing audio and when being distorted, the audio playing effect is poor, and the user experience is affected. SUMMARY
[0004] In order to overcome the defects of the prior art, the present application provides a method and device for audio synchronous playing.
[0005] The specific technical solutions are as follows:
[0006] A method for audio synchronous playing applied to a system composed of a first audio playing device and a second audio playing device, characterized in that it comprises the following steps:
[0007] An audio hardware abstraction layer (Audio hal) sends audio data to the first audio playing device through a Bluetooth protocol stack;
[0008] The first audio playing device reports a sending state to the Audio hal;
[0009] If the sending state is successful, the Audio hal sends the audio data to the second audio playing device;
[0010] The first audio playing device and the second audio playing device play synchronously.
[0011] In one specific embodiment, the audio hardware abstraction layer (Audio hal) sends audio data to the first audio playing device through a Bluetooth protocol stack, comprising the following steps:
[0012] The Audio hal sends the audio data to the Bluetooth protocol stack;
[0013] The Bluetooth protocol stack receives the audio data and packs it into an audio data packet;
[0014] The Bluetooth protocol stack stores the audio data packet into a buffer queue.
[0015] The buffer queue sends the audio data packet to the first audio playing device.
[0016] In one embodiment, the audio hardware abstraction layer (Audio hal) sends the audio data to the first audio playing device through the Bluetooth protocol stack, which includes the following steps:
[0017] Turning on the first audio playing device and the second audio playing device, and establishing the communication connection between the Audio hal and the first audio playing device and between the Audio hal and the second audio playing device.
[0018] In one embodiment, the first audio playing device is provided with a Bluetooth unit, and the Audio hal is connected with the first audio playing device through Bluetooth.
[0019] The second audio playing device is provided with an audio AUX input unit or an audio USB Audio input unit, and the Audio hal is connected with the second audio playing device through an HDMI line.
[0020] In one embodiment, the number of the first audio playing device is one or more, and the number of the second audio playing device is one or more.
[0021] In one embodiment, if the sending state is failure, the Audio hal discards the audio data.
[0022] An apparatus for audio synchronous playing, applied to a system composed of a first audio playing device and a second audio playing device, comprising:
[0023] A first transmission module for making an audio hardware abstraction layer (Audio hal) send audio data to the first audio playing device through a Bluetooth protocol stack;
[0024] A feedback module for making the first audio playing device report a sending state to the Audio hal;
[0025] A second transmission module for making the Audio hal send the audio data to the second audio playing device;
[0026] A synchronous playing module for making the first audio playing device and the second audio playing device play synchronously.
[0027] In one embodiment, the first transmission module includes:
[0028] The first sending module is configured to send the audio data to the Bluetooth protocol stack by the Audio hal;
[0029] The receiving and packaging module is configured to receive the audio data and package the audio data into an audio data packet by the Bluetooth protocol stack;
[0030] The storage module is configured to store the audio data packet into a buffer queue by the Bluetooth protocol stack;
[0031] The second sending module is configured to send the audio data packet to the first audio playing device by the buffer queue.
[0032] In one specific embodiment, the method further comprises an initialization module configured to start the first audio playing device and the second audio playing device, and establish a communication connection between the Audio hal and the first audio playing device and between the Audio hal and the second audio playing device.
[0033] In one specific embodiment, the first transmission module is a Bluetooth module, and the second transmission module is an HDMI line.
[0034] The present application has at least the following beneficial effects:
[0035] The present application provides a method and device for audio synchronous playing, which are applied to a system composed of a first audio playing device and a second audio playing device. The method for audio synchronous playing comprises the following steps: sending audio data to the first audio playing device by an audio hardware abstraction layer (Audio hal) through a Bluetooth protocol stack; reporting a sending state to the Audio hal by the first audio playing device; sending the audio data to the second audio playing device by the Audio hal if the sending state is successful; and playing the audio synchronously by the first audio playing device and the second audio playing device. The present application reduces the delay time when the Bluetooth transmits the audio data, makes multiple devices play the audio synchronously, has a good playing effect, and improves the user experience.
[0036] Further, the present application also provides an audio synchronous playing device applied to a system composed of a first audio playing device and a second audio playing device, comprising: a first transmission module configured to make an audio hardware abstraction layer (Audiohal) send audio data to the first audio playing device through a Bluetooth protocol stack; a feedback module configured to make the first audio playing device report a sending state to the Audiohal; a second transmission module configured to make the Audiohal send audio data to the second audio playing device; and a synchronous playing module configured to make the first audio playing device and the second audio playing device play synchronously. The delay time during Bluetooth transmission of audio data is reduced, the multiple devices play audio synchronously, the playing effect is good, and the user experience is improved. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.
[0038] Figure 1 The first flowchart of the audio synchronous playing method provided for the embodiment 1;
[0039] Figure 2 The second flowchart of the audio synchronous playing method provided for the embodiment 1;
[0040] Figure 3 The third flowchart of the audio synchronous playing method provided for the embodiment 1;
[0041] Figure 4 The third flowchart of the audio synchronous playing method provided for the embodiment 1;
[0042] Figure 5 The first structural schematic diagram of the audio synchronous playing device provided for the embodiment 2;
[0043] Figure 6 The second structural schematic diagram of the audio synchronous playing device provided for the embodiment 2;
[0044] Figure 7 The third structural schematic diagram of the audio synchronous playing device provided for the embodiment 2.
[0045] REFERENCE SIGNS:
[0046] 1-first transmission module; 2-feedback module; 3-second transmission module; 4-synchronous playing module; 5-initialization module; 11-first sending module; 12-receiving packaging module; 13-storage module; 14-second sending module. DETAILED DESCRIPTION
[0047] Hereinafter, various embodiments of the present application will be described more fully. The present application may, however, be embodied in many different forms and should not be construed as limited to the specific embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and fully convey the scope of the application to those skilled in the art.
[0048] Hereinafter, the term "include" or "may include" used in various embodiments of the present application indicates the presence of disclosed functions, operations, or elements and does not limit addition of one or more functions, operations, or elements. Also, as used in various embodiments of the present application, the term "include" or "have" and their conjugates are merely intended to denote a specific characteristic, number, step, operation, element, component or a combination thereof, and are not intended to exclude the existence or possibility of addition of one or more other characteristics, numbers, steps, operations, elements, components or combinations thereof.
[0049] In various embodiments of the present application, the expression "or" or "at least one of A or / and B" includes any and all combinations of the listed terms. For example, the expression "A or B" or "at least one of A or / and B" can include A, can include B, or can include both A and B.
[0050] The expression (such as "first", "second", and the like) used in various embodiments of the present application can modify various constituent elements in various embodiments, but can not limit the corresponding constituent elements. For example, the above expressions do not limit the order and / or importance of the described elements. The above expressions are used only for the purpose of distinguishing a certain element from other elements. For example, a first user device and a second user device indicate different user devices, although both are user devices. For example, a first element can be referred to as a second element, and likewise, a second element can be referred to as a first element, without departing from the scope of various embodiments of the present application.
[0051] The terminology used in the description of the various embodiments herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the various embodiments of the present application. As used in this description, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments belong. The terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
[0052] The present application provides a method and device for audio synchronous playback, applied to a system composed of a first audio playback device and a second audio playback device. The method for audio synchronous playback comprises the following steps: an audio hardware abstraction layer (Audio hal) sends audio data to the first audio playback device through a Bluetooth protocol stack; the first audio playback device reports a sending state to the Audio hal; if the sending state is successful, the Audio hal sends the audio data to the second audio playback device; and the first audio playback device and the second audio playback device play the audio synchronously.
[0053] In the prior art, multiple devices have a delay time when playing audio, and the delay times are different from each other. Sometimes, the delay time is accumulated due to mutual interference between the multiple devices, resulting in that the multiple devices are not synchronized when playing audio and when being distorted, and the audio playback effect is poor, which affects the user experience.
[0054] The present application adjusts the order of outputting audio data by multiple audio playback devices, reduces the delay time of Bluetooth data transmission, and enables the multiple audio playback devices to play audio synchronously, thereby improving the user experience.
[0055] Embodiment 1
[0056] As shown in Figure 1 A method for audio synchronous playback, applied to a system composed of a first audio playback device and a second audio playback device, comprises the following steps:
[0057] An audio hardware abstraction layer (Audio hal) sends audio data to the first audio playback device through a Bluetooth protocol stack;
[0058] The first audio playback device reports a sending state to the Audio hal;
[0059] If the sending state is successful, the Audio hal sends the audio data to the second audio playback device;
[0060] The first audio playing device and the second audio playing device play synchronously.
[0061] The application adjusts the order of the audio data output by the multiple audio playing devices, reduces the delay time of the Bluetooth transmission data, makes the multiple audio playing devices play audio synchronously, has good playing effect, and improves the user experience.
[0062] As shown in Figure 2 , the audio hardware abstraction layer Audio hal sends audio data to the first audio playing device through the Bluetooth protocol stack, including:
[0063] The Audio hal sends the audio data to the Bluetooth protocol stack;
[0064] The Bluetooth protocol stack receives the audio data and packs it into an audio data packet;
[0065] The Bluetooth protocol stack stores the audio data packet in a buffer queue;
[0066] The buffer queue sends the audio data packet to the first audio playing device.
[0067] As shown in Figure 3 , the audio hardware abstraction layer Audio hal sends audio data to the first audio playing device through the Bluetooth protocol stack, including:
[0068] The first audio playing device and the second audio playing device are started, and the communication connection between the Audio hal and the first audio playing device and the communication connection between the Audio hal and the second audio playing device are established. When the Audio hal sends audio data, the first audio playing device and the second audio playing device can receive in time, avoiding the out-of-sync of the devices playing audio and the distortion of the devices playing audio due to the failure of the first audio playing device or the second audio playing device.
[0069] Specifically, the first audio playing device is provided with a Bluetooth unit, and the Audio hal is connected with the first audio playing device through Bluetooth; the second audio playing device is provided with an audio AUX input unit or an audio USB Audio input unit, and the Audio hal is connected with the second audio playing device through an HDMI line.
[0070] As shown in Figure 4 , if the sending state is failure, the Audio hal discards the audio data. That is, the first audio playing device and the second audio playing device will produce synchronous lag, ensuring the high consistency of the audio output of the two devices and ensuring the consistency of the subsequent audio output.
[0071] As shown in Figure 1 , Figure 2、 Figure 3 and Figure 4 As shown in the method for synchronously playing audio provided by the application, the number of the first audio playing devices is one or more, each first audio playing device is connected with the Audiohal through Bluetooth, the number of the second audio playing devices is one or more, and each second audio playing device is connected with the second audio playing device through an HDMI line. The method can support the synchronous playing of a plurality of audio playing devices, and can ensure that the plurality of audio playing devices do not interfere with each other, and the audio playing effect is good.
[0072] Embodiment 2
[0073] As shown in the method for synchronously playing audio provided by the application, the number of the first audio playing devices is one or more, each first audio playing device is connected with the Audiohal through Bluetooth, the number of the second audio playing devices is one or more, and each second audio playing device is connected with the second audio playing device through an HDMI line. The method can support the synchronous playing of a plurality of audio playing devices, and can ensure that the plurality of audio playing devices do not interfere with each other, and the audio playing effect is good. Figure 5 As shown in the method for synchronously playing audio provided by the application, the number of the first audio playing devices is one or more, each first audio playing device is connected with the Audiohal through Bluetooth, the number of the second audio playing devices is one or more, and each second audio playing device is connected with the second audio playing device through an HDMI line. The method can support the synchronous playing of a plurality of audio playing devices, and can ensure that the plurality of audio playing devices do not interfere with each other, and the audio playing effect is good.
[0074] The first transmission module 1 is used for enabling the audio hardware abstraction layer Audiohal to send audio data to the first audio playing device through the Bluetooth protocol stack.
[0075] The feedback module 2 is used for enabling the first audio playing device to report the sending state to the Audiohal.
[0076] The second transmission module 3 is used for enabling the Audiohal to send audio data to the second audio playing device.
[0077] The synchronous playing module 4 is used for enabling the first audio playing device and the second audio playing device to synchronously play.
[0078] In the prior art, when a plurality of devices play audio, there is a delay time, and the delay times of the devices are different. Sometimes, the delay times of the devices accumulate due to mutual interference, resulting in that the plurality of devices do not play audio synchronously when playing audio and when being distorted, and the audio playing effect is poor, which affects the user experience.
[0079] The application adjusts the order of outputting audio data to a plurality of audio playing devices through the cooperation of the first transmission module 1, the feedback module 2, the second transmission module 3 and the synchronous playing module 4, reduces the delay time of Bluetooth transmission data, enables the plurality of audio playing devices to synchronously play audio, the playing effect is good, and the user experience is improved.
[0080] Specifically, the first transmission module 1 is a Bluetooth module, and the second transmission module 3 is an HDMI line.
[0081] As shown in the method for synchronously playing audio provided by the application, the number of the first audio playing devices is one or more, each first audio playing device is connected with the Audiohal through Bluetooth, the number of the second audio playing devices is one or more, and each second audio playing device is connected with the second audio playing device through an HDMI line. The method can support the synchronous playing of a plurality of audio playing devices, and can ensure that the plurality of audio playing devices do not interfere with each other, and the audio playing effect is good. Figure 6 The first transmission module 1 comprises:
[0082] The first sending module 11 is used for enabling the Audiohal to send audio data to the Bluetooth protocol stack.
[0083] The receiving packaging module 12 is configured to enable the Bluetooth protocol stack to receive the audio data and package the audio data into audio data packets;
[0084] The storage module 13 is configured to enable the Bluetooth protocol stack to store the audio data packets into a buffer queue;
[0085] The second sending module 14 is configured to enable the buffer queue to send the audio data packets to the first audio playing device.
[0086] As shown in Figure 7 The initialization module 5 is further configured to enable the first audio playing device and the second audio playing device to be started and the communication connection between the Audiohal and the first audio playing device and between the Audiohal and the second audio playing device to be established. In this way, when the Audiohal sends the audio data, the first audio playing device and the second audio playing device can receive the audio data in time, and the first audio playing device and the second audio playing device can be synchronized when playing the audio and when being distorted.
[0087] Those skilled in the art should understand that the modules or steps of the present application described above can be realized by general computing devices, which can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Alternatively, the modules or steps can be realized by program codes executable by the computing devices, which can be stored in a storage device and executed by the computing devices, or which can be respectively manufactured into individual integrated circuit modules, or which can be manufactured into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
[0088] Note that the above only describes the preferred embodiments of the present application and the technical principles applied. Those skilled in the art should understand that the present application is not limited to the specific embodiments described herein, and various obvious changes, re-adjustments and replacements can be made by those skilled in the art without departing from the protection scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and more other equivalent embodiments can be included without departing from the concept of the present application, and the scope of the present application is determined by the appended claims.
[0089] The above only describes the preferred embodiments of the present application and does not limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for audio synchronous playing, applied to a system composed of a first audio playing device and a second audio playing device, characterized in that, The application relates to a method for transmitting audio data to a first audio playing device and a second audio playing device through an audio hardware abstraction layer (Audio hal) and a Bluetooth protocol stack. The Audio hal sends the audio data to the first audio playing device through the Bluetooth protocol stack, including that the Audio hal sends the audio data to the Bluetooth protocol stack; the Bluetooth protocol stack receives the audio data and packs the audio data into an audio data packet; the Bluetooth protocol stack stores the audio data packet into a buffer queue; and the buffer queue sends the audio data packet to the first audio playing device. The first audio playing device is provided with a Bluetooth unit, the Audio hal is connected with the first audio playing device through Bluetooth, and the second audio playing device is provided with an audio AUX input unit or an audio USB Audio input unit, and the Audio hal is connected with the second audio playing device through an HDMI line. The Audio hal sends the audio data to the first audio playing device through the Bluetooth protocol stack, including that the Audio hal sends the audio data to the Bluetooth protocol stack; the Bluetooth protocol stack receives the audio data and packs the audio data into an audio data packet; the Bluetooth protocol stack stores the audio data packet into a buffer queue; and the buffer queue sends the audio data packet to the first audio playing device. The first audio playing device is provided with a Bluetooth unit, the Audio hal is connected with the first audio playing device through Bluetooth, and the second audio playing device is provided with an audio AUX input unit or an audio USB Audio input unit, and the Audio hal is connected with the second audio playing device through an HDMI line. The Audio hal sends the audio data to the first audio playing device through the Bluetooth protocol stack, including that the Audio hal sends the audio data to the Bluetooth protocol stack; the Bluetooth protocol stack receives the audio data and packs the audio data into an audio data packet; the Bluetooth protocol stack stores the audio data packet into a buffer queue; and the buffer queue sends the audio data packet to the first audio playing device. The first audio playing device is provided with a Bluetooth unit, the Audio hal is connected with the first audio playing device through Bluetooth, and the second audio playing device is provided with an audio AUX input unit or an audio USB Audio input unit, and the Audio hal is connected with the second audio playing device through an HDMI line. The Audio hal sends the audio data to the first audio playing device through the Bluetooth protocol stack, including that the Audio hal sends the audio data to the Bluetooth protocol stack; the Bluetooth protocol stack receives the audio data and packs the audio data into an audio data packet; the Bluetooth protocol stack stores the audio data packet into a buffer queue; and the buffer queue sends the audio data packet to the first audio playing device.
2. The method for audio synchronous playing of claim 1, wherein, The first audio playing device is provided with a Bluetooth unit, the Audio hal is connected with the first audio playing device through Bluetooth, and the second audio playing device is provided with an audio AUX input unit or an audio USB Audio input unit, and the Audio hal is connected with the second audio playing device through an HDMI line. The Audio hal sends the audio data to the first audio playing device through the Bluetooth protocol stack, including that the Audio hal sends the audio data to the Bluetooth protocol stack; the Bluetooth protocol stack receives the audio data and packs the audio data into an audio data packet; the Bluetooth protocol stack stores the audio data packet into a buffer queue; and the buffer queue sends the audio data packet to the first audio playing device.
3. The method for audio synchronous playing of claim 1, wherein, The first audio playing device is provided with a Bluetooth unit, the Audio hal is connected with the first audio playing device through Bluetooth, and the second audio playing device is provided with an audio AUX input unit or an audio USB Audio input unit, and the Audio hal is connected with the second audio playing device through an HDMI line.
4. An apparatus for audio synchronous playing, applied to a system composed of a first audio playing device and a second audio playing device, characterized in that, The Audio hal sends the audio data to the first audio playing device through the Bluetooth protocol stack, including that the Audio hal sends the audio data to the Bluetooth protocol stack; the Bluetooth protocol stack receives the audio data and packs the audio data into an audio data packet; the Bluetooth protocol stack stores the audio data packet into a buffer queue; and the buffer queue sends the audio data packet to the first audio playing device. The first audio playing device is provided with a Bluetooth unit, the Audio hal is connected with the first audio playing device through Bluetooth, and the second audio playing device is provided with an audio AUX input unit or an audio USB Audio input unit, and the Audio hal is connected with the second audio playing device through an HDMI line. The Audio hal sends the audio data to the first audio playing device through the Bluetooth protocol stack, including that the Audio hal sends the audio data to the Bluetooth protocol stack; the Bluetooth protocol stack receives the audio data and packs the audio data into an audio data packet; the Bluetooth protocol stack stores the audio data packet into a buffer queue; and the buffer queue sends the audio data packet to the first audio playing device. The first audio playing device is provided with a Bluetooth unit, the Audio hal is connected with the first audio playing device through Bluetooth, and the second audio playing device is provided with an audio AUX input unit or an audio USB Audio input unit, and the Audio hal is connected with the second audio playing device through an HDMI line. The Audio hal sends the audio data to the first audio playing device through the Bluetooth protocol stack, including that the Audio hal sends the audio data to the Bluetooth protocol stack; the Bluetooth protocol stack receives the audio data and packs the audio data into an audio data packet; the Bluetooth protocol stack stores the audio data packet into a buffer queue; and the buffer queue sends the audio data packet to the first audio playing device. The first audio playing device is provided with a Bluetooth unit, the Audio hal is connected with the first audio playing device through Bluetooth, and the second audio playing device is provided with an audio AUX input unit or an audio USB Audio input unit, and the Audio hal is connected with the second audio playing device through an HDMI line. The Audio hal sends the audio data to the first audio playing device through the Bluetooth protocol stack, including that the Audio hal sends the audio data to the Bluetooth protocol stack; the Bluetooth protocol stack receives the audio data and packs the audio data into an audio data packet; the Bluetooth protocol stack stores the audio data packet into a buffer queue; and the buffer queue sends the audio data packet to the first audio playing device. The first audio playing device is provided with a Bluetooth unit, the Audio hal is connected with the first audio playing device through Bluetooth, and the second audio playing device is provided with an audio AUX input unit or an audio USB Audio input unit, and the Audio hal is connected with the second audio playing device through an HDMI line.
5. The apparatus for audio synchronized playback of claim 4, wherein, The application further comprises an initialization module, which is configured to start the first audio playing device and the second audio playing device, and establish a communication connection between the Audio hal and the first audio playing device and between the Audio hal and the second audio playing device.
Citation Information
Patent Citations
Audio data transmission method, vehicle machine platform, vehicle machine and readable storage medium
CN110113728A
Bluetooth voice box synchronous playing method, device and system
CN111343622A