Audio playing method and display device
阅读说明:本技术 音频播放方法及显示设备 (Audio playing method and display device ) 是由 孙永瑞 张安祺 马斌义 李森 齐消消 于 2020-05-27 设计创作,主要内容包括:本申请实施例涉及音频播放技术领域,尤其涉及一种音频播放方法及显示设备,用以在通过外接播放设备播放音频数据时,利用HAL中的Tinyslsa直接的从SOC芯片中获取音频数据,以减少音频数据的播放时延。该方法包括:第一AudioTrack接收来自音频数据控制模块输入的第一格式的音频数据,对音频数据进行复制,将原音频数据和已复制的音频数据分别输出至第一AudioFlinger和第二AudioFlinger;第一AudioFlinger接收音频数据,并对音频数据进行混音处理得到第一音频数据,将第一音频数据输出至SOC芯片;第二AudioFlinger接收音频数据,并对音频数据进行混音处理得到第二音频数据,将第二音频数据写入HAL;Tinyalsa在HAL写入第二音频数据时从SOC芯片中获取第一音频数据并输出至外接播放设备进行播放。(The embodiment of the application relates to the technical field of audio playing, in particular to an audio playing method and display equipment, which are used for directly acquiring audio data from an SOC chip by utilizing Tinylsa in HAL when the audio data are played through external playing equipment so as to reduce the playing time delay of the audio data. The method comprises the following steps: the first Audio track receives audio data in a first format input by an audio data control module, copies the audio data, and respectively outputs the original audio data and the copied audio data to a first Audio Flinger and a second Audio Flinger; the first Audio Flinger receives the audio data, performs sound mixing processing on the audio data to obtain first audio data, and outputs the first audio data to the SOC chip; the second Audio Flinger receives the audio data, performs sound mixing processing on the audio data to obtain second audio data, and writes the second audio data into the HAL; and the Tinyalsa acquires the first audio data from the SOC chip and outputs the first audio data to the external playing equipment for playing when the HAL writes the second audio data.)
1. A display device, comprising:
a display;
a controller coupled to the display, comprising at least: the audio playing system comprises a first audio track AudioTrack, a first audio data entity AudioFlinger, a second Audio Flinger and a simplified version advanced Linux audio frame Tinyals, wherein the first audio track AudioTrack, the first audio data entity AudioFlinger and the second Audio Flinger are arranged between an audio data control module and a system on a chip (SOC) chip, and the simplified version advanced Linux audio frame Tinyals is created when an external playing device is started; the Tinyalsa runs in a HAL between the SOC chip and the external playback device;
the first AudioTrack is configured to receive the audio data in the first format input from the audio data control module, copy the audio data, and output the original audio data and the copied audio data to the first audioflasher and the second audioflasher, respectively;
the first audioFlinger is used for receiving the audio data, performing sound mixing processing on the audio data to obtain first audio data, and outputting the first audio data to the SOC chip;
the second audioFlinger is used for receiving the audio data, performing sound mixing processing on the audio data to obtain second audio data, and writing the second audio data into the HAL;
and the Tinyalsa is used for acquiring the first audio data from the SOC chip and outputting the first audio data to the external playing equipment for playing when the HAL writes the second audio data.
2. The display device of claim 1, wherein the first format is a Pulse Code Modulation (PCM) format.
3. The display device of claim 1, wherein the Tinyalsa is released when the add-on playback device changes from being turned on to being turned off or disconnected.
4. A display device, comprising:
a display;
a controller coupled to the display, comprising at least: a mute data control module, which is arranged between the mute data control module and the SOC chip and is associated with a second AudioTrack, a first audio data entity AudioFlinger and a second AudioFlinger of the mute data control module, and Tinyals created when an external playing device is started; the Tinyalsa runs in a HAL between the SOC chip and the external playback device;
the mute data control module is used for constructing mute data in a first format and outputting the mute data to the second AudioTrack when the SOC chip receives audio data in a second format; the playing time length of the mute data is equal to that of the audio data in the second format;
the second AudioTrack is configured to receive the mute data input from the mute data control module, copy the mute data, and output the original mute data and the copied mute data to the first AudioFlinger and the second AudioFlinger, respectively;
the first audioFlinger is used for receiving the mute data, performing sound mixing processing on the mute data to obtain third audio data, and outputting the third audio data to the SOC chip;
the second audioFlinger is used for receiving the mute data, performing sound mixing processing on the mute data to obtain fourth audio data, and writing the fourth audio data into the HAL;
the SOC chip is used for receiving the audio data in the second format, converting the audio data in the second format into audio data in the first format, and performing sound mixing processing on the converted audio data and the received audio data in the first format to obtain fifth audio data when receiving the third audio data;
and the Tinyalsa is used for acquiring the fifth audio data from the SOC chip and outputting the fifth audio data to the external playing equipment for playing when the HAL writes the fourth audio data in.
5. A display device, comprising:
a display;
a controller coupled to the display, comprising at least: a third AudioTrack and a third audioFlinger which are arranged between the audio data control module and the SOC chip;
the third AudioTrack is used for receiving the audio data in the first format input by the audio data control module and outputting the audio data to the third audioFlinger;
and the third audioFlinger is used for receiving the audio data, performing sound mixing processing on the audio data to obtain sixth audio data, and outputting the sixth audio data to the external playing equipment for playing.
6. A display device, comprising:
a display;
a controller coupled to the display, comprising at least: a fourth AudioTrack, a third audioFlinger, an audio mixer and Tinyalsa created when an external playing device is started, which are arranged between a mute data control module and an SOC chip and are associated with the mute data control module; the AudioMixer and Tinyalsa run between the HAL, the SOC chip and the external playback device;
the mute data control module is used for constructing mute data in a first format and outputting the mute data to the fourth AudioTrack when the SOC chip receives audio data in a second format; the playing time length of the mute data is equal to that of the audio data in the second format;
the fourth AudioTrack is configured to receive the mute data input from the mute data control module, and output the mute data to the third audioFlinger;
the third audioFlinger is used for receiving the mute data, performing sound mixing processing on the mute data to obtain seventh audio data, and outputting the seventh audio data to the audioMixer;
the SOC chip is used for receiving the audio data in the second format and converting the audio data in the second format into the audio data in the first format;
the Tinyalsa is configured to obtain the audio data in the first format from the SOC chip and output the audio data to the AudioMixer when the AudioMixer receives the seventh audio data;
the AudioMixer is configured to receive the audio data in the first format and the seventh audio data output by Tinyalsa, perform audio mixing processing on the audio data in the first format and the seventh audio data to obtain eighth audio data, and output the eighth audio data to the external playing device for playing.
7. An audio playing method, comprising:
when the system is started, starting a first audio track AudioTrack, a first audio data entity AudioFlinger and a second Audio Flinger which are arranged between an audio data control module and an SOC chip;
when an external playing device is started, creating Tinyalsa; the Tinyalsa runs in a HAL between the SOC chip and the external playback device;
the first AudioTrack receives audio data in a first format input by the audio data control module, copies the audio data, and outputs original audio data and copied audio data to the first audioFlinger and the second audioFlinger respectively;
the first Audio Flinger receives the audio data, performs sound mixing processing on the audio data to obtain first audio data, and outputs the first audio data to the SOC chip;
the second audioFlinger receives the audio data, performs sound mixing processing on the audio data to obtain second audio data, and writes the second audio data into the HAL;
and when the HAL writes the second audio data, the Tinyalsa acquires the first audio data from the SOC chip and outputs the first audio data to the external playing equipment for playing.
8. The method of claim 7, wherein the first format is a Pulse Code Modulation (PCM) format.
9. The method of claim 7, wherein the Tinyalsa is released when the add-on playback device changes from being powered on to being powered off or disconnected.
10. An audio playing method, comprising:
when the system is started, starting a mute data control module, and a second AudioTrack, a first audio data entity AudioFlinger and a second AudioFlinger which are arranged between the mute data control module and an SOC chip and are associated with the mute data control module;
when an external playing device is started, creating Tinyalsa; the Tinyalsa runs in a HAL between the SOC chip and the external playback device;
when the SOC chip receives audio data in a second format, the mute data control module constructs mute data in a first format and outputs the mute data to the second Audio track; the playing time length of the mute data is equal to that of the audio data in the second format;
the second AudioTrack receives the mute data input from the mute data control module, copies the mute data, and respectively outputs the original mute data and the copied mute data to the first audioFlinger and the second audioFlinger;
the first audioFlinger receives the mute data, performs sound mixing processing on the mute data to obtain third audio data, and outputs the third audio data to the SOC chip;
the second audioFlinger receives the mute data, performs sound mixing processing on the mute data to obtain fourth audio data, and writes the fourth audio data into the HAL;
the SOC chip receives the audio data in the second format, converts the audio data in the second format into audio data in the first format, and performs sound mixing processing on the converted audio data and the received audio data in the first format to obtain fifth audio data when receiving the third audio data;
and the Tinyalsa acquires the fifth audio data from the SOC chip when the HAL writes the fourth audio data and outputs the fifth audio data to the external playing equipment for playing.
11. An audio playing method, comprising:
when the system is started, starting a third AudioTrack and a third AudioFlinger which are arranged between the audio data control module and the SOC;
the third AudioTrack receives the audio data in the first format input by the audio data control module and outputs the audio data to the third audioFlinger;
and the third Audio Flinger receives the audio data, performs sound mixing processing on the audio data to obtain sixth audio data, and outputs the sixth audio data to the external playing equipment for playing.
12. An audio playing method, comprising:
when the computer is started, starting a fourth Audio track, a third Audio Flinger and an audio mixer, wherein the fourth Audio track, the third Audio Flinger and the audio mixer are arranged between a mute data control module and an SOC chip and are associated with the mute data control module;
when an external playing device is started, creating Tinyalsa; the AudioMixer and Tinyalsa run between the HAL, the SOC chip and the external playback device;
when the SOC chip receives the audio data in the second format, the mute data control module constructs mute data in the first format and outputs the mute data to the fourth Audio track; the playing time length of the mute data is equal to that of the audio data in the second format;
the fourth AudioTrack receives the mute data input by the mute data control module and outputs the mute data to the third audioFlinger;
the third audioFlinger receives the mute data, performs sound mixing processing on the mute data to obtain seventh audio data, and outputs the seventh audio data to the audioMixer;
the SOC chip receives the audio data in the second format and converts the audio data in the second format into audio data in the first format;
the Tinyalsa acquires the audio data in the first format from the SOC chip and outputs the audio data to the AudioMixer when the AudioMixer receives the seventh audio data;
and the AudioMixer receives the audio data in the first format and the seventh audio data output by the Tinyalsa, performs audio mixing processing on the audio data in the first format and the seventh audio data to obtain eighth audio data, and outputs the eighth audio data to the external playing device for playing.
Technical Field
The present application relates to the field of audio playing technologies, and in particular, to an audio playing method and a display device.
Background
Currently, most operating systems carried by smart televisions are Android (Android) operating systems. Under an android operating system, when an intelligent television plays audio data through an external playing device, the audio data is firstly decoded and mixed by an SOC (system on a Chip) Chip, then processed by modules such as Tinyalsa (reduced version advanced Linux audio framework), AudioRecord (audio recording module), hippk (application program module), AudioTrack (audio track) and AudioFlinger (first audio data entity), and finally transmitted to an external playing device interface in an HAL (Hardware abstraction layer), so that the audio data is played by the external playing device.
However, in the process of routing the audio data from the SOC chip to the interface of the external playback device in the HAL, there are more modules participating in the transmission and processing of the audio data, which results in a higher delay of the audio data when the external playback device plays the audio data.
Disclosure of Invention
The application provides an audio playing method and display equipment, which are used for directly acquiring audio data from an SOC chip by utilizing Tinylsa in HAL when playing audio data through external playing equipment, and transmitting the audio data to the external playing equipment for playing, so that the playing time delay of the audio data is reduced.
In a first aspect, the present application provides a display device comprising:
a display;
a controller coupled to the display, comprising at least: the audio playing system comprises a first audio track AudioTrack, a first audio data entity AudioFlinger, a second Audio Flinger and a simplified version advanced Linux audio frame Tinyals, wherein the first audio track AudioTrack, the first audio data entity AudioFlinger and the second Audio Flinger are arranged between an audio data control module and a system on a chip (SOC) chip, and the simplified version advanced Linux audio frame Tinyals is created when an external playing device is started; the Tinyalsa runs in a HAL between the SOC chip and the external playback device;
the first AudioTrack is configured to receive the audio data in the first format input from the audio data control module, copy the audio data, and output the original audio data and the copied audio data to the first audioflasher and the second audioflasher, respectively;
the first audioFlinger is used for receiving the audio data, performing sound mixing processing on the audio data to obtain first audio data, and outputting the first audio data to the SOC chip;
the second audioFlinger is used for receiving the audio data, performing sound mixing processing on the audio data to obtain second audio data, and writing the second audio data into the HAL;
and the Tinyalsa is used for acquiring the first audio data from the SOC chip and outputting the first audio data to the external playing equipment for playing when the HAL writes the second audio data.
In a second aspect, the present application provides a display device comprising:
a display;
a controller coupled to the display, comprising at least: a mute data control module, which is arranged between the mute data control module and the SOC chip and is associated with a second AudioTrack, a first audio data entity AudioFlinger and a second AudioFlinger of the mute data control module, and Tinyals created when an external playing device is started; the Tinyalsa runs in a HAL between the SOC chip and the external playback device;
the mute data control module is used for constructing mute data in a first format and outputting the mute data to the second AudioTrack when the SOC chip receives audio data in a second format; the playing time length of the mute data is equal to that of the audio data in the second format;
the second AudioTrack is configured to receive the mute data input from the mute data control module, copy the mute data, and output the original mute data and the copied mute data to the first AudioFlinger and the second AudioFlinger, respectively;
the first audioFlinger is used for receiving the mute data, performing sound mixing processing on the mute data to obtain third audio data, and outputting the third audio data to the SOC chip;
the second audioFlinger is used for receiving the mute data, performing sound mixing processing on the mute data to obtain fourth audio data, and writing the fourth audio data into the HAL;
the SOC chip is used for receiving the audio data in the second format, converting the audio data in the second format into audio data in the first format, and performing sound mixing processing on the converted audio data and the received audio data in the first format to obtain fifth audio data when receiving the third audio data;
and the Tinyalsa is used for acquiring the fifth audio data from the SOC chip and outputting the fifth audio data to the external playing equipment for playing when the HAL writes the fourth audio data in.
In a third aspect, the present application provides a display device comprising:
a display;
a controller coupled to the display, comprising at least: a third AudioTrack and a third audioFlinger which are arranged between the audio data control module and the SOC chip;
the third AudioTrack is used for receiving the audio data in the first format input by the audio data control module and outputting the audio data to the third audioFlinger;
and the third audioFlinger is used for receiving the audio data, performing sound mixing processing on the audio data to obtain sixth audio data, and outputting the sixth audio data to the external playing equipment for playing.
In a fourth aspect, the present application provides a display device, comprising:
a display;
a controller coupled to the display, comprising at least: a fourth AudioTrack, a third audioFlinger, an audio mixer and Tinyalsa created when an external playing device is started, which are arranged between a mute data control module and an SOC chip and are associated with the mute data control module; the AudioMixer and Tinyalsa run between the HAL, the SOC chip and the external playback device;
the mute data control module is used for constructing mute data in a first format and outputting the mute data to the fourth AudioTrack when the SOC chip receives audio data in a second format; the playing time length of the mute data is equal to that of the audio data in the second format;
the fourth AudioTrack is configured to receive the mute data input from the mute data control module, and output the mute data to the third audioFlinger;
the third audioFlinger is used for receiving the mute data, performing sound mixing processing on the mute data to obtain seventh audio data, and outputting the seventh audio data to the audioMixer;
the SOC chip is used for receiving the audio data in the second format and converting the audio data in the second format into the audio data in the first format;
the Tinyalsa is configured to obtain the audio data in the first format from the SOC chip and output the audio data to the AudioMixer when the AudioMixer receives the seventh audio data;
the AudioMixer is configured to receive the audio data in the first format and the seventh audio data output by Tinyalsa, perform audio mixing processing on the audio data in the first format and the seventh audio data to obtain eighth audio data, and output the eighth audio data to the external playing device for playing.
In a fifth aspect, an audio playing method is provided, which includes:
when the system is started, starting a first audio track AudioTrack, a first audio data entity AudioFlinger and a second Audio Flinger which are arranged between an audio data control module and an SOC chip;
when an external playing device is started, creating Tinyalsa; the Tinyalsa runs in a HAL between the SOC chip and the external playback device;
the first AudioTrack receives audio data in a first format input by the audio data control module, copies the audio data, and outputs original audio data and copied audio data to the first audioFlinger and the second audioFlinger respectively;
the first Audio Flinger receives the audio data, performs sound mixing processing on the audio data to obtain first audio data, and outputs the first audio data to the SOC chip;
the second audioFlinger receives the audio data, performs sound mixing processing on the audio data to obtain second audio data, and writes the second audio data into the HAL;
and when the HAL writes the second audio data, the Tinyalsa acquires the first audio data from the SOC chip and outputs the first audio data to the external playing equipment for playing.
In a sixth aspect, the present application provides an audio playing method, including:
when the system is started, starting a mute data control module, and a second AudioTrack, a first audio data entity AudioFlinger and a second AudioFlinger which are arranged between the mute data control module and an SOC chip and are associated with the mute data control module;
when an external playing device is started, creating Tinyalsa; the Tinyalsa runs in a HAL between the SOC chip and the external playback device;
when the SOC chip receives audio data in a second format, the mute data control module constructs mute data in a first format and outputs the mute data to the second Audio track; the playing time length of the mute data is equal to that of the audio data in the second format;
the second AudioTrack receives the mute data input from the mute data control module, copies the mute data, and respectively outputs the original mute data and the copied mute data to the first audioFlinger and the second audioFlinger;
the first audioFlinger receives the mute data, performs sound mixing processing on the mute data to obtain third audio data, and outputs the third audio data to the SOC chip;
the second audioFlinger receives the mute data, performs sound mixing processing on the mute data to obtain fourth audio data, and writes the fourth audio data into the HAL;
the SOC chip receives the audio data in the second format, converts the audio data in the second format into audio data in the first format, and performs sound mixing processing on the converted audio data and the received audio data in the first format to obtain fifth audio data when receiving the third audio data;
and the Tinyalsa acquires the fifth audio data from the SOC chip when the HAL writes the fourth audio data and outputs the fifth audio data to the external playing equipment for playing.
In a seventh aspect, the present application provides an audio playing method, including:
when the system is started, starting a third AudioTrack and a third AudioFlinger which are arranged between the audio data control module and the SOC;
the third AudioTrack receives the audio data in the first format input by the audio data control module and outputs the audio data to the third audioFlinger;
and the third Audio Flinger receives the audio data, performs sound mixing processing on the audio data to obtain sixth audio data, and outputs the sixth audio data to the external playing equipment for playing.
In an eighth aspect, the present application provides an audio playing method, including:
when the computer is started, starting a fourth Audio track, a third Audio Flinger and an audio mixer, wherein the fourth Audio track, the third Audio Flinger and the audio mixer are arranged between a mute data control module and an SOC chip and are associated with the mute data control module;
when an external playing device is started, creating Tinyalsa; the AudioMixer and Tinyalsa run between the HAL, the SOC chip and the external playback device;
when the SOC chip receives the audio data in the second format, the mute data control module constructs mute data in the first format and outputs the mute data to the fourth Audio track; the playing time length of the mute data is equal to that of the audio data in the second format;
the fourth AudioTrack receives the mute data input by the mute data control module and outputs the mute data to the third audioFlinger;
the third audioFlinger receives the mute data, performs sound mixing processing on the mute data to obtain seventh audio data, and outputs the seventh audio data to the audioMixer;
the SOC chip receives the audio data in the second format and converts the audio data in the second format into audio data in the first format;
the Tinyalsa acquires the audio data in the first format from the SOC chip and outputs the audio data to the AudioMixer when the AudioMixer receives the seventh audio data;
and the AudioMixer receives the audio data in the first format and the seventh audio data output by the Tinyalsa, performs audio mixing processing on the audio data in the first format and the seventh audio data to obtain eighth audio data, and outputs the eighth audio data to the external playing device for playing.
In the above embodiment, when the audio data is played by the external playing device, two audioflinders are created locally, where one audioflinder is used to mix the audio data transmitted by the AudioTrack into the first audio data and input the first audio data to the SOC chip, and the other audioflinder is used to mix the audio data transmitted by the AudioTrack into the second audio data and input the second audio data to the HAL, so as to trigger tinyssa in the HAL to directly acquire the first audio data from the SOC chip and transmit the first audio data to the external playing device for playing.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1A is a schematic diagram illustrating an operation scenario between a display device and a control apparatus;
fig. 1B is a block diagram schematically illustrating a configuration of the
fig. 1C is a block diagram schematically illustrating a configuration of the
FIG. 1D is a block diagram illustrating an architectural configuration of an operating system in memory of
fig. 2 exemplarily shows an audio play frame configuration diagram of the
3A-C illustrate an interaction flow diagram of a method of audio playback;
FIGS. 4A-D illustrate another audio playback frame configuration diagram for
FIGS. 5A-C illustrate an interaction flow diagram of another audio playback method;
fig. 6A-D illustrate another audio playback frame configuration diagram for
Detailed Description
In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The term "user interface" in this application is a media interface for interaction and information exchange between an application or operating system and a user that enables conversion between an internal form of information and a form acceptable to the user. A common presentation form of a user interface is a Graphical User Interface (GUI), which refers to a user interface related to computer operations and displayed in a graphical manner. It may be an interface element such as an icon, a window, a control, etc. displayed in the display screen of the display device, where the control may include a visual interface element such as an icon, a button, a menu, a tab, a text box, a dialog box, a status bar, a navigation bar, a Widget, etc.
The audio playing method provided by the embodiment of the application can be applied to display equipment. The user can control the display device to execute the audio playing method provided by the embodiment of the application by operating the control device for controlling the display device.
Fig. 1A is a schematic diagram illustrating an operation scenario between a display device and a control apparatus. As shown in fig. 1A, the
Among them, the
The
The
For example, the
The
The
The
Fig. 1B is a block diagram illustrating the configuration of the
The controller 110 includes a Random Access Memory (RAM)111, a Read Only Memory (ROM)112, a processor 113, a communication interface, and a communication bus. The controller 110 is used to control the operation of the
Illustratively, when an interaction of a user pressing a key disposed on the
And a memory 120 for storing various operation programs, data and applications for driving and controlling the
The communicator 130 enables communication of control signals and data signals with the
The user input interface 140 may include at least one of a microphone 141, a touch pad 142, a sensor 143, a key 144, and the like, so that a user can input a user instruction regarding controlling the
The output interface 150 outputs a user instruction received by the user input interface 140 to the
And a power supply 160 for providing operation power support for each element of the
A hardware configuration block diagram of the
The
The
The
In other exemplary embodiments, the
The
The
In some other exemplary embodiments, the
In some other exemplary embodiments, the
In some other exemplary embodiments, the
The
The
The
As shown in fig. 1C, the
The ROM252 stores various system boot instructions. When the
And a
A
In some example embodiments, the
The
The
Where the object may be any one of the selectable objects, such as a hyperlink or an icon. The operation related to the selected object is, for example, an operation of displaying a link to a hyperlink page, document, image, or the like, or an operation of executing a program corresponding to the object. The user input command for selecting the GUI object may be a command input through various input means (e.g., a mouse, a keyboard, a touch panel, etc.) connected to the
A
In some embodiments, the
In some embodiments,
In some embodiments,
A block diagram of the architectural configuration of the operating system in the memory of the
The application layer, the application programs built in the system and the non-system-level application programs belong to the application layer. Is responsible for direct interaction with the user. The application layer may include a plurality of applications such as a setup application, a post application, a media center application, and the like. These applications may be implemented as Web applications that execute based on a WebKit engine, and in particular may be developed and executed based on HTML5, Cascading Style Sheets (CSS), and JavaScript.
Here, HTML, which is called HyperText Markup Language (HyperText Markup Language), is a standard Markup Language for creating web pages, and describes the web pages by Markup tags, where the HTML tags are used to describe characters, graphics, animation, sound, tables, links, etc., and a browser reads an HTML document, interprets the content of the tags in the document, and displays the content in the form of web pages.
CSS, known as Cascading Style Sheets (Cascading Style Sheets), is a computer language used to represent the Style of HTML documents, and may be used to define Style structures, such as fonts, colors, locations, etc. The CSS style can be directly stored in the HTML webpage or a separate style file, so that the style in the webpage can be controlled.
JavaScript, a language applied to Web page programming, can be inserted into an HTML page and interpreted and executed by a browser. The interaction logic of the Web application is realized by JavaScript. The JavaScript can package a JavaScript extension interface through a browser, realize the communication with the kernel layer,
the middleware layer may provide some standardized interfaces to support the operation of various environments and systems. For example, the middleware layer may be implemented as multimedia and hypermedia information coding experts group (MHEG) middleware related to data broadcasting, DLNA middleware which is middleware related to communication with an external device, middleware which provides a browser environment in which each application program in the display device operates, and the like.
The kernel layer provides core system services, such as: file management, memory management, process management, network management, system security authority management and the like. The kernel layer may be implemented as a kernel based on various operating systems, for example, a kernel based on the Linux operating system.
The kernel layer also provides communication between system software and hardware, and provides device driver services for various hardware, such as: provide display driver for the display, provide camera driver for the camera, provide button driver for the remote controller, provide wiFi driver for the WIFI module, provide audio driver for audio output interface, provide power management drive for Power Management (PM) module etc..
A
In some embodiments, a user may enter user commands on a Graphical User Interface (GUI) displayed on the
Alternatively, the user may input a user command by inputting a specific sound or gesture, and the
The
Illustratively, the
The demultiplexing module is configured to demultiplex an input audio/video data stream, where, for example, an input MPEG-2 stream (based on a compression standard of a digital storage media moving image and voice), the demultiplexing module demultiplexes the input audio/video data stream into a video signal and an audio signal.
And the video decoding module is used for processing the video signal after demultiplexing, including decoding, scaling and the like.
And the image synthesis module is used for carrying out superposition mixing processing on the GUI signal input by the user or generated by the user and the video image after the zooming processing by the graphic generator so as to generate an image signal for display.
The frame rate conversion module is configured to convert a frame rate of an input video, for example, convert a frame rate of an input 60Hz video into a frame rate of 120Hz or 240Hz, where a common format is implemented by using, for example, an interpolation frame method.
And a display formatting module for converting the signal output by the frame rate conversion module into a signal conforming to a display format of a display, such as converting the format of the signal output by the frame rate conversion module to output an RGB data signal.
A
And, the
The
Illustratively,
The
In other exemplary embodiments,
And, in other exemplary embodiments, the
And a
In some embodiments, when the display device is externally connected to an external playing device, the display device outputs the audio data to the external playing device for playing according to the process shown in fig. 2. Referring to the flow shown in fig. 2, when there is audio data to be played in the display device, for example, when an APP (Application program) in the display device generates PCM (Pulse Code Modulation) audio data, the PCM audio data is first transmitted to the SOC chip through the AudioTrack and the audioflag. For another example, when the set-top box transmits the physical audio data of Physic to the display device, the physical audio data of Physic is directly transmitted to the SOC chip. Then, the SOC chip decodes the Physic physical audio, and the SOC chip mixes the decoded audio data with the PCM audio data to obtain audio data after mixing, namely the audio data which needs to be played finally. After the audio data which needs to be played finally is obtained, the audio data after the audio mixing is processed and transmitted by modules such as Tinyalsa, AudioRecord, hippk, AudioTrack, AudioFlinger and the like, so that the audio data after the audio mixing is finally transmitted to an external playing device for playing. However, in the audio playing process, there are more modules participating in the transmission and processing of the audio data, which results in higher delay of the audio data when the external playing device plays the audio data.
Therefore, this embodiment provides an audio playing method, so that when playing audio data through an external playing device, the tinyslas in the HAL is used to directly obtain the audio data from the SOC chip and transmit the audio data to the external playing device for playing, thereby reducing the playing delay of the audio data.
The audio playing method provided by this embodiment is divided into three different situations according to different formats of audio data to be played. Hereinafter, the different cases will be described separately.
As a first situation, the display device needs to output the audio data in the first format to the external playing device for playing. With reference to the flow shown in fig. 3A, in this case, the audio playing method provided in this embodiment may be applied to the display device, and the display device may be equipped with an Android operating system. In conjunction with fig. 4A and 4B, the display device may include a display, a controller coupled to the display. The controller may be provided with at least: the audio playing system comprises a first audio track AudioTrack, a first audio data entity AudioFlinger, a second Audio Flinger and a simplified version advanced Linux audio frame Tinyals, wherein the first audio track AudioTrack, the first audio data entity AudioFlinger and the second Audio Flinger are arranged between an audio data control module and a system on a chip (SOC) chip, and the simplified version advanced Linux audio frame Tinyals is created when an external playing device is started; tinyalsa runs in the HAL between the SOC chip and the external playback device.
As shown in fig. 3A, the process may include the following steps:
step 101, the audio data control module outputs audio data in a first format to the first AudioTrack.
As one example, the audio data in the first format may be audio data in a PCM format.
As an example, when the Android operating system loaded on the display device in this embodiment is started, the first AudioTrack is automatically started. The first AudioTrack is used for receiving the audio data transmitted by the audio data control module. The audio data control module can be implemented in a software form or a hardware form, and corresponds to an application program running in the display device, and is used for outputting audio data to be played to the first AudioTrack. Specifically, the audio data control module specifically corresponds to which application program in the display device, and the embodiment of the present application is not limited thereto.
As one example, the audio data may be audio data generated by any application in the display device, such as audio data generated by a video player while playing a video media file or an audio player while playing an audio media file. The audio data may be either mute data or non-mute data. In addition to the user adjusting the playback volume of the application program to 0, and further making the volume of the audio data output by the application program to 0, the following describes an implementation manner of outputting the mute data under the non-user-defined operation. As to the specific role of the implementation in what kind of scenario, the following will describe in detail, and the detailed description is omitted here.
As an example, when there are multiple applications in the display device that need to output audio data, multiple audio data control modules corresponding to the multiple applications are created in the display device, and each audio data control module corresponds to one AudioTrack.
And 102, receiving the audio data in the first format input by the audio data control module by the first AudioTrack, copying the audio data, and respectively outputting the original audio data and the copied audio data to the first audioFlinger and the second audioFlinger.
As an example, when the Android operating system loaded on the display device in this embodiment is started, two audioflingers, namely, a first AudioFlinger and a second AudioFlinger, are automatically started. The first and second are used only for the distinction between different audioflingers and are not specifically limited.
As an example, when the first AudioTrack is created, the first AudioTrack and the first AudioFlinger and the second AudioFlinger may establish a connection through a binding mechanism defined in an Android operating system. Since the binding mechanism is not the focus of the improvement of the present application, it will not be described in detail here.
As an example, since the first AudioTrack created in the display device is associated with two audioflingers, the interaction mode of the first AudioTrack with each AudioFlinger needs to be configured as a copying mode. Specifically, when the first AudioTrack operates in the duplexing mode, after receiving the audio data, the first AudioTrack duplicates the audio data according to the number of the audiomarkers associated with the first AudioTrack, so that each audiomarker associated with the first AudioTrack can receive one copy of the audio data. In connection with step 101, since the first AudioTrack associates the first AudioFlinger and the second AudioFlinger, when the first AudioTrack operates in the Duplicating mode, one copy of the received audio data is copied, and then two copies of the audio data are obtained. The first AudioTrack may then send one of the audio data to the first AudioFlinger and another audio data to the second AudioFlinger.
As one example, the audio data received by the first AudioTrack may be PCM audio data.
And 103, the first audioFlinger receives the audio data and performs sound mixing processing on the audio data to obtain first audio data.
As an example, the first AudioFlinger may be created based on an SOC chip in the display device when being created, and then the first AudioFlinger may output the audio data after the mixing process to the SOC chip.
As an example, the first AudioFlinger is configured to perform mixing processing on the received multiple channels of audio data, so as to obtain a channel of mixed audio data, that is, the first audio data. Since the first audiomaker is created based on the SOC chip in the display device, the first audio data can be transmitted to the SOC chip after being obtained. As for how the SOC chip processes the received first audio data, the following description will be given in detail, and details thereof are not repeated here.
As an example, when the first AudioFlinger performs mixing processing on audio data, a plurality of mixing strategies may be adopted. For example, when the first AudioFlinger performs mixing processing, in order to improve the transmission efficiency of audio data, multiple paths of audio data with a sampling rate of more than 48KHz, a Bit depth of more than 16 bits, and a Bit rate of more than 32kbit/s may be mixed and processed into a path of audio data with a sampling rate of 48KHz, a Bit depth of 16 bits, and a Bit rate of 32 kbit/s. Specifically, assume that the first audioFlinger receives two paths of audio data simultaneously, wherein the playing time of one path of audio data is 3 minutes, 15 seconds and 13 frames, the sampling rate is 48KHz, the Bit depth is 16 bits, the Bit rate is 32kbit/s, the playing time of the other path of audio data is 2 minutes, 10 seconds and 13 frames, the sampling rate is 96KHz, the Bit depth is 24 bits, and the Bit rate is 96 kbit/s. Then, the first AudioFlinger sets the playing time length of the audio data after the audio mixing processing according to the audio data with longer playing time length. Here, the playback time length of the audio data obtained after the mixing process is set to 3 minutes, 15 seconds, and 13 frames. Then, the first audioFlinger adjusts the sampling rate, Bit depth and Bit rate of the two paths of audio data, so that the sampling rate, Bit depth and Bit rate of the two paths of audio data are respectively 48KHz, 16Bit and 32 kbit/s. After the sampling rate, the bit depth and the bit rate of the two paths of audio data are all adjusted to preset values, the two paths of audio data can be processed into one path of audio data in a superposition mode, and then audio mixing processing is completed.
It should be noted that the mixing strategy adopted by the first AudioFlinger may be set according to actual situations, and the present application does not specifically limit the strategy.
As an example, the SOC chip may store the first audio data output by the first audiomaker in the SOC chip after receiving the first audio data. As for how the first audio data stored in the SOC chip is output, the following will be described in detail, and the detailed description thereof will be omitted.
Step 104, the first audiomaker outputs the first audio data to the SOC chip.
As an example, after the first AudioFlinger completes the audio mixing process on the audio data to obtain the first audio data, the first audio data may be output to the SOC chip.
And 105, the second audioFlinger receives the audio data and performs sound mixing processing on the audio data to obtain second audio data.
As an example, when being created, the second AudioFlinger may be created based on an external playing device externally connected to the display device, so that the second AudioFlinger can output the processed audio data to a HAL in an Android operating system, and then the HAL outputs the audio data to the external playing device. How the audio data is output from the HAL to the external playback device will be described in detail later, and will not be described herein again.
As an example, the second AudioFlinger is used to mix multiple channels of received audio data, so as to obtain a channel of mixed audio data, that is, the second audio data. Here, in order to guarantee normal output of subsequent audio data, the mixing strategy of the second AudioFlinger may be set to be the same as that of the first AudioFlinger.
It should be noted that the mixing strategy adopted by the second AudioFlinger may be set according to actual situations, and the present application does not specifically limit the strategy.
The second AudioFlinger writes the second audio data to the HAL, step 106.
As an example, after the second AudioFlinger completes the mixing process of the audio data to obtain the second audio data, the out _ write function may be called to write the second audio data into the HAL.
In step 107, Tinyalsa acquires the first audio data from the SOC chip when the HAL writes the second audio data.
As an example, Tinyalsa, located at the HAL, may be created by the display device upon detecting that a started external playback device is connected, and released by the display device upon detecting that the external playback device is disconnected or turned off.
As an example, Tinyalsa at the HAL may be driven to actively acquire the first audio data from the SOC chip when the second audio data is written to the HAL. Since the operation of Tinyalsa actively acquiring audio data from the SOC chip needs to be driven by the second audio data written in the HAL, the playing time length of the first audio data acquired by Tinyalsa from the SOC chip and the second audio flinger writing the second audio data to the HAL are the same. Specifically, after the second audio data is written into the HAL, Tinyalsa may send a read request for reading the first audio data to the SOC chip, where the read request carries a playing time length of the audio data to be read, and the playing time length is a playing time length of the second audio data, so as to read the first audio data stored in the SOC chip. After receiving the read request sent by Tinyalsa, the SOC chip may send the first audio data stored in the SOC chip to Tinyalsa.
And step 108, Tinyalsa outputs the first audio data to an external playing device for playing.
As an example, after Tinyalsa acquires the first audio data from the SOC chip, the first audio data may be output to an audio playing interface of an external playing device, so that the external playing device performs audio playing according to the first audio data received by the audio playing interface. Referring to fig. 4B, a Data Pool is set between Tinyalsa and the audio playing interface of the external playing device, for buffering the first audio Data, so as to avoid the first audio Data from being lost due to the occurrence of a block during transmission.
To this end, the description of how the display device plays the audio data in the first format is completed.
In the above embodiment, in the process of playing the audio data through the external playing device, two audiomarkers are created locally, where one audiomarker is used to mix the audio data transmitted by the AudioTrack into the first audio data and input the first audio data to the SOC chip, so that the third audio data that needs to be played finally is obtained through processing the first audio data by the SOC chip, and the other audiomarker is used to mix the audio data transmitted by the AudioTrack into the second audio data and input the second audio data to the HAL, so as to trigger tinyssa in the HAL to directly obtain the third audio data from the SOC chip and transmit the third audio data to the external playing device for playing.
As a second case, in conjunction with the above description regarding the first case, the operation of Tinyalsa actively acquiring audio data from the SOC chip needs to be driven by the second audio data written in the HAL. Therefore, when there is no audio data in the first format that needs to be output in the display device, but there is only audio data in the second format that needs to be output, no second audio data can be written in the HAL to drive Tinyalsa to obtain the audio data in the second format from the SOC chip, and the audio data in the second format in the SOC chip cannot be played. Based on this, the embodiment of the present application additionally provides a mute data control module for configuring mute data in the display device to use the mute data to drive Tinyalsa in the above case, which is described in detail below:
with reference to the flow shown in fig. 3B, in this case, the audio playing method provided in this embodiment may be applied to the display device, and the display device may be equipped with an Android operating system. In conjunction with fig. 4C and 4B, the display device may include a display, a controller coupled to the display. The controller may be provided with at least: a mute data control module, which is arranged between the mute data control module and the SOC chip and is associated with a second AudioTrack, a first audio data entity AudioFlinger and a second AudioFlinger of the mute data control module, and Tinyals created when the external playing device is started; tinyalsa runs in the HAL between the SOC chip and the external playback device.
As shown in fig. 3B, the process may include the following steps:
in step 201, the SOC chip receives the audio data in the second format and converts the audio data in the second format into the audio data in the first format.
As an example, here the first format is a PCM format, and the second format is a format other than the first format, e.g. physical audio data of physics. Since the Android operating system defines that the AudioTrack can only transmit audio data in the PCM format, audio data in other formats are first transmitted to the SOC chip, and then decoded into PCM audio data by the SOC chip, and then subsequently processed accordingly.
In step 202, the mute data control module constructs mute data in the first format when the SOC chip receives the audio data in the second format.
As one example, the mute data control module may correspond to a mute application installed in the display device and may be used to construct mute data. The mute data may be audio data in PCM format.
As an example, since the mute data control module may consume processing resources of the display device and generate pressure on the output process of the audio data when constructing the mute data, it may be selected to trigger the mute data control module to construct the mute data only when the SOC chip receives the audio data to be decoded, and then output the mute data. Specifically, monitoring may be performed on an interface in the SOC chip, which is used to receive the audio data in the second format, and once the interface is monitored to receive the audio data in the second format, an instruction for constructing the mute data may be sent to the mute data control module, so that the mute data control module starts to construct the mute data and outputs the mute data. Then, when it is monitored that the interface no longer receives the audio data in the second format, an instruction for stopping constructing the mute data can be sent to the mute data control module, so that the mute data control module stops constructing the mute data. On the basis, the mute data is equal to the playing time length of the audio data in the second format received by the SOC chip.
In step 203, the mute data control module outputs the mute data to the second AudioTrack.
Step 204, the second AudioTrack receives the mute data input from the mute data control module, copies the mute data, and outputs the original mute data and the copied mute data to the first AudioFlinger and the second AudioFlinger, respectively.
As an example, the specific operation performed in this step is similar to that of step 102, and reference may be made to the foregoing description of step 102, which is not repeated herein.
Step 205, the first AudioFlinger receives the mute data, and performs sound mixing processing on the mute data to obtain third audio data.
As an example, in this step, the mixing processing performed by the first AudioFlinger on the mute data is similar to the step 103, and reference may be made to the foregoing description of the step 103, which is not described herein again.
It should be noted that the mixing strategy adopted by the first AudioFlinger may be set according to actual situations, and the present application does not specifically limit the strategy.
In step 206, the first audiomaker outputs the third audio data to the SOC chip.
As an example, after the first AudioFlinger completes the mixing process of the mute data to obtain the third audio data, the third audio data may be output to the SOC chip.
And step 207, the second audioFlinger receives the mute data and performs sound mixing processing on the mute data to obtain fourth audio data.
As an example, in this step, the mixing processing performed by the second AudioFlinger on the mute data is similar to the step 105, and reference may be made to the foregoing description on the step 105, which is not repeated herein.
It should be noted that the mixing strategy adopted by the second AudioFlinger may be set according to actual situations, and the present application does not specifically limit the strategy.
The second AudioFlinger writes the fourth audio data to the HAL, step 208.
As an example, after the second AudioFlinger completes the mixing process of the mute data to obtain the fourth audio data, the second AudioFlinger may call the out _ write function to write the fourth audio data into the HAL.
Step 209, when receiving the third audio data, the SOC chip performs audio mixing processing on the converted audio data and the received audio data in the first format to obtain fifth audio data.
As an example, in the process of decoding the audio data in the second format that needs to be decoded by the SOC chip, after the SOC chip completes decoding the audio data in the second format, the SOC chip performs audio mixing processing on the decoded audio data and the third audio data to obtain the fifth audio data.
As an example, after the SOC chip completes decoding of the audio data in the second format that needs to be decoded, if the third audio data transmitted by the first AudioFlinger is received, the SOC chip performs audio mixing processing on the decoded audio data and the third audio data to obtain a fifth audio.
In
In step 211, Tinyalsa outputs the fourth audio data to the external playing device for playing.
As an example, after Tinyalsa acquires the fourth audio data from the SOC chip, the fourth audio data may be output to an audio playing interface of the external playing device, so that the external playing device performs audio playing according to the fourth audio data received by the audio playing interface. In specific implementation, a data pool may be set between Tinyalsa and an audio playing interface of an external playing device, for buffering the fourth audio data, so as to avoid the fourth audio data from being lost due to blocking during transmission.
To this end, the description of how the display device plays the second format audio data is completed.
As a third situation, specifically, the display device needs to output the PCM audio data and the physical audio data to the external playing device for playing at the same time. With reference to the flow shown in fig. 3C, in this case, the audio playing method provided in this embodiment may be applied to the display device, and the display device may be equipped with an Android operating system. In conjunction with fig. 4D and 4B, the display device may include a display, a controller coupled to the display. The controller may be provided with at least: the system comprises a first audio track, a second audio track, an audio track, a first audio data entity, an audio flag and a second audio flag which are arranged between an audio data control module, a mute data control module and a System On Chip (SOC) chip, and Tinyals created when external playing equipment is started; tinyalsa runs in the HAL between the SOC chip and the external playback device.
Since the related contents in this embodiment have been described in the foregoing two embodiments, each step in this embodiment may refer to the description of the foregoing two embodiments, and will not be described again below.
As shown in fig. 3C, the process may include the following steps:
step 301, the SOC chip receives the audio data in the second format and converts the audio data in the second format into the audio data in the first format.
Step 302, when the SOC chip receives the audio data in the second format, the mute data control module constructs mute data in the first format
Step 303, the mute data control module outputs the mute data to the second AudioTrack.
Step 304, the second AudioTrack receives the mute data in the first format from the mute data control module, copies the mute data, and outputs the original mute data and the copied mute data to the first AudioFlinger and the second AudioFlinger, respectively.
At step 305, the audio data control module outputs audio data in a first format to the first AudioTrack.
Step 306, the first AudioTrack receives the audio data in the first format from the audio data control module, copies the audio data, and outputs the original audio data and the copied audio data to the first audioflasher and the second audioflasher, respectively.
Step 307, the first AudioFlinger receives the audio data and the mute data, and performs sound mixing processing on the audio data and the mute data to obtain ninth audio data.
And 308, the second audiomaker receives the audio data and the mute data, and performs sound mixing processing on the audio data and the mute data to obtain tenth audio data.
In step 309, the first AudioFlinger outputs the ninth audio data to the SOC chip.
The second AudioFlinger writes the tenth audio data to the HAL, step 310.
In step 311, the SOC chip receives the ninth audio data, and performs audio mixing processing on the ninth audio data and the audio data in the first format to obtain eleventh audio data.
At step 312, Tinyalsa acquires the eleventh audio data from the SOC chip when the HAL writes the tenth audio data.
And 313, outputting the eleventh audio data to an external playing device by Tinyalsa for playing.
To this end, the description of how the display device simultaneously plays the first format and the second format audio data is completed.
Besides the audio playing method described above, another audio playing method is provided in the embodiments of the present application. The audio playing method provided in this embodiment may also be divided into three different cases according to different formats of audio data to be played. Hereinafter, the different cases will be described separately.
As a first situation, the display device needs to output the audio data in the first format to the external playing device for playing. With reference to the flow shown in fig. 5A, in this case, the audio playing method provided in this embodiment may be applied to the display device, and the display device may be equipped with an Android operating system. In connection with fig. 6A and 6B, the display device may include a display, a controller coupled to the display. The controller may be provided with at least: and a third AudioTrack and a third audioFlinger which are arranged between the audio data control module and the SOC chip.
As shown in fig. 5A, the process may include the following steps:
in step 401, the third AudioTrack receives audio data in the first format from the audio data control module.
As an example, how the third AudioTrack is associated with the third AudioFlinger and how the AudioTrack transmits the audio data in the first format to the third AudioFlinger may refer to the foregoing description of step 101 and step 102, and will not be described herein again.
The third AudioTrack outputs audio data to the third AudioFlinger, step 402.
As an example, since the third AudioTrack in this embodiment only needs to transmit the audio data to the third AudioFlinger, the third AudioTrack in this embodiment does not need to operate in a duplexing mode, that is, the third AudioTrack does not need to copy the received audio data, and can directly transmit the audio data to the third AudioFlinger.
In step 403, the third AudioFlinger receives the audio data and performs audio mixing processing on the audio data to obtain sixth audio data.
As an example, in the present embodiment, the mixing process of the third AudioFlinger may refer to the description of step 103, which is not described herein again.
And step 404, the third audioFlinger outputs the sixth audio data to the external playing device for playing.
As an example, after the third AudioFlinger completes the audio mixing process to obtain the sixth audio data, the sixth audio data may be directly output to an audio playing interface of the external playing device, so that the external playing device performs audio playing according to the sixth audio data received by the audio playing interface.
To this end, the description of how the display device plays the audio data in the first format is completed.
As a second situation, the display device needs to output the audio data in the second format to the external playing device for playing. With reference to the flow shown in fig. 5B, in this case, the audio playing method provided in this embodiment may be applied to the display device, and the display device may be equipped with an Android operating system. In connection with fig. 6C and 6B, the display device may include a display, a controller coupled to the display. The controller may be provided with at least: a fourth AudioTrack and a third audioFlinger which are arranged between the mute data control module and the SOC chip and are associated with the mute data control module, and an audio mixer audioMixer and Tinyalsa which are created when an external playing device is started; the AudioMixer and Tinyalsa run in the HAL, between the SOC chip and the external playback device.
As shown in fig. 5B, the process may include the following steps:
in step 501, the SOC chip receives audio data in the second format and converts the audio data in the second format into audio data in the first format.
As an example, how the SOC chip receives the audio data in the second format and how to convert the audio data in the second format into the audio data in the first format in this step is already described in detail in step 201, and the related contents may refer to the description of step 201, which is not repeated herein.
Step 502, the mute data control module constructs mute data in the first format when the SOC chip receives the audio data in the second format.
As an example, how the mute data control module constructs the mute data in the first format is described in detail in the foregoing step 202, and the related content may refer to the description of the foregoing step 202, which is not described herein again.
In step 503, the mute data control module outputs the mute data to the fourth AudioTrack.
As one example, the fourth AudioTrack is the AudioTrack associated with the mute data control module.
In step 504, the fourth AudioTrack receives the mute data from the mute data control module, and outputs the mute data to the third AudioFlinger.
And 505, the third audioFlinger receives the mute data and performs sound mixing processing on the mute data to obtain seventh audio data.
The third AudioFlinger outputs the seventh audio data to the AudioMixer, step 506.
As an example, when the third AudioFlinger is created, the third AudioFlinger may be created based on an external playing device externally connected to the display device, and then the third AudioFlinger may output the mixed audio data to the HAL in the Android operating system, but since the audio mixer is additionally disposed in the HAL in this embodiment, the third AudioFlinger may output the mixed audio data to the AudioMixer in the HAL, and then the audio is processed by the AudioMixer and transmitted to the external playing device.
In step 507, Tinyalsa obtains the audio data in the first format from the SOC chip when the AudioMixer receives the seventh audio data.
As an example, Tinyalsa at the HAL may be driven to actively acquire audio data in the first format from the SOC chip when the seventh audio data is output to the AudioMixer. Specifically, after the seventh audio data is written into the AudioMixer, Tinyalsa may send a read request for reading the audio data in the first format to the SOC chip, where the read request carries a playing time length of the audio data to be read, and the playing time length is a playing time length of the seventh audio data, so as to read the audio data in the first format stored in the SOC chip.
Tinyalsa outputs the audio data in the first format to the AudioMixer, step 508.
In step 509, the AudioMixer receives the audio data in the first format and the seventh audio data output by Tinyalsa, and performs audio mixing processing on the audio data in the first format and the seventh audio data to obtain eighth audio data.
As an example, the present embodiment additionally provides an AudioMixer in the HAL for mixing audio data written in the HAL. When being created, the AudioMixer can be created based on an external playing device connected with the display device, so that the AudioMixer can output audio data obtained after audio mixing to the external playing device.
As an example, the mixing process performed by the AudioMixer may refer to the foregoing description of AudioFlinger, and will not be described herein again.
And step 510, the AudioMixer outputs the eighth audio data to an external playing device for playing.
To this end, the description of how the display device plays the audio data in the first format is completed.
As a third situation, specifically, the display device needs to output the audio data in the first format and the audio data in the second format to the external playing device for playing at the same time. With reference to the flow shown in fig. 5C, in this case, the audio playing method provided in this embodiment may be applied to the display device, and the display device may be equipped with an Android operating system. In connection with fig. 6D and 6B, the display device may include a display, a controller coupled to the display. The controller may be provided with at least: a third AudioTrack arranged between the audio data control module and the SOC chip, a fourth AudioTrack arranged between the mute data control module and the SOC chip and associated with the mute data control module, a third audioflag, an audio mixer and Tinyalsa created when the external playback device is started; the AudioMixer and Tinyalsa run in the HAL, between the SOC chip and the external playback device.
Since the related contents in this embodiment have been described in the foregoing two embodiments, each step in this embodiment may refer to the description of the foregoing two embodiments, and will not be described again below.
Referring to fig. 5C, the process may include the following steps:
step 601, the SOC chip receives the audio data in the second format and converts the audio data in the second format into the audio data in the first format.
In step 602, the mute data control module constructs mute data in the first format when the SOC chip receives audio data in the second format.
Step 603, the mute data control module outputs the mute data to the fourth AudioTrack.
In step 604, the fourth AudioTrack receives the mute data from the mute data control module, and outputs the mute data to the third AudioFlinger.
The third AudioTrack receives audio data in the first format from the audio data control module, step 605.
The third AudioTrack outputs the audio data to the third AudioFlinger, step 606.
Step 607, the third AudioFlinger receives the audio data and the mute data, and performs audio mixing processing on the audio data and the mute data to obtain twelfth audio data.
The third audioflasher outputs the twelfth audio data to the AudioMixer, step 608.
In step 609, Tinyalsa acquires the audio data in the first format from the SOC chip when the AudioMixer receives the twelfth audio data.
Tinyalsa outputs the audio data in the first format to the AudioMixer, step 610.
Step 611, the AudioMixer receives the audio data in the first format and the twelfth audio data output by Tinyalsa, and performs audio mixing processing on the audio data in the first format and the twelfth audio data to obtain thirteenth audio data.
Step 612, the AudioMixer outputs the thirteenth audio data to the external playing device for playing.
To this end, the description of how the display device plays the audio data in the first format and the second format is completed.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include such modifications and variations.
- 上一篇:一种医用注射器针头装配设备
- 下一篇:一种声音输出幅度的调整方法及显示设备