[go: up one dir, main page]

WO2017054378A1 - Audio data processing method, apparatus and system - Google Patents

Audio data processing method, apparatus and system Download PDF

Info

Publication number
WO2017054378A1
WO2017054378A1 PCT/CN2016/072032 CN2016072032W WO2017054378A1 WO 2017054378 A1 WO2017054378 A1 WO 2017054378A1 CN 2016072032 W CN2016072032 W CN 2016072032W WO 2017054378 A1 WO2017054378 A1 WO 2017054378A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio data
node
played
queue
buffer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2016/072032
Other languages
French (fr)
Chinese (zh)
Inventor
鲁忠辉
王强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Electric Co Ltd
Original Assignee
Hisense Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Electric Co Ltd filed Critical Hisense Electric Co Ltd
Publication of WO2017054378A1 publication Critical patent/WO2017054378A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB

Definitions

  • the present invention relates to the field of information processing technologies, and in particular, to a method, an apparatus, and a system for processing audio data.
  • the captured audio data is stored in a ring buffer manner in the prior art, and then the captured audio data is played.
  • a ring buffer is used to store audio data for storage
  • the write pointer reaches the tail address of the ring buffer, it immediately returns to the start address to continue capturing.
  • the unread audio data is covered by the newly captured data, and further The problem that caused the sound to spread.
  • each captured audio number is copied to another memory space (or a memory pool), and the audio data on the copied memory space is read and played.
  • the solution using the memory pool also introduces a series of other problems: a memory space needs to be opened for storing or backing up data separately, and frequent memory copying actions are also to some extent.
  • the system performance is reduced, the operation process is complicated, and the maintenance of each data in the newly opened memory space increases the complexity of the system design and is not easy to maintain.
  • Embodiments of the present invention provide a method, an apparatus, and a system for processing audio data. It is used to avoid the problem that the audio data to be played will not be overwritten while setting the memory pool.
  • an embodiment of the present invention provides a method for processing audio data, including:
  • the information control node to be configured of the unit data is unloaded from the first queue, and the unloaded information control node to be configured is configured, and the configured information control node includes the audio data to be played.
  • Attribute information the first queue includes at least one information control node to be configured;
  • Linking the configured information control node to the second queue and the third queue, the second queue and the third queue are both used to manage the configured information control node;
  • the attribute information of the to-be-played audio data in the node is controlled according to the unconfigured configured information, and the corresponding audio data to be played is read;
  • the offloaded configured information control node is linked to a fourth queue for managing an information control node that has played audio data.
  • an apparatus for processing audio data including:
  • a node unloading unit configured to: when the triggering instruction is received, uninstall the information control node of the unit data to be configured from the first queue, and configure the unconfigured information control node to be configured, and the configured information control node Attribute information including audio data to be played, the first queue includes at least one information control node to be configured;
  • a node linking unit configured to link the configured information control node to the second queue and the third queue, where the second queue and the third queue are both used to manage the configured information control node;
  • the node unloading unit is configured to uninstall the configured information control node of the unit data from the third queue;
  • a reading unit configured to control attribute information of the to-be-played audio data in the node according to the unconfigured configured information, and read corresponding audio data to be played;
  • the node linking unit is further configured to link the uninstalled configured information control node to a fourth queue, where the fourth queue is used to manage information of played audio data. Control node.
  • an embodiment of the present invention provides a processing system for audio data, including:
  • An input module configured to receive audio data input by multiple television channels
  • a path switching module for switching different television channels
  • An audio capture module for capturing audio data of different paths
  • the control reading module includes:
  • a node unloading unit configured to: when the triggering instruction is received, uninstall the information control node of the unit data to be configured from the first queue, and configure the unconfigured information control node to be configured, and the configured information control node Attribute information including audio data to be played, the first queue includes at least one information control node to be configured;
  • a node linking unit configured to link the configured information control node to the second queue and the third queue, where the second queue and the third queue are both used to manage the configured information control node;
  • the node unloading unit is configured to uninstall the configured information control node of the unit data from the third queue;
  • a reading unit configured to control attribute information of the to-be-played audio data in the node according to the unconfigured configured information, and read corresponding audio data to be played;
  • the node linking unit is further configured to link the uninstalled configured information control node to a fourth queue, where the fourth queue is used to manage an information control node that has played audio data;
  • the system further includes an audio post-processing module for performing preset sound processing on the audio data read by the reading unit;
  • an audio playing module configured to play audio data processed by the audio post-processing module.
  • An embodiment of the present invention provides a method, an apparatus, and a system for processing audio data.
  • a first queue for managing an information control node to be configured when the threshold interrupt is triggered, the unit data is unloaded from the first queue.
  • the information control node to be configured controls the unloaded information to be configured according to the audio data to be played captured when the threshold is interrupted.
  • the node is configured to link the configured information control node to the second queue and the third queue for managing the configured information control node, and when the third queue is not empty, the unit data is unloaded from the third queue.
  • the configured information control node controls the attribute information of the audio data to be played in the node according to the unconfigured configured information, plays the corresponding audio data to be played, and links the uninstalled configured information control node to the managed audio data.
  • the fourth queue of the information control node Through the form of the queue, the attribute information of the played audio data can be configured in real time, and the audio data to be played and the played audio data are separately managed, and at the same time, the node is controlled according to the configured information, and the corresponding audio data to be played is read. There is no need to copy the audio data to be played to another memory space as in the prior art, and read the problem caused by the audio data to be played on the copied memory space.
  • the audio data to be broadcasted is not covered, the development and use of the memory space used for backup is omitted, and the influence of frequent memory copy on system performance is eliminated, and the effect is eliminated.
  • the memory alignment action simplifies the operation process, circumvents the complexity of the memory pool implementation, management, and maintenance, and simplifies the design.
  • the embodiment of the present invention avoids setting the memory pool while preventing the audio data to be played from being overwritten. .
  • FIG. 1 is a schematic flowchart 1 of a method for processing audio data according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart 2 of a method for processing audio data according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart 3 of a method for processing audio data according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of a first buffer corresponding to WDMA according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram 1 of audio data between a read pointer and a write pointer in a first buffer according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram 2 of audio data between a read pointer and a write pointer in a first buffer according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of interaction between a third queue and a fourth queue according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a second buffer corresponding to WDMA according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram 1 of an apparatus for processing audio data according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram 2 of an apparatus for processing audio data according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram of a system for processing audio data according to an embodiment of the present invention.
  • An embodiment of the present invention provides a method for processing audio data, as shown in FIG. 1 , including:
  • Step 101 When receiving the triggering instruction, uninstall the information control node of the unit data to be configured from the first queue, and configure the unloaded information control node to be configured, where the configured information control node includes the audio data to be played. Attribute information.
  • the first queue is used to manage the information control node to be configured, and the first queue includes at least one information control node to be configured.
  • the queue is a special kind of linear table, which only allows the deletion operation at the front end of the table, and the insertion operation at the back end of the table.
  • the end that performs the insert operation is called the tail of the team, and the end that performs the delete operation is called the head of the team.
  • the queue is also called the "first in, first out" linear table. Queues can be stored using a linear table or stored in a linked list.
  • the embodiment of the present invention is exemplified in the case that the queue is stored by using a linked list.
  • the linked list is a non-contiguous, non-sequential storage structure on the physical storage unit, and the logical order of the data elements is implemented by the pointer linking order in the queue.
  • a linked list consists of a series of nodes (each element in the list is called a node (a node can also be called a node)), and the node can be dynamically generated at runtime.
  • each node consists of two parts: one is the data field in which the data element is stored (the domain name is data), and the other is the pointer field storing the next node address (the domain name is next), which is stored in the pointer field.
  • Information is also known as a pointer or chain.
  • the use of a linked list structure can make full use of the computer memory space to achieve flexible memory dynamic management.
  • the first queue in the embodiment of the present invention is used to manage the information control node to be configured.
  • N information control nodes may be allocated and inserted into the first queue by using the tail insertion method, where N is greater than or equal to 1.
  • the configured information control node includes attribute information of the audio data to be played. That is to say, the unloaded information control node is configured according to the corresponding to-be-played audio data when the triggering instruction is received, and the configured information control node includes the attribute information of the audio data to be played.
  • the triggering command may be a threshold interrupting instruction, or may be another operation capable of implementing the triggering action, so as to perform a subsequent step according to the triggering operation.
  • Step 102 Link the configured information control node to the second queue and the third queue.
  • the second queue and the third queue are both used to manage the configured information control node. For the second queue and the third queue, it can be set to null at initialization.
  • Step 103 Unload the configured information control node of the unit data from the third queue.
  • the configured information control node of the unit data is unloaded from the queue head of the third queue.
  • Step 104 Control audio data to be played in the node according to the configured information of the uninstallation.
  • the attribute information reads the corresponding audio data to be played.
  • Step 105 Link the uninstalled configured information control node to the fourth queue.
  • the fourth queue is used to manage the information control node of the played audio data.
  • the unit data to be configured is unloaded from the first queue.
  • the information control node configures the unloaded information control node to be unloaded according to the audio data to be played captured when the threshold is interrupted, and links the configured information control node to the second queue for managing the configured information control node and In the third queue, when the third queue is not empty, the configured information control node that unloads the unit data from the third queue controls the attribute information of the audio data to be played in the node according to the unconfigured configured information, and plays corresponding information.
  • the audio data to be played is then linked to the unloaded configured information control node to the fourth queue of the information control node managing the played audio data.
  • the attribute information of the played audio data can be configured in real time, and the audio data to be played and the played audio data are separately managed, and at the same time, the node is controlled according to the configured information, and the corresponding audio data to be played is read.
  • the audio data to be broadcasted is not covered, the development and use of the memory space used for backup is omitted, and the influence of frequent memory copy on system performance is eliminated, and the effect is eliminated.
  • the memory alignment action simplifies the operation process, circumvents the complexity of the memory pool implementation, management, and maintenance, and simplifies the design.
  • the embodiment of the present invention avoids setting the memory pool while preventing the audio data to be played from being overwritten. .
  • the embodiment of the present invention provides a specific implementation manner, as shown in FIG. 2, including:
  • Step 201 Set a first queue, a second queue, a third queue, and a fourth queue.
  • the first queue is used to manage the information control node to be configured
  • the second queue and the third queue are used to manage the configured information control node
  • the fourth queue is used to manage the information control node of the played audio data.
  • the first queue is called The tobe_pushed queue
  • the second queue is called the pushed queue
  • the third queue is called the tobe_played queue
  • the fourth queue is called the played queue.
  • N information control nodes are allocated, and are inserted into the tobe_pushed queue by the tail insertion method, N is greater than or equal to 1; the pushed queue, the tobe_played queue, and the played queue are initialized when empty.
  • the setting of the first queue, the second queue, the third queue, and the fourth queue may be set at the same time of initialization, or may be set when needed. At the same time, the setting is performed at the same time as the initialization.
  • Step 202 Capture the audio data to be played by using direct memory write WDMA.
  • the Write Direct Memory Access corresponds to the first buffer, and the first buffer includes a read pointer and a write pointer.
  • the first buffer is a Ring Buffer
  • the ring buffer includes a write pointer (wpt) and a read pointer (rpt).
  • Wpt indicates that the captured audio data is stored in the Ring Buffer
  • rpt indicates that the read audio data is stored in the Ring Buffer. Therefore, WDMA's audio capture and processing work is mainly done by its write pointer and read pointer. Among them, the write pointer is mainly maintained by the WDMA itself, and the read pointer is mainly controlled by the CPU.
  • FIG. 4 is a schematic diagram showing the logical relationship between wpt, rpt of WDMA and Ring Buffer maintained by the WDMA.
  • st_addr(start address) indicates the starting address (or the first address) of the Ring Buffer
  • end indicates the tail address of the Ring Buffer.
  • both wpt and rpt are 0, which is equivalent to the starting address of the corresponding Ring Buffer.
  • WDMA captures the audio data of the path in which it is located, the captured audio data is stored from the starting address of wpt.
  • the buffer is a ring buffer
  • wpt reaches the tail address of the Ring Buffer
  • Automatically jump to the first address of Ring Buffer continue to store audio data from the starting position of Ring Buffer, so that the storage space of captured audio data can be managed by Ring Buffer, which can effectively solve the problem of wasted memory space for capture.
  • the time limit of audio capture is also canceled, and audio capture with unlimited length of time is supported.
  • Step 203 Detect whether the difference between the write pointer and the read pointer in the first buffer is greater than Or equal to the first preset threshold.
  • the first preset threshold is smaller than the length of the first buffer.
  • the size of the first preset threshold may be set according to the length of the Ring Buffer. For example, if the length of the Ring Buffer is N*M, the first preset threshold may be set to M, that is, the first buffer corresponding to the WDMA is divided into N buffers of a first preset threshold length.
  • the same number (ie, N) of information control nodes can be allocated, and linked to the tobe_pushed queue by tail insertion.
  • Step 204 If it is detected that the difference between the write pointer and the read pointer in the first buffer is greater than or equal to the first preset threshold, triggering the threshold interrupt to generate a trigger instruction.
  • Step 205 Unload the information control node of the unit data to be configured from the first queue according to the triggering instruction, and configure the unloaded information control node to be configured.
  • step 205 specifically includes the following sub-steps:
  • the information control node to be configured mainly includes the following information: a path, such as ATV Demod, AV, Component, VGA or HDMI; number of channels, such as 8-channel, 6-channel, 2-channel, etc.; sampling rate, Such as 32Khz, 35.15625Khz, 48Khz, etc.; the starting address of the audio data to be played; the data length of the audio data to be played.
  • a path such as ATV Demod, AV, Component, VGA or HDMI
  • number of channels such as 8-channel, 6-channel, 2-channel, etc.
  • sampling rate Such as 32Khz, 35.15625Khz, 48Khz, etc.
  • the starting address of the audio data to be played the data length of the audio data to be played.
  • the data structure of the information control node to be configured can be defined as follows:
  • Int channel_num / / number of channels, such as 8 channels, 6 channels, 2 channels
  • the data structure of the information control node to be configured may be deleted or added according to the actual required information to meet the actual needs of the user.
  • the offloaded information control node Configure, according to the to-be-played audio data from the read pointer to the write pointer in the first buffer, the offloaded information control node to be configured.
  • the first buffer is a ring buffer
  • the write pointer is larger than the read pointer and the write pointer is smaller than the read pointer.
  • FIG. 5 is a case where the write pointer is larger than the read pointer
  • the audio data from the read pointer to the write pointer is [rpt, wpt].
  • the unloaded information control node is configured according to the to-be-played audio data from the read pointer to the write pointer in the first buffer, and the configured information control node includes the to-be-played Attribute information of audio data.
  • Step 206 Link the configured information control node to the second queue and the third queue.
  • the configured information control node includes the attribute information of the audio data to be played, that is, the configured information control node includes the corresponding start address of the audio data to be played, the length of the audio data to be played, and of course, the configured
  • the information control node can also include the path, sampling rate, number of channels, and the like.
  • the received configured information control node is chained to the tail of the queue and the tail of the tobe_played queue. among them, The tail of the queue that links the received configured information control node to the tobe_played queue is delivered through the deliver interface. At the same time, the configured information control node in the pushed queue still exists.
  • Step 207 Unload the configured information control node of the unit data from the third queue.
  • step 207 before performing step 207, first determine whether the tobe_played queue is empty. If it is empty, continue to the newly-configured information control node of the to-be-played audio data of the chain (as shown by new_tobe_played_data in FIG. 7). ) to the end of the tobe_played queue (shown as tobe_played_tail in Figure 7); if not empty, control the node from the configured information of the unchain unit data in the third queue, specifically from the queue header of the tobe_played queue (such as 7) Tobe_played_head shows the configured information control node of the unchain unit data.
  • the unit data is preferably an information control node, and the audio data to be played corresponding to the information control node may also be referred to as a piece of data.
  • Step 208 Configure, according to the uninstalled configured information control node, a configuration node in a second buffer corresponding to the direct memory read RDMA.
  • audio data from multiple channels may be stored in a first buffer (ie, an audio buffer), and audio data in the audio buffer belongs to audio data to be played.
  • RDMA Read Direct Memory Access
  • the RDMA is actually reading the DMA, and the DMA is convenient for communication between different hardware devices. Without relying on a large amount of interrupt load on the CPU.
  • the RDMA has a corresponding second buffer buffer, and the second buffer buffer includes a write pointer (wpt), a read pointer (rpt), and a plurality of configuration node items, each configuration node. Item has control information.
  • RDMA's audio data reading work is mainly controlled by its write pointer and read pointer.
  • the write pointer is mainly controlled by the CPU, and the read pointer is maintained by the RDMA itself.
  • an integrated circuit can implement its corresponding buffer buffer as a ring buffer, in which a ring A buffer is a data structure used to represent a fixed-size, head-to-tail buffer that is suitable for caching data streams.
  • a useful feature of a ring buffer is that its storage space can be recycled.
  • the ring buffer can be implemented as a configuration node item, and the item is mainly used to control RDMA to read audio data, wherein each item is composed of 64 bits, and the first 32 bits, That is, the first word is the start address parameter start address (abbreviated as st_addr), pointing to the physical address of the PCM audio data to be read by the RDMA to be stored in the memory; the second 32 bits, that is, the second word, mainly including the length parameter Length member, the length represents the length of the PCM audio data to be read.
  • the relationship between the RDMA write pointer, the read pointer, and the configuration node of the ring buffer is shown in Figure 8.
  • the read pointer points to the item that has been configured and is to be read in the ring buffer, and the write pointer points to the ring.
  • the number of items in the ring buffer is determined by the CPU, and the control information of each item's start address and lengh is also updated by the CPU in real time.
  • step 208 specifically includes the following sub-steps:
  • two ways can be used to determine the target item. One is to read the register corresponding to wpt, and the corresponding item information is stored in the register; the second is to implement the RDMA item (if 20) as a structure.
  • the body array through the index corresponding to the array wpt, can obtain the target item at the location of wpt.
  • the embodiment of the present invention configures the first word (ie, the starting address parameter) of the target configuration node item to point to the physical address of the DDR where the audio data to be broadcasted is located, and then
  • the second word of the item ie, the length parameter
  • the length can be a multiple of 128 bytes required by the hardware.
  • the read pointer has a readable item, thereby ensuring that the write is not fast (ie, the CPU configures the RDMA item and updates its wpt).
  • the slow read ie RDMA reads the specified address corresponding to the item, the specified length of data and updates its rpt
  • the problem can be calculated by the difference between the write pointer and the read pointer in the second buffer.
  • the unit data is unloaded from the third queue.
  • the configured information control node controls the node to configure the corresponding item according to the configured information of the uninstallation.
  • the difference between the write pointer and the read pointer in the second buffer may be greater than or equal to a fourth preset threshold, and the fourth preset threshold may be according to the second The number of the items in the buffer, the processing capacity of the CPU, and the like are set to meet the actual requirements.
  • the setting manner of the fourth preset threshold is not limited in the present invention.
  • Step 209 Control the attribute information of the audio data to be played in the node according to the unconfigured configured information, and read the corresponding audio data to be played.
  • step 209 includes the following sub-steps:
  • step 209a Since the second buffer corresponding to the RDMA is a ring buffer, step 209a includes:
  • step 209a2 is performed; if not, step 209a3 is performed.
  • RDMA since RDMA is implemented as a Ring Buffer, it can be determined whether the target item is the last item in the Ring Buffer. If the target item is the last item in the Ring Buffer, configure its wpt to be the RDMA start. Bit The location where the first item is placed. Otherwise, configure its wpt to be the location of the next next item of the target item.
  • the wpt of RDMA Since the wpt of RDMA is controlled by the CPU, its rpt is maintained by the hardware itself. After the target item is configured as described above, after the write pointer wpt is updated, when the difference between the updated wpt of the location and the rpt of the RDMA is greater than or equal to a second preset threshold (for example, 1 item), the RDMA automatically reads the rpt. Point to the audio data of the specified length in the memory location corresponding to the item, so that it can ensure that there is a configuration node that can be read at this time, and then read the audio data to be played corresponding to the configuration node pointed by the read pointer in the second buffer. .
  • a second preset threshold for example, 1 item
  • the fourth preset threshold may be set according to factors such as the number of items in the second buffer and the processing capability of the CPU. When the description is required, the fourth preset threshold may be the same as or different from the second preset threshold.
  • the RDMA of the embodiment of the present invention can also update the read pointer rpt, and automatically update the rpt to the position of the next item where the rpt is located. Since the RDMA buffer is a ring buffer, when its rpt goes to the end of the buffer, it will automatically ring to the start position of the buffer, and wpt needs software maintenance to the ring buffer header, thereby recycling the memory space.
  • Step 210 Link the uninstalled configured information control node to the fourth queue.
  • the node As shown in FIG. 7, after configuring the to-be-played audio data attribute information corresponding to the unconfigured configured information control node, the node (shown as new_played_data in FIG. 7) is chained to the queue end of the played queue (as shown in FIG. 7). 7 played_tail shown).
  • each threshold is interrupted, and the queue header from the tobe_pushed queue
  • the information control node to be configured in the unchain, and then establish control information for the audio data to be played between the [rpt, wpt] corresponding to the threshold interrupt (that is, the start address, length, sampling rate, and the like of the audio data to be played.
  • the information control node under the unbe_pushed queue unchain has the information, and the information corresponds to the audio data to be played that the interrupt is to be read, and then the shed queue receives (or docks) the information control node.
  • the interface controls the node to the backend, and the backend receives it and then chains it to the tail of the tobe_played queue (note that the information control node is not uninstalled from the pushed queue at this time) ), the backend RDMA starts to read data for the power amplifier, and needs to call the paly_item interface before playing.
  • the interface from the tobe_played queue header unchian information control node, and configures the attribute information of the audio data to be played carried by it to correspond to the RDMA. After the item of the second buffer, the information control node is chained to the end of the played queue.
  • the method further includes:
  • Step 211 Determine a location where the read pointer is located in the second buffer.
  • Step 212 Calculate a difference between the first marker pointer and the second marker pointer in the second buffer.
  • the first mark pointer points to a position where the last configuration node at the position where the read pointer is located in the second buffer, and the second mark pointer is the position where the first mark pointer is located when the last release.
  • Step 213 If the difference between the first marker pointer and the second marker pointer in the second buffer is greater than or equal to a third preset threshold, the fourth queue is configured with the first marker pointer and the second marker pointer.
  • the information of the played audio data corresponding to the configuration node controls the node to be unloaded.
  • the third preset threshold may be set according to the number of items in the second buffer, the processing capability of the CPU, and the like.
  • the method further includes:
  • Step 214 Unload and release the configured information control node corresponding to the played audio data in the second queue.
  • Step 215 Link the information control node that is unloaded and released in the second queue to the first queue.
  • the play_item interface is called, and by determining the first marker pointer and the second marker pointer, if the condition is satisfied, the played is determined. If the queue is not empty, if the played queue is not empty, the information control node corresponding to the broadcasted audio data is unchained from the played queue; at the same time, because the second queue includes the information control node corresponding to the played audio data.
  • the callback mechanism (the callback release interface, the interface is used to complete the operation of the information control node in the tobe_pushed queue and the pushed queue) controls the information corresponding to the played audio data in the pushed queue.
  • the node is unloaded and released (the release refers to clearing the configuration information in the information control node), and then it is linked to the tail of the queue of the tobe_pushed queue, so that a fixed number of information control nodes allocated at initialization can be circulated. Reuse of the purpose, to solve the system memory space waste and implement frequent distribution of letters The problem of excessive memory fragmentation caused by the control node avoids the waste of system resources.
  • the tobe_played queue receives the configured information control node passed by the deliver interface, the configured information control node is not uninstalled from the pushed queue because the configured information is configured at this time.
  • the control node is unloaded from the pushed queue and chained to the tobe_pushed queue. This means that the tobe_pushed queue can use this information to control the node to create audio data to be played on the new memory location.
  • the front end is in the backend tobe_played queue configuration information control node Before the attribute information of the audio data to be played is carried to the item of the RDMA, the information control node is reconfigured, and when the RDMA reads the data at the new location and plays, a problem of sound skipping occurs. Therefore, it is ensured that the audio data on the DDR corresponding to the information control node has been played, and then unloaded from the pushed queue, and chained to the tail of the tobe_pushed queue.
  • the method further includes:
  • the second channel in the embodiment of the present invention is different from the first channel, and when detecting the switch from the first channel to the second channel, unloads and releases the remaining configured information control nodes in the third queue. Specifically, because the audio data allocated before the path switching corresponds to the audio data in the previous path, and the audio data of the path that is newly switched to the path switching is completed, the tobe_played queue head is first unchained. A node, if there is still audio data of the last channel that is not released on the queue, the audio data will be first configured to the RDMA item, so that the RDMA will read the audio data corresponding to the items first, and then play the new real-time configuration. Audio data for the path.
  • each time the path is switched each item that is not configured to the RDMA from the queue head to the tail of the queue on the tobe_played queue, that is, the configured information control node corresponding to the remaining unplayed audio data may be configured.
  • Unloading and releasing in order to solve the problem of switching the channel, first play the audio data remaining in the previous channel and then play the audio data of the newly switched path.
  • the unloading and releasing actions are very fast, and are calculated in milliseconds.
  • the embodiment of the present invention provides a method for processing audio data.
  • a first queue for managing an information control node to be configured when the threshold interrupt is triggered, the information to be configured of the unit data is unloaded from the first queue.
  • the configured information control node that unloads the unit data from the third queue controls the attribute information of the audio data to be played in the node according to the configured information of the uninstallation, and plays the corresponding to-be-played
  • the audio data is played, and the unloaded configured information control node is linked to the fourth queue of the information control node that manages the played audio data.
  • the attribute information of the audio data is configured, and the audio data to be played and the audio data to be played are separately managed, and at the same time, the node is controlled according to the configured information, and the corresponding audio data to be played is read, without the prior art
  • the audio data to be played is copied to another memory space, and the problem caused by the audio data to be played on the copied memory space is read.
  • the audio data to be broadcasted is not covered, the development and use of the memory space used for backup is omitted, and the influence of frequent memory copy on system performance is eliminated, and the effect is eliminated.
  • the memory alignment action simplifies the operation process, circumvents the complexity of the memory pool implementation, management, and maintenance, and simplifies the design.
  • the embodiment of the present invention avoids setting the memory pool while preventing the audio data to be played from being overwritten. .
  • the embodiment of the present invention provides an apparatus for processing audio data.
  • the function units of the audio data processing apparatus perform the corresponding method steps in the first embodiment or the second embodiment. For details, refer to the first embodiment or the second embodiment. The description is not repeated here.
  • the audio data capturing apparatus 110 includes:
  • the node unloading unit 1101 is configured to: when the triggering instruction is received, uninstall the information control node to be configured of the unit data from the first queue, and configure the uninstalled information control node to be configured, where the configured information control node includes The attribute information of the audio data to be played, the first queue includes at least one information control node to be configured;
  • a node linking unit 1102 configured to link the configured information control node to the second queue and the third queue, where the second queue and the third queue are both used to manage the configured information control node;
  • a node unloading unit 1101, configured to uninstall the configured information control node of the unit data from the third queue
  • the reading unit 1103 is configured to control attribute information of the audio data to be played in the node according to the unconfigured configured information, and read corresponding audio data to be played;
  • the node linking unit 1102 is further configured to link the uninstalled configured information control node to the fourth queue, and the fourth queue is used to manage the information control node of the played audio data.
  • the device 110 further includes:
  • the capturing unit 1104 is configured to capture a to-be-played tone by using a direct memory write WDMA Frequency data, wherein the WDMA corresponds to the first buffer, and the first buffer includes a read pointer and a write pointer;
  • the detecting unit 1105 is configured to detect whether a difference between the write pointer and the read pointer in the first buffer is greater than or equal to a first preset threshold
  • the triggering unit 1106 is configured to trigger a threshold interrupt to generate a trigger instruction if a difference between the write pointer and the read pointer in the first buffer is greater than or equal to a first preset threshold.
  • the device 110 further includes: a first configuration unit 1107;
  • the node unloading unit 1101 is specifically configured to: according to the triggering instruction, uninstall the information control node to be configured of the unit data from the first queue;
  • the first configuration unit 1107 is specifically configured to configure the offloaded information control node to be configured according to the audio data to be played between the read pointer and the write pointer in the first buffer.
  • the first configuration unit 1107 is configured to configure a starting address of the audio data to be played and a length of the audio data to be played in the unloaded information control node to be configured.
  • the apparatus 110 further includes: a second configuration node 1108;
  • a second configuration unit 1108, configured to, according to the unconfigured configured information control node, configure a configuration node in a second buffer corresponding to the direct memory read RDMA, where the second buffer includes a read pointer, a write pointer, and Multiple configuration nodes, configuration nodes have configuration information.
  • the attribute information of the audio data to be played includes a start address of the audio data to be played, and a length of the audio data to be played, where the configuration information includes a start address parameter of the configuration node, and a corresponding length parameter;
  • the second configuration unit 1108 includes:
  • a configuration subunit 1108b configured to set a start address parameter of the target configuration node to a start address of audio data to be played
  • the configuration subunit 1108b is further configured to set the length parameter of the target configuration node to the data length of the audio data to be played.
  • the reading unit 1103 includes:
  • the calculating subunit 1103b is configured to calculate a difference between the write pointer and the read pointer in the second buffer
  • the reading subunit 1103c is configured to: if the difference between the write pointer and the read pointer in the second buffer is greater than or equal to a second preset threshold, read a corresponding configuration node pointed by the read pointer in the second buffer Audio data to be played.
  • the update subunit 1103a is specifically configured to:
  • the write pointer in the second buffer is configured to be the location of the next configuration node immediately adjacent to the target configuration node in the second buffer.
  • the apparatus 110 further includes: a determining unit 1109 and a calculating unit 1110;
  • a determining unit 1109 configured to determine a location of the read pointer in the second buffer
  • the calculating unit 1110 is configured to determine a difference between the first mark pointer and the second mark pointer in the second buffer, where the first mark pointer points to a position of a previous configuration node where the read pointer in the second buffer is located, The second mark pointer is the position where the first mark pointer is located when the last release;
  • the node unloading unit 1101 is further configured to: if the calculating unit 1110 calculates that the difference between the first marker pointer and the second marker pointer in the second buffer is greater than or equal to a third preset threshold, then the fourth queue and the first marker pointer The information of the played audio data corresponding to the configured configuration node between the second marker pointer and the control node is unloaded.
  • the node unloading unit 1101 is further configured to uninstall and release the configured information control node corresponding to the played audio data in the second queue;
  • the node linking unit 1102 is further configured to link the information control node that is unloaded and released in the second queue to the first queue.
  • the audio data to be played is the audio data of the first path
  • a detecting unit 1105 configured to detect whether to switch from the first path to the second path
  • the node unloading unit 1102 is further configured to: if the detecting unit 1105 detects the switch from the first path to the second path, uninstall and release the configured information control nodes remaining in the third queue.
  • the embodiment of the present invention provides an apparatus for processing audio data, by setting a first queue for managing an information control node to be configured, and when the threshold interrupt is triggered, the information to be configured of the unit data is unloaded from the first queue. Controlling the node, and configuring the unloaded information control node to be unloaded according to the to-be-played audio data captured when the threshold is interrupted, linking the configured information control node to the second queue and the second queue for managing the configured information control node In the three queues, when the third queue is not empty, the configured information control node that unloads the unit data from the third queue controls the attribute information of the audio data to be played in the node according to the configured information of the uninstallation, and plays the corresponding to-be-played The audio data is played, and the unloaded configured information control node is linked to the fourth queue of the information control node that manages the played audio data.
  • the attribute information of the played audio data can be configured in real time, and the audio data to be played and the played audio data are separately managed, and at the same time, the node is controlled according to the configured information, and the corresponding audio data to be played is read.
  • the audio data to be broadcasted is not covered, the development and use of the memory space used for backup is omitted, and the influence of frequent memory copy on system performance is eliminated, and the effect is eliminated.
  • the memory alignment action simplifies the operation process, circumvents the complexity of the memory pool implementation, management, and maintenance, and simplifies the design.
  • the embodiment of the present invention avoids setting the memory pool while preventing the audio data to be played from being overwritten. .
  • the embodiment of the present invention further provides a processing system for audio data.
  • the system 160 includes:
  • the input module 1601 is configured to receive audio data input by multiple television channels
  • a path switching module 1602 configured to switch between different television channels
  • An audio capture module 1603, configured to capture audio data of different paths
  • a buffer 1604, configured to cache audio data captured by the audio capture module 1603;
  • Controlling the reading module 1605 for controlling the audio data in the read buffer 1604;
  • the control reading module 1605 includes:
  • a node unloading unit configured to: when the triggering instruction is received, unload the information control node to be configured of the unit data from the first queue, and configure the offloaded information control node to be configured, where the configured information control node includes Playing attribute information of the audio data, where the first queue includes at least one information control node to be configured;
  • a node linking unit configured to link the configured information control node to the second queue and the third queue, where the second queue and the third queue are used to manage the configured information control node;
  • a node unloading unit configured to unload unit data from the third queue
  • a reading unit configured to control attribute information of the to-be-played audio data in the node according to the unconfigured configured information, and read corresponding audio data to be played;
  • a node linking unit configured to link the uninstalled configured information control node to the fourth queue, where the fourth queue is used to manage the information control node of the played audio data
  • the system 160 further includes an audio post-processing module 1606 for performing preset sound processing on the audio data read by the reading unit;
  • the audio playing module 1607 is configured to play the audio data processed by the audio post-processing module 1606.
  • the system 160 further includes: a file storage module 1608; wherein the file storage module 1608 is configured to store audio data captured by the audio capture module 1603 in a file;
  • the audio play module 1607 is also used to play the audio data stored in the file storage module 1608.
  • control reading module 1605 For the description of the control reading module 1605, reference may be made to the processing device for the audio data in the first embodiment to the third embodiment, and details are not described herein again.
  • the input module 1601 is an input source of audio data, including ATV Demod, AV, Component, VGA, HDMI, and the like;
  • the path switching module 1602 is responsible for switching the above-mentioned television channels and opening and cutting Changed TV channel;
  • the audio capture module 1603 is responsible for capturing audio data in each television channel.
  • the module is mainly implemented by a CPU to control WDMA, including an audio buffer, and the audio buffer is a memory area for temporarily storing the captured audio data;
  • the file storage module 1608 stores the audio data on the switched TV channel captured by the audio capture module 1603 in a file in real time, and the audio data can be used as the boot music of the television product, or can be used as a local audio through a network or a USB interface. During playback, the correctness of the audio data captured by the audio capture module can be verified by the sensory verification process. In addition, it can also be used as a hardware and hardware developer to implement related audio post-processing functions (for example, sample rate conversion (English: Sample Rate Convert) test source;
  • the control reading module 1605 reads the audio data from the audio buffer to the audio signal line via the AXI (Advanced eXtensible Interface) high-speed bus, and the module is mainly controlled by the CPU to control the RDMA, and reads the audio data captured by the audio capture module, and Passing it to the audio post-processing module 1606 through the audio data transmission line;
  • AXI Advanced eXtensible Interface
  • the audio post-processing module 1606 is configured to perform a series of sound effects processing on the audio data read by the control reading module 1605, such as AVC (Automatic Volume Control), SRC, EQ (Equalizer), Balance (balance). )Wait;
  • the audio playing module 1607 outputs the audio data processed by the audio post-processing unit 1606 or the audio data stored by the file storage module 1608 via a speaker, earphone, Spdif or Subwoofer.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the software functional units described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform portions of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, and the program code can be stored. Medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

Provided are an audio data processing method, apparatus and system, which relate to the technical field of information processing, and are used for avoiding the problem that audio data to be played cannot be overwritten while a memory pool is provided. The audio data processing method comprises: when a trigger instruction is received, unloading an information control node to be configured of unit data from a first queue, and configuring the unloaded information control node to be configured, wherein the configured information control node contains attribute information about audio data to be played; linking the configured information control node into a second queue and a third queue; unloading the configured information control node of the unit data from the third queue; according to the attribute information about the audio data to be played in the unloaded configured information control node, reading the corresponding audio data to be played; and linking the unloaded configured information control node into a fourth queue. The present invention is applied to digital television systems.

Description

一种音频数据的处理方法、装置和系统Method, device and system for processing audio data

本申请要求于2015年09月28日提交中国专利局、申请号为201510631096.6、发明名称为“一种音频数据的处理方法、装置和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201510631096.6, entitled "A Processing Method, Apparatus and System for Audio Data" by the Chinese Patent Office on September 28, 2015, the entire contents of which are incorporated by reference. In this application.

技术领域Technical field

本发明涉及信息处理技术领域,特别是涉及一种音频数据的处理方法、装置和系统。The present invention relates to the field of information processing technologies, and in particular, to a method, an apparatus, and a system for processing audio data.

背景技术Background technique

在数字电视系统领域中,为了实现音频数据的正常播放,现有技术中采用环形缓冲区的方式对捕获的音频数据进行存储,然后对捕获到的音频数据进行播放。但是,在采用环形缓冲区对待播放音频数据进行存储时,当写指针达到环形缓冲区的尾地址时,会立即返回到起始地址继续捕获。同时,由于捕获和读取是并行执行的,因此,若先前缓冲区起始地址的音频数据没有被及时读取播放,会造成未被读取的音频数据被新捕获的数据覆盖的情况,进而导致声音跳播的问题。In the field of digital television systems, in order to realize normal playback of audio data, the captured audio data is stored in a ring buffer manner in the prior art, and then the captured audio data is played. However, when a ring buffer is used to store audio data for storage, when the write pointer reaches the tail address of the ring buffer, it immediately returns to the start address to continue capturing. At the same time, since the capture and the reading are performed in parallel, if the audio data of the previous buffer start address is not read and played in time, the unread audio data is covered by the newly captured data, and further The problem that caused the sound to spread.

为了避免上述情况,现有方案中会将每笔捕获到的音频数拷贝到另外一块内存空间(或内存池)上,通过读取拷贝后的内存空间上的音频数据进行播放。虽然上述方案解决了音频数据被覆盖的问题,但采用内存池的方案也引入一系列的其他问题:需要再开辟一块内存空间以供单独存储或备份数据,频繁的内存拷贝动作也会在一定程度上降低系统性能,复杂了操作流程,同时,对新开辟的内存空间上的每笔数据的维护,会增加系统设计的复杂度,不易于后期维护。In order to avoid the above situation, in the existing scheme, each captured audio number is copied to another memory space (or a memory pool), and the audio data on the copied memory space is read and played. Although the above solution solves the problem of audio data being overwritten, the solution using the memory pool also introduces a series of other problems: a memory space needs to be opened for storing or backing up data separately, and frequent memory copying actions are also to some extent. The system performance is reduced, the operation process is complicated, and the maintenance of each data in the newly opened memory space increases the complexity of the system design and is not easy to maintain.

发明内容Summary of the invention

本发明实施例提供了一种音频数据的处理方法、装置和系统, 用于避免设置内存池的同时实现待播放音频数据不会被覆盖的问题。Embodiments of the present invention provide a method, an apparatus, and a system for processing audio data. It is used to avoid the problem that the audio data to be played will not be overwritten while setting the memory pool.

第一方面,本发明实施例提供了一种音频数据的处理方法,包括:In a first aspect, an embodiment of the present invention provides a method for processing audio data, including:

当接收到触发指令时,从第一队列中卸载单位数据的待配置的信息控制节点,并对所述卸载的待配置的信息控制节点进行配置,已配置的信息控制节点包含待播放音频数据的属性信息,所述第一队列中包含至少一个待配置的信息控制节点;When the triggering instruction is received, the information control node to be configured of the unit data is unloaded from the first queue, and the unloaded information control node to be configured is configured, and the configured information control node includes the audio data to be played. Attribute information, the first queue includes at least one information control node to be configured;

将所述已配置的信息控制节点链接到第二队列和第三队列中,所述第二队列和所述第三队列均用于管理已配置的信息控制节点;Linking the configured information control node to the second queue and the third queue, the second queue and the third queue are both used to manage the configured information control node;

从所述第三队列中卸载单位数据的已配置的信息控制节点;Unconfiguring the configured information control node of the unit data from the third queue;

根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,读取对应的待播放音频数据;The attribute information of the to-be-played audio data in the node is controlled according to the unconfigured configured information, and the corresponding audio data to be played is read;

将所述卸载的已配置的信息控制节点链接到第四队列,所述第四队列用于管理已播放音频数据的信息控制节点。The offloaded configured information control node is linked to a fourth queue for managing an information control node that has played audio data.

第二方面,本发明实施例提供了一种音频数据的处理装置,包括:In a second aspect, an embodiment of the present invention provides an apparatus for processing audio data, including:

节点卸载单元,用于当接收到触发指令时,从第一队列中卸载单位数据的待配置的信息控制节点,并对所述卸载的待配置的信息控制节点进行配置,已配置的信息控制节点包含待播放音频数据的属性信息,所述第一队列中包含至少一个待配置的信息控制节点;a node unloading unit, configured to: when the triggering instruction is received, uninstall the information control node of the unit data to be configured from the first queue, and configure the unconfigured information control node to be configured, and the configured information control node Attribute information including audio data to be played, the first queue includes at least one information control node to be configured;

节点链接单元,用于将所述已配置的信息控制节点链接到第二队列和第三队列中,所述第二队列和所述第三队列均用于管理已配置的信息控制节点;a node linking unit, configured to link the configured information control node to the second queue and the third queue, where the second queue and the third queue are both used to manage the configured information control node;

所述节点卸载单元,用于从所述第三队列中卸载单位数据的已配置的信息控制节点;The node unloading unit is configured to uninstall the configured information control node of the unit data from the third queue;

读取单元,用于根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,读取对应的待播放音频数据;a reading unit, configured to control attribute information of the to-be-played audio data in the node according to the unconfigured configured information, and read corresponding audio data to be played;

所述节点链接单元,还用于将所述卸载的已配置的信息控制节点链接到第四队列,所述第四队列用于管理已播放音频数据的信息 控制节点。The node linking unit is further configured to link the uninstalled configured information control node to a fourth queue, where the fourth queue is used to manage information of played audio data. Control node.

第三方面,本发明实施例提供了一种音频数据的处理系统,包括:In a third aspect, an embodiment of the present invention provides a processing system for audio data, including:

输入模块,用于接收多个电视通路输入的音频数据;An input module, configured to receive audio data input by multiple television channels;

通路切换模块,用于切换不同的电视通路;a path switching module for switching different television channels;

音频捕获模块,用于捕获不同通路的音频数据;An audio capture module for capturing audio data of different paths;

缓冲区,用于缓存所述音频捕获模块捕获的音频数据;以及,a buffer for buffering audio data captured by the audio capture module;

控制读取模块,用于控制读取所述缓冲区中的音频数据;Controlling a reading module for controlling reading of audio data in the buffer;

其中,所述控制读取模块包括:The control reading module includes:

节点卸载单元,用于当接收到触发指令时,从第一队列中卸载单位数据的待配置的信息控制节点,并对所述卸载的待配置的信息控制节点进行配置,已配置的信息控制节点包含待播放音频数据的属性信息,所述第一队列中包含至少一个待配置的信息控制节点;a node unloading unit, configured to: when the triggering instruction is received, uninstall the information control node of the unit data to be configured from the first queue, and configure the unconfigured information control node to be configured, and the configured information control node Attribute information including audio data to be played, the first queue includes at least one information control node to be configured;

节点链接单元,用于将所述已配置的信息控制节点链接到第二队列和第三队列中,所述第二队列和所述第三队列均用于管理已配置的信息控制节点;a node linking unit, configured to link the configured information control node to the second queue and the third queue, where the second queue and the third queue are both used to manage the configured information control node;

所述节点卸载单元,用于从所述第三队列中卸载单位数据的已配置的信息控制节点;The node unloading unit is configured to uninstall the configured information control node of the unit data from the third queue;

读取单元,用于根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,读取对应的待播放音频数据;a reading unit, configured to control attribute information of the to-be-played audio data in the node according to the unconfigured configured information, and read corresponding audio data to be played;

所述节点链接单元,还用于将所述卸载的已配置的信息控制节点链接到第四队列,所述第四队列用于管理已播放音频数据的信息控制节点;The node linking unit is further configured to link the uninstalled configured information control node to a fourth queue, where the fourth queue is used to manage an information control node that has played audio data;

所述系统还包括音频后处理模块,用于对所述读取单元读取的音频数据进行预设音效处理;以及The system further includes an audio post-processing module for performing preset sound processing on the audio data read by the reading unit;

音频播放模块,用于播放所述音频后处理模块处理的音频数据。And an audio playing module, configured to play audio data processed by the audio post-processing module.

本发明实施例提供了一种音频数据的处理方法、装置和系统,通过设定用于管理待配置的信息控制节点的第一队列,当阈值中断触发时,从第一队列中卸载单位数据的待配置的信息控制节点,并根据阈值中断时捕获的待播放音频数据对卸载的待配置的信息控制 节点进行配置,将已配置的信息控制节点链接到用于管理已配置的信息控制节点的第二队列和第三队列中,在第三队列非空时,从第三队列中卸载单位数据的已配置的信息控制节点,根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,播放对应的待播放音频数据,进而将卸载的已配置的信息控制节点链接到管理已播放音频数据的信息控制节点的第四队列中。通过队列的形式,可以实时地对待播放音频数据的属性信息进行配置,并对待播放音频数据和已播放音频数据分别进行管理,同时,根据已配置的信息控制节点,读取相应的待播放音频数据,无需像现有技术那样,将待播放音频数据拷贝到另外一块内存空间上,读取拷贝后的内存空间上的待播放音频数据所带来的问题。采用本发明实施例所述的技术方案,在待播音频数据不会被覆盖的同时,省去之前备份用的内存空间的开辟和使用,剔除频繁的内存拷贝对系统性能的影响,省去了内存对齐动作进而简化操作流程,规避复杂的内存池实现、管理及后期维护的开销,简化了设计思路,即本发明实施例在避免设置内存池的同时实现待播放音频数据不会被覆盖的问题。An embodiment of the present invention provides a method, an apparatus, and a system for processing audio data. By setting a first queue for managing an information control node to be configured, when the threshold interrupt is triggered, the unit data is unloaded from the first queue. The information control node to be configured controls the unloaded information to be configured according to the audio data to be played captured when the threshold is interrupted. The node is configured to link the configured information control node to the second queue and the third queue for managing the configured information control node, and when the third queue is not empty, the unit data is unloaded from the third queue. The configured information control node controls the attribute information of the audio data to be played in the node according to the unconfigured configured information, plays the corresponding audio data to be played, and links the uninstalled configured information control node to the managed audio data. The fourth queue of the information control node. Through the form of the queue, the attribute information of the played audio data can be configured in real time, and the audio data to be played and the played audio data are separately managed, and at the same time, the node is controlled according to the configured information, and the corresponding audio data to be played is read. There is no need to copy the audio data to be played to another memory space as in the prior art, and read the problem caused by the audio data to be played on the copied memory space. By adopting the technical solution described in the embodiment of the present invention, the audio data to be broadcasted is not covered, the development and use of the memory space used for backup is omitted, and the influence of frequent memory copy on system performance is eliminated, and the effect is eliminated. The memory alignment action simplifies the operation process, circumvents the complexity of the memory pool implementation, management, and maintenance, and simplifies the design. The embodiment of the present invention avoids setting the memory pool while preventing the audio data to be played from being overwritten. .

附图说明DRAWINGS

为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图做简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only some of the present invention. For the embodiments, those skilled in the art can obtain other drawings according to the drawings without any creative work.

图1为本发明实施例提供的一种音频数据的处理方法的流程示意图一;1 is a schematic flowchart 1 of a method for processing audio data according to an embodiment of the present invention;

图2为本发明实施例提供的一种音频数据的处理方法的流程示意图二;2 is a schematic flowchart 2 of a method for processing audio data according to an embodiment of the present invention;

图3为本发明实施例提供的一种音频数据的处理方法的流程示意图三;FIG. 3 is a schematic flowchart 3 of a method for processing audio data according to an embodiment of the present disclosure;

图4为本发明实施例提供的与WDMA对应的第一缓冲区的示意图; 4 is a schematic diagram of a first buffer corresponding to WDMA according to an embodiment of the present invention;

图5为本发明实施例提供的第一缓冲区中读指针和写指针之间音频数据的示意图一;5 is a schematic diagram 1 of audio data between a read pointer and a write pointer in a first buffer according to an embodiment of the present invention;

图6为本发明实施例提供的第一缓冲区中读指针和写指针之间音频数据的示意图二;6 is a schematic diagram 2 of audio data between a read pointer and a write pointer in a first buffer according to an embodiment of the present invention;

图7为本发明实施例提供的第三队列和第四队列的交互示意图;FIG. 7 is a schematic diagram of interaction between a third queue and a fourth queue according to an embodiment of the present invention;

图8为本发明实施例提供的与WDMA对应的第二缓冲区的示意图;FIG. 8 is a schematic diagram of a second buffer corresponding to WDMA according to an embodiment of the present disclosure;

图9为本发明实施例提供的一种音频数据的处理装置的结构示意图一;FIG. 9 is a schematic structural diagram 1 of an apparatus for processing audio data according to an embodiment of the present disclosure;

图10为本发明实施例提供的一种音频数据的处理装置的结构示意图二;FIG. 10 is a schematic structural diagram 2 of an apparatus for processing audio data according to an embodiment of the present disclosure;

图11为本发明实施例提供的一种音频数据的处理系统的结构示意图。FIG. 11 is a schematic structural diagram of a system for processing audio data according to an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.

实施例一Embodiment 1

本发明实施例提供了一种音频数据的处理方法,如图1所示,包括:An embodiment of the present invention provides a method for processing audio data, as shown in FIG. 1 , including:

步骤101、当接收到触发指令时,从第一队列中卸载单位数据的待配置的信息控制节点,并对卸载的待配置的信息控制节点进行配置,已配置的信息控制节点包含待播放音频数据的属性信息。Step 101: When receiving the triggering instruction, uninstall the information control node of the unit data to be configured from the first queue, and configure the unloaded information control node to be configured, where the configured information control node includes the audio data to be played. Attribute information.

其中,第一队列用于管理待配置的信息控制节点,第一队列中包含至少一个待配置的信息控制节点。The first queue is used to manage the information control node to be configured, and the first queue includes at least one information control node to be configured.

具体的,队列是一种特殊的线性表,它只允许在表的前端进行删除操作,在表的后端进行插入操作。进行插入操作的端称为队尾,进行删除操作的端称为队头。队列中没有元素时,称为空队列。在 队列这种数据结构中,最先插入的元素将是最先被删除的元素,反之最后插入的元素将是最后被删除的元素,因此,队列又被称为“先进先出”的线性表。队列的存储方式可以使用线性表进行存储,也可以使用链表进行存储。本发明实施例以队列采用链表进行存储进行示例性说明。其中,链表是一种物理存储单元上非连续、非顺序的存储结构,数据元素的逻辑顺序是通过队列中的指针链接次序实现的。链表由一系列结点(链表中每一个元素称为结点(结点也可以称为节点))组成,结点可以在运行时动态生成。通常,每个结点包括两个部分:一个是存储数据元素的数据域(设域名为data),另一个是存储下一个结点地址的指针域(设域名为next),指针域中存储的信息又称为指针或链。使用链表结构可以充分利用计算机内存空间,实现灵活的内存动态管理。Specifically, the queue is a special kind of linear table, which only allows the deletion operation at the front end of the table, and the insertion operation at the back end of the table. The end that performs the insert operation is called the tail of the team, and the end that performs the delete operation is called the head of the team. When there are no elements in the queue, it is called an empty queue. In In the data structure of the queue, the first element to be inserted will be the first element to be deleted, and the last element to be inserted will be the last element to be deleted. Therefore, the queue is also called the "first in, first out" linear table. Queues can be stored using a linear table or stored in a linked list. The embodiment of the present invention is exemplified in the case that the queue is stored by using a linked list. The linked list is a non-contiguous, non-sequential storage structure on the physical storage unit, and the logical order of the data elements is implemented by the pointer linking order in the queue. A linked list consists of a series of nodes (each element in the list is called a node (a node can also be called a node)), and the node can be dynamically generated at runtime. Usually, each node consists of two parts: one is the data field in which the data element is stored (the domain name is data), and the other is the pointer field storing the next node address (the domain name is next), which is stored in the pointer field. Information is also known as a pointer or chain. The use of a linked list structure can make full use of the computer memory space to achieve flexible memory dynamic management.

本发明实施例中的第一队列用于管理待配置的信息控制节点,初始化时,可以分配N个信息控制节点,通过尾插法插入到第一队列中,N大于等于1。The first queue in the embodiment of the present invention is used to manage the information control node to be configured. When initializing, N information control nodes may be allocated and inserted into the first queue by using the tail insertion method, where N is greater than or equal to 1.

另外,在步骤101中,已配置的信息控制节点中包含待播放音频数据的属性信息。也就是说,根据接收到触发指令时对应的待播放音频数据,对卸载的待配置的信息控制节点进行配置,配置后的信息控制节点中包含待播放音频数据的属性信息。需要说明的是,上述触发指令可以是阈值中断指令,也可以是其他能够实现上述触发动作的操作,以便根据该触发操作执行后续步骤。In addition, in step 101, the configured information control node includes attribute information of the audio data to be played. That is to say, the unloaded information control node is configured according to the corresponding to-be-played audio data when the triggering instruction is received, and the configured information control node includes the attribute information of the audio data to be played. It should be noted that the triggering command may be a threshold interrupting instruction, or may be another operation capable of implementing the triggering action, so as to perform a subsequent step according to the triggering operation.

步骤102、将已配置的信息控制节点链接到第二队列和第三队列中。Step 102: Link the configured information control node to the second queue and the third queue.

其中,第二队列和第三队列均用于管理已配置的信息控制节点。对于第二队列和第三队列可以在初始化时设置为空。The second queue and the third queue are both used to manage the configured information control node. For the second queue and the third queue, it can be set to null at initialization.

步骤103、从第三队列中卸载单位数据的已配置的信息控制节点。Step 103: Unload the configured information control node of the unit data from the third queue.

在具体实现中,在第三队列非空时,从第三队列的队列头卸载单位数据的已配置的信息控制节点。In a specific implementation, when the third queue is not empty, the configured information control node of the unit data is unloaded from the queue head of the third queue.

步骤104、根据卸载的已配置的信息控制节点中待播放音频数据 的属性信息,读取对应的待播放音频数据。Step 104: Control audio data to be played in the node according to the configured information of the uninstallation. The attribute information reads the corresponding audio data to be played.

步骤105、将卸载的已配置的信息控制节点链接到第四队列。Step 105: Link the uninstalled configured information control node to the fourth queue.

其中,第四队列用于管理已播放音频数据的信息控制节点。The fourth queue is used to manage the information control node of the played audio data.

基于步骤101-步骤105所提供的音频数据的处理方法,通过设定用于管理待配置的信息控制节点的第一队列,当阈值中断触发时,从第一队列中卸载单位数据的待配置的信息控制节点,并根据阈值中断时捕获的待播放音频数据对卸载的待配置的信息控制节点进行配置,将已配置的信息控制节点链接到用于管理已配置的信息控制节点的第二队列和第三队列中,在第三队列非空时,从第三队列中卸载单位数据的已配置的信息控制节点,根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,播放对应的待播放音频数据,进而将卸载的已配置的信息控制节点链接到管理已播放音频数据的信息控制节点的第四队列中。通过队列的形式,可以实时地对待播放音频数据的属性信息进行配置,并对待播放音频数据和已播放音频数据分别进行管理,同时,根据已配置的信息控制节点,读取相应的待播放音频数据,无需像现有技术那样,将待播放音频数据拷贝到另外一块内存空间上,读取拷贝后的内存空间上的待播放音频数据所带来的问题。采用本发明实施例所述的技术方案,在待播音频数据不会被覆盖的同时,省去之前备份用的内存空间的开辟和使用,剔除频繁的内存拷贝对系统性能的影响,省去了内存对齐动作进而简化操作流程,规避复杂的内存池实现、管理及后期维护的开销,简化了设计思路,即本发明实施例在避免设置内存池的同时实现待播放音频数据不会被覆盖的问题。Based on the processing method of the audio data provided in steps 101-105, by setting a first queue for managing the information control node to be configured, when the threshold interrupt is triggered, the unit data to be configured is unloaded from the first queue. The information control node configures the unloaded information control node to be unloaded according to the audio data to be played captured when the threshold is interrupted, and links the configured information control node to the second queue for managing the configured information control node and In the third queue, when the third queue is not empty, the configured information control node that unloads the unit data from the third queue controls the attribute information of the audio data to be played in the node according to the unconfigured configured information, and plays corresponding information. The audio data to be played is then linked to the unloaded configured information control node to the fourth queue of the information control node managing the played audio data. Through the form of the queue, the attribute information of the played audio data can be configured in real time, and the audio data to be played and the played audio data are separately managed, and at the same time, the node is controlled according to the configured information, and the corresponding audio data to be played is read. There is no need to copy the audio data to be played to another memory space as in the prior art, and read the problem caused by the audio data to be played on the copied memory space. By adopting the technical solution described in the embodiment of the present invention, the audio data to be broadcasted is not covered, the development and use of the memory space used for backup is omitted, and the influence of frequent memory copy on system performance is eliminated, and the effect is eliminated. The memory alignment action simplifies the operation process, circumvents the complexity of the memory pool implementation, management, and maintenance, and simplifies the design. The embodiment of the present invention avoids setting the memory pool while preventing the audio data to be played from being overwritten. .

实施例二Embodiment 2

在实施例一的基础上,本发明实施例提供一种具体的实现方式,如图2所示,包括:On the basis of the first embodiment, the embodiment of the present invention provides a specific implementation manner, as shown in FIG. 2, including:

步骤201、设定第一队列、第二队列、第三队列和第四队列。Step 201: Set a first queue, a second queue, a third queue, and a fourth queue.

其中,第一队列用于管理待配置的信息控制节点,第二队列和第三队列均用于管理已配置的信息控制节点,第四队列用于管理已播放音频数据的信息控制节点。为后续描述方便,将第一队列称为 tobe_pushed队列,第二队列称为pushed队列,第三队列称为tobe_played队列,第四队列称为played队列。初始化时,分配N个信息控制节点,通过尾插法插入到tobe_pushed队列中,N大于等于1;pushed队列、tobe_played队列和played队列初始化时为空。The first queue is used to manage the information control node to be configured, the second queue and the third queue are used to manage the configured information control node, and the fourth queue is used to manage the information control node of the played audio data. For the convenience of subsequent description, the first queue is called The tobe_pushed queue, the second queue is called the pushed queue, the third queue is called the tobe_played queue, and the fourth queue is called the played queue. At the time of initialization, N information control nodes are allocated, and are inserted into the tobe_pushed queue by the tail insertion method, N is greater than or equal to 1; the pushed queue, the tobe_played queue, and the played queue are initialized when empty.

需要说明的是,对于第一队列、第二队列、第三队列和第四队列的设定,可以是在初始化时同时进行设置,也可以是在需要的时候再进行设置,本发明实施例以在初始化时同时进行设置为例进行说明。It should be noted that, the setting of the first queue, the second queue, the third queue, and the fourth queue may be set at the same time of initialization, or may be set when needed. At the same time, the setting is performed at the same time as the initialization.

步骤202、采用直接内存写入WDMA捕获待播放音频数据。Step 202: Capture the audio data to be played by using direct memory write WDMA.

其中,直接内存写入(Write Direct Memory Access,简称WDMA)与第一缓冲区对应,第一缓冲区中包括读指针和写指针。The Write Direct Memory Access (WDMA) corresponds to the first buffer, and the first buffer includes a read pointer and a write pointer.

在本发明的一个优选的实施例中,第一缓冲区为环形缓冲区(Ring Buffer),该环形缓冲区中包括写指针(write pointer,wpt)和读指针(read pointer,rpt),其中,wpt表示捕获到的音频数据在Ring Buffer的存储位置,rpt表示读取的音频数据在Ring Buffer的存储位置。因此,WDMA的音频捕获及处理工作主要是依靠其写指针和读指针来完成的。其中,写指针主要由WDMA自己维护,读指针主要由CPU控制。In a preferred embodiment of the present invention, the first buffer is a Ring Buffer, and the ring buffer includes a write pointer (wpt) and a read pointer (rpt). Wpt indicates that the captured audio data is stored in the Ring Buffer, and rpt indicates that the read audio data is stored in the Ring Buffer. Therefore, WDMA's audio capture and processing work is mainly done by its write pointer and read pointer. Among them, the write pointer is mainly maintained by the WDMA itself, and the read pointer is mainly controlled by the CPU.

具体的,参照图4所示为WDMA的wpt、rpt及其维护的Ring Buffer的逻辑关系示意图。其中,st_addr(start address)表示Ring Buffer的起始地址(或首地址),end表示Ring Buffer的尾地址。初始化时,wpt和rpt均为0,即相当于对应Ring Buffer的起始地址。当WDMA捕获所在通路的音频数据时,捕获到的音频数据会从wpt的起始地址进行存储,另外,由于该缓冲区为环形缓冲区,因此,当wpt到达该Ring Buffer的尾地址时,会自动跳转到Ring Buffer的首地址,继续从Ring Buffer的起始位置开始存储音频数据,如此以Ring Buffer式管理捕获到的音频数据的存储空间,可以有效解决用于捕获的内存空间浪费的问题,同时,也取消了音频捕获的时间限制,支持无限时间长度的音频捕获。Specifically, FIG. 4 is a schematic diagram showing the logical relationship between wpt, rpt of WDMA and Ring Buffer maintained by the WDMA. Where st_addr(start address) indicates the starting address (or the first address) of the Ring Buffer, and end indicates the tail address of the Ring Buffer. When initializing, both wpt and rpt are 0, which is equivalent to the starting address of the corresponding Ring Buffer. When WDMA captures the audio data of the path in which it is located, the captured audio data is stored from the starting address of wpt. In addition, since the buffer is a ring buffer, when wpt reaches the tail address of the Ring Buffer, Automatically jump to the first address of Ring Buffer, continue to store audio data from the starting position of Ring Buffer, so that the storage space of captured audio data can be managed by Ring Buffer, which can effectively solve the problem of wasted memory space for capture. At the same time, the time limit of audio capture is also canceled, and audio capture with unlimited length of time is supported.

步骤203、检测第一缓冲区中的写指针和读指针的差值是否大于 或等于第一预设阈值。Step 203: Detect whether the difference between the write pointer and the read pointer in the first buffer is greater than Or equal to the first preset threshold.

其中,第一预设阈值小于第一缓冲区的长度。可选的,第一预设阈值的大小可以根据Ring Buffer的长度进行设定。示例的,若Ring Buffer的长度为N*M,则可以将第一预设阈值设置为M,也就是说,将WDMA对应的第一缓冲区分成N个第一预设阈值长度的缓冲区。另外,初始化时,可以分配同样个数(即N个)的信息控制节点,通过尾插法链接到tobe_pushed队列中。The first preset threshold is smaller than the length of the first buffer. Optionally, the size of the first preset threshold may be set according to the length of the Ring Buffer. For example, if the length of the Ring Buffer is N*M, the first preset threshold may be set to M, that is, the first buffer corresponding to the WDMA is divided into N buffers of a first preset threshold length. In addition, at the time of initialization, the same number (ie, N) of information control nodes can be allocated, and linked to the tobe_pushed queue by tail insertion.

步骤204、若检测到第一缓冲区中的写指针和读指针的差值大于或等于第一预设阈值,则触发阈值中断,生成触发指令。Step 204: If it is detected that the difference between the write pointer and the read pointer in the first buffer is greater than or equal to the first preset threshold, triggering the threshold interrupt to generate a trigger instruction.

步骤205、根据触发指令,从第一队列中卸载单位数据的待配置的信息控制节点,并对卸载的待配置的信息控制节点进行配置。Step 205: Unload the information control node of the unit data to be configured from the first queue according to the triggering instruction, and configure the unloaded information control node to be configured.

在本发明的一个优选的实施例中,步骤205具体包括如下子步骤:In a preferred embodiment of the present invention, step 205 specifically includes the following sub-steps:

205a、根据所述阈值中断,从第一队列中卸载单位数据的待配置的信息控制节点。205a. Unload the information control node of the unit data to be configured from the first queue according to the threshold interrupt.

其中,待配置的信息控制节点中主要包括以下信息:所在通路,如ATV Demod、AV、Component、VGA或HDMI;声道数,如8声道、6声道、2声道等;采样率,如32Khz、35.15625Khz、48Khz等;待播放音频数据的起始地址;待播放音频数据的数据长度。The information control node to be configured mainly includes the following information: a path, such as ATV Demod, AV, Component, VGA or HDMI; number of channels, such as 8-channel, 6-channel, 2-channel, etc.; sampling rate, Such as 32Khz, 35.15625Khz, 48Khz, etc.; the starting address of the audio data to be played; the data length of the audio data to be played.

对于待配置的信息控制节点的数据结构可以定义如下:The data structure of the information control node to be configured can be defined as follows:

struct ListNodeStruct ListNode

{{

int st_addr;//该信息控制节点对应的待播放音频数据的起始地址Int st_addr; / / the information control node corresponding to the starting address of the audio data to be played

int length;//该信息控制节点对应的待播放音频数据的长度Int length; / / the information control node corresponding to the length of the audio data to be played

int sample_rate;//所在通路的采样率Int sample_rate; / / sampling rate of the path

int channel;//所在通路,ATV Demod、AV、Component、VGA、HDMIInt channel; / / where the channel, ATV Demod, AV, Component, VGA, HDMI

int channel_num;//声道数,如8声道、6声道、2声道Int channel_num; / / number of channels, such as 8 channels, 6 channels, 2 channels

…… ......

ListNode*next;//用于生成队列用的成员,即指向该信息控制节点对应的下一个信息控制节点ListNode*next; / / used to generate the members of the queue, that is, the next information control node corresponding to the information control node

};};

当然,可以根据实际所需的信息,对待配置的信息控制节点的数据结构进行删除或增加,以满足用户的实际需求。Of course, the data structure of the information control node to be configured may be deleted or added according to the actual required information to meet the actual needs of the user.

205b、根据第一缓冲区中从读指针到写指针之间的待播放音频数据,对卸载的待配置的信息控制节点进行配置。205b. Configure, according to the to-be-played audio data from the read pointer to the write pointer in the first buffer, the offloaded information control node to be configured.

由于第一缓冲区为环形缓冲区,因此,会出现写指针大于读指针的情况、以及写指针小于读指针的情况。具体的,参照图5和图6所示,其中,图5为写指针大于读指针的情况,当写指针大于读指针时,则从读指针到写指针之间的音频数据为[rpt,wpt]之间的音频数据,如图5中斜线所示部分,进而根据[rpt,wpt]之间的音频数据,对卸载的待配置的信息控制节点进行配置;图6为读指针大于写指针的情况,当写指针小于读指针时,则从读指针到写指针之间的音频数据为:从读指针到缓冲区的尾地址之间的音频数据、以及从缓冲区的首地址到写指针之间的音频数据,即从[rpt,end]以及[st_addr,wpt]两段音频数据,如图6中双斜线所示部分,进而根据[rpt,end]以及[st_addr,wpt]两段音频数据,对卸载的待配置的信息控制节点进行配置。Since the first buffer is a ring buffer, there are cases where the write pointer is larger than the read pointer and the write pointer is smaller than the read pointer. Specifically, referring to FIG. 5 and FIG. 6, wherein FIG. 5 is a case where the write pointer is larger than the read pointer, and when the write pointer is larger than the read pointer, the audio data from the read pointer to the write pointer is [rpt, wpt]. The audio data between the two, as shown in the oblique line in Figure 5, and then according to the audio data between [rpt, wpt], the unloaded information control node to be configured; Figure 6 is the read pointer is larger than the write pointer In the case where the write pointer is smaller than the read pointer, the audio data from the read pointer to the write pointer is: audio data from the read pointer to the tail address of the buffer, and from the first address of the buffer to the write pointer. The audio data between the two pieces of audio data from [rpt, end] and [st_addr, wpt], as shown by the double slash in Figure 6, and then according to [rpt, end] and [st_addr, wpt] Audio data, configured for unloading the information control node to be configured.

也就是说,每次阈值中断触发时,根据第一缓冲区中从读指针到写指针之间的待播放音频数据,对卸载的信息控制节点进行配置,配置后的信息控制节点中包含待播放音频数据的属性信息。That is, each time the threshold interrupt is triggered, the unloaded information control node is configured according to the to-be-played audio data from the read pointer to the write pointer in the first buffer, and the configured information control node includes the to-be-played Attribute information of audio data.

步骤206、将已配置的信息控制节点链接到第二队列和第三队列中。Step 206: Link the configured information control node to the second queue and the third queue.

其中,已配置的信息控制节点中包含待播放音频数据的属性信息,即已配置的信息控制节点中包含对应的待播放音频数据的起始地址、待播放音频数据的长度,当然,已配置的信息控制节点中还可以包含所在通路、采样率、声道数等。The configured information control node includes the attribute information of the audio data to be played, that is, the configured information control node includes the corresponding start address of the audio data to be played, the length of the audio data to be played, and of course, the configured The information control node can also include the path, sampling rate, number of channels, and the like.

在具体实现中,如图7所示,将接收的已配置的信息控制节点链接(chain)到pushed队列和tobe_played队列的队列尾。其中, 将接收的已配置的信息控制节点链接到tobe_played队列的队列尾是通过deliver接口传递的,同时,pushed队列中已配置的信息控制节点仍然存在。In a specific implementation, as shown in FIG. 7, the received configured information control node is chained to the tail of the queue and the tail of the tobe_played queue. among them, The tail of the queue that links the received configured information control node to the tobe_played queue is delivered through the deliver interface. At the same time, the configured information control node in the pushed queue still exists.

步骤207、从第三队列中卸载单位数据的已配置的信息控制节点。Step 207: Unload the configured information control node of the unit data from the third queue.

在具体的实现中,在执行步骤207之前,首先判断tobe_played队列是否为空,如果为空,则继续chain新到来的待播放音频数据的已配置的信息控制节点(如图7中的new_tobe_played_data所示)到tobe_played队列的尾部(如图7中的tobe_played_tail所示);如果非空,则从第三队列中unchain单位数据的已配置的信息控制节点,具体是从tobe_played队列的队列头(如7中的tobe_played_head所示)unchain单位数据的已配置的信息控制节点,此时,新到来的待播音频数据的已配置的信息控制节点会继续链接到tobe_played队列的尾部。其中,单位数据优选为一个信息控制节点,与该信息控制节点对应的待播放音频数据,也可称为一笔数据。In a specific implementation, before performing step 207, first determine whether the tobe_played queue is empty. If it is empty, continue to the newly-configured information control node of the to-be-played audio data of the chain (as shown by new_tobe_played_data in FIG. 7). ) to the end of the tobe_played queue (shown as tobe_played_tail in Figure 7); if not empty, control the node from the configured information of the unchain unit data in the third queue, specifically from the queue header of the tobe_played queue (such as 7) Tobe_played_head shows the configured information control node of the unchain unit data. At this time, the configured information control node of the newly arrived audio data to be broadcast continues to link to the tail of the tobe_played queue. The unit data is preferably an information control node, and the audio data to be played corresponding to the information control node may also be referred to as a piece of data.

步骤208、根据卸载的已配置的信息控制节点,对直接内存读取RDMA对应的第二缓冲区中的配置节点进行配置。Step 208: Configure, according to the uninstalled configured information control node, a configuration node in a second buffer corresponding to the direct memory read RDMA.

在具体实现中,来源于多个通道的音频数据可以存储在第一缓冲区(即音频缓冲区)中,在音频缓冲区的音频数据属于待播放音频数据。本发明实施例采用RDMA(Read Direct Memory Access,直接内存读取)来读取音频缓冲区中的待播放的音频数据,其中,RDMA实际上是读取DMA,DMA便于不同的硬件装置间的沟通,而无需依赖于CPU的大量中断负载。In a specific implementation, audio data from multiple channels may be stored in a first buffer (ie, an audio buffer), and audio data in the audio buffer belongs to audio data to be played. In the embodiment of the present invention, RDMA (Read Direct Memory Access) is used to read the audio data to be played in the audio buffer, wherein the RDMA is actually reading the DMA, and the DMA is convenient for communication between different hardware devices. Without relying on a large amount of interrupt load on the CPU.

在具体实现中,RDMA具有对应的第二缓冲区buffer,该第二缓冲区buffer包括写指针(write pointer,wpt)、读指针(read pointer,rpt)以及多个配置节点item,每个配置节点item具有控制信息。RDMA的音频数据读取工作主要是依靠其写指针和读指针来控制完成的。其中,写指针主要由CPU控制,读指针由RDMA自己维护。In a specific implementation, the RDMA has a corresponding second buffer buffer, and the second buffer buffer includes a write pointer (wpt), a read pointer (rpt), and a plurality of configuration node items, each configuration node. Item has control information. RDMA's audio data reading work is mainly controlled by its write pointer and read pointer. Among them, the write pointer is mainly controlled by the CPU, and the read pointer is maintained by the RDMA itself.

在实际中,对于RDMA,IC(Integrated Circuit,即集成电路)可以将其对应的缓冲区buffer实现为一个环形缓冲区,其中,环形 缓冲区是一种数据结构用于表示一个固定尺寸、头尾相连的缓冲区,适合缓存数据流,环形缓冲区的一个有用特性是:其存储空间可以被循环利用。In practice, for an RDMA, an integrated circuit (IC) can implement its corresponding buffer buffer as a ring buffer, in which a ring A buffer is a data structure used to represent a fixed-size, head-to-tail buffer that is suitable for caching data streams. A useful feature of a ring buffer is that its storage space can be recycled.

应用于本发明实施例,可以将该环形缓冲区实现为一个一个的配置节点item,该item主要是用来控制RDMA读取音频数据的,其中,每个item由64bit组成,第一个32bit,即第一个字,为起始地址参数start address(简写为st_addr),指向RDMA要读取的PCM音频数据存储于内存的物理地址;第二个32bit,即第二个字,主要包括长度参数length成员,该length表示该待读取的PCM音频数据的长度。RDMA的写指针、读指针以及环形缓冲区的配置节点item的关系如图8所示,在环形缓冲区中,读指针指向环形缓冲区中已配置好、待读取的item,写指针指向环形缓冲区中正在配置或待配置的item。In the embodiment of the present invention, the ring buffer can be implemented as a configuration node item, and the item is mainly used to control RDMA to read audio data, wherein each item is composed of 64 bits, and the first 32 bits, That is, the first word is the start address parameter start address (abbreviated as st_addr), pointing to the physical address of the PCM audio data to be read by the RDMA to be stored in the memory; the second 32 bits, that is, the second word, mainly including the length parameter Length member, the length represents the length of the PCM audio data to be read. The relationship between the RDMA write pointer, the read pointer, and the configuration node of the ring buffer is shown in Figure 8. In the ring buffer, the read pointer points to the item that has been configured and is to be read in the ring buffer, and the write pointer points to the ring. The item in the buffer that is being configured or to be configured.

需要说明的是,环形缓冲区中item的个数由CPU决定,每个item的start address以及lengh等控制信息,也由CPU实时更新。It should be noted that the number of items in the ring buffer is determined by the CPU, and the control information of each item's start address and lengh is also updated by the CPU in real time.

在本发明的一个优选的实施例中,步骤208具体包括如下子步骤:In a preferred embodiment of the present invention, step 208 specifically includes the following sub-steps:

208a、确定第二缓冲区中的写指针所指向的目标配置节点。208a. Determine a target configuration node pointed to by the write pointer in the second buffer.

在具体实现中,可以采用两种方式来确定目标item,一是读取wpt所对应的寄存器,寄存器中保存有对应的item信息;二是将RDMA的item(假如为20个)实现为一个结构体数组,通过该数组wpt所对应的索引即可获取wpt所在位置的目标item。In the specific implementation, two ways can be used to determine the target item. One is to read the register corresponding to wpt, and the corresponding item information is stored in the register; the second is to implement the RDMA item (if 20) as a structure. The body array, through the index corresponding to the array wpt, can obtain the target item at the location of wpt.

208b、将目标配置节点的起始地址参数设置为待播放音频数据的起始地址。208b. Set a start address parameter of the target configuration node to a start address of the audio data to be played.

208c、将目标配置节点的长度参数设置为待播放音频数据的长度。208c. Set a length parameter of the target configuration node to a length of the audio data to be played.

具体而言,本发明实施例获取目标配置节点后,配置该目标配置节点item的第一个字(即起始地址参数),使之指向该笔待播音频数据所在的DDR的物理地址,再配置该item的第二个字(即长度参数),使其存储该单位数据的待播放音频数据的长度。需要说明 的是,该长度优选可以为硬件要求的128字节的倍数。Specifically, after obtaining the target configuration node, the embodiment of the present invention configures the first word (ie, the starting address parameter) of the target configuration node item to point to the physical address of the DDR where the audio data to be broadcasted is located, and then The second word of the item (ie, the length parameter) is configured to store the length of the audio data to be played for the unit data. Need to explain Preferably, the length can be a multiple of 128 bytes required by the hardware.

需要说明的时,为了保证第二缓冲区中的写指针有可写入的item,读指针有可读取的item,进而确保不会出现写的快(即CPU配置RDMA的item并更新其wpt)、读的慢(即RDMA读取item对应的指定地址、指定长度的数据并更新其rpt)导致的声音跳播(漏播)的问题,以及写的慢、读的快导致的声音卡顿的问题,可以计算第二缓冲区中写指针与读指针的差值,若第二缓冲区中写指针与读指针的差值在满足一定的条件时,则从第三队列中卸载单位数据的已配置的信息控制节点,并根据卸载的已配置的信息控制节点对对应的item进行配置。另外,对于第二缓冲区中写指针与读指针的差值在满足一定的条件可以为写指针与读指针的差值大于或等于第四预设阈值,该第四预设阈值可以根据第二缓冲区中item的个数、CPU的处理能力等进行设置,以满足实际需求,本发明对第四预设阈值的设置方式不加限定。When it is necessary to note, in order to ensure that the write pointer in the second buffer has a writable item, the read pointer has a readable item, thereby ensuring that the write is not fast (ie, the CPU configures the RDMA item and updates its wpt). ), the slow read (ie RDMA reads the specified address corresponding to the item, the specified length of data and updates its rpt) caused by the sound jump (snapcast) problem, as well as the slow write, fast read sound caused by the sound The problem can be calculated by the difference between the write pointer and the read pointer in the second buffer. If the difference between the write pointer and the read pointer in the second buffer satisfies certain conditions, the unit data is unloaded from the third queue. The configured information control node controls the node to configure the corresponding item according to the configured information of the uninstallation. In addition, for the difference between the write pointer and the read pointer in the second buffer, the difference between the write pointer and the read pointer may be greater than or equal to a fourth preset threshold, and the fourth preset threshold may be according to the second The number of the items in the buffer, the processing capacity of the CPU, and the like are set to meet the actual requirements. The setting manner of the fourth preset threshold is not limited in the present invention.

步骤209、根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,读取对应的待播放音频数据。Step 209: Control the attribute information of the audio data to be played in the node according to the unconfigured configured information, and read the corresponding audio data to be played.

在本发明的一种优选的实施例中,步骤209包括如下子步骤:In a preferred embodiment of the invention, step 209 includes the following sub-steps:

209a、更新第二缓冲区中的写指针。209a. Update the write pointer in the second buffer.

由于RDMA对应的第二缓冲区为环形缓冲区,因此,步骤209a包括:Since the second buffer corresponding to the RDMA is a ring buffer, step 209a includes:

209a1、判断目标配置节点是否为环形缓冲区的最后一个配置节点。209a1, determining whether the target configuration node is the last configuration node of the ring buffer.

若是,则执行步骤209a2;若不是,则执行步骤209a3。If yes, step 209a2 is performed; if not, step 209a3 is performed.

209a2、若是,则配置第二缓冲区中的写指针为第二缓冲区的起始地址对应的第一个配置节点所在的位置。209a2, if yes, configuring the write pointer in the second buffer to be the location of the first configuration node corresponding to the start address of the second buffer.

209a3、若否,则配置第二缓冲区中的写指针为环形缓冲区中目标配置节点紧邻的下一个配置节点的位置。209a3. If no, configure the write pointer in the second buffer to be the location of the next configuration node immediately adjacent to the target configuration node in the ring buffer.

具体来说,由于RDMA被实现为Ring Buffer,因此,可以判断该目标item是否是Ring Buffer中的最后一个item,如果该目标item为Ring Buffer中的最后一个item,则配置其wpt为RDMA起始位 置的第一个item所在的位置。否则,配置其wpt为该目标item的紧接着的下一个item的位置。Specifically, since RDMA is implemented as a Ring Buffer, it can be determined whether the target item is the last item in the Ring Buffer. If the target item is the last item in the Ring Buffer, configure its wpt to be the RDMA start. Bit The location where the first item is placed. Otherwise, configure its wpt to be the location of the next next item of the target item.

209b、计算第二缓冲区中的写指针与读指针的差值。209b. Calculate a difference between the write pointer and the read pointer in the second buffer.

209c、若第二缓冲区中的写指针与读指针的差值大于或等于第二预设阈值,则读取读指针所指向的配置节点对应的待播放音频数据。209c. If the difference between the write pointer and the read pointer in the second buffer is greater than or equal to the second preset threshold, read the audio data to be played corresponding to the configuration node pointed by the read pointer.

由于RDMA的wpt由CPU控制,其rpt由硬件自己维护。在上述配置完目标item,更新了写指针wpt后,当更新了位置的wpt与RDMA的rpt的差值大于等于第二预设阈值(例如1个item)时,RDMA便会自动读取其rpt指向的item对应的内存位置中的指定长度的音频数据,这样,可以保证此时有可以读取的配置节点,进而读取第二缓冲区中读指针指向的配置节点所对应的待播放音频数据。当wpt与RDMA的rpt的差值小于第四预设阈值时,意味着RDMA中的rpt快追上其wpt了,提醒CPU音频数据不够播了,需要CPU及时地配置新的item以指向新的待播放音频数据,以免出现由于暂时无数据可读而出现的声音卡顿,甚至无声等问题。其中,第四预设阈值可以根据第二缓冲区中item的个数、CPU的处理能力等因素进行设定。需要说明的时,第四预设阈值可以和第二预设阈值相同,也可以不同。Since the wpt of RDMA is controlled by the CPU, its rpt is maintained by the hardware itself. After the target item is configured as described above, after the write pointer wpt is updated, when the difference between the updated wpt of the location and the rpt of the RDMA is greater than or equal to a second preset threshold (for example, 1 item), the RDMA automatically reads the rpt. Point to the audio data of the specified length in the memory location corresponding to the item, so that it can ensure that there is a configuration node that can be read at this time, and then read the audio data to be played corresponding to the configuration node pointed by the read pointer in the second buffer. . When the difference between wpt and RDMA's rpt is less than the fourth preset threshold, it means that the RPT in the RDMA quickly catches up with its wpt, reminding the CPU that the audio data is not enough, and the CPU needs to configure the new item in time to point to the new one. The audio data is to be played to avoid problems such as sounding up due to the temporary lack of data readability, or even silence. The fourth preset threshold may be set according to factors such as the number of items in the second buffer and the processing capability of the CPU. When the description is required, the fourth preset threshold may be the same as or different from the second preset threshold.

同时,本发明实施例的RDMA还可以更新读指针rpt,将rpt自动更新至rpt所在位置的下一个item的位置上。由于RDMA的buffer为环形buffer,当其rpt走到buffer尾部时,会自动ring到该buffer的起始位置,而wpt则需要软件维护至环形buffer头,从而循环利用该段内存空间。At the same time, the RDMA of the embodiment of the present invention can also update the read pointer rpt, and automatically update the rpt to the position of the next item where the rpt is located. Since the RDMA buffer is a ring buffer, when its rpt goes to the end of the buffer, it will automatically ring to the start position of the buffer, and wpt needs software maintenance to the ring buffer header, thereby recycling the memory space.

步骤210、将卸载的已配置的信息控制节点链接到第四队列中。Step 210: Link the uninstalled configured information control node to the fourth queue.

如图7所示,当对卸载的已配置的信息控制节点对应的待播放音频数据属性信息进行配置后,将该节点(如图7中new_played_data所示)chain到played队列的队列尾(如图7中played_tail所示)。As shown in FIG. 7, after configuring the to-be-played audio data attribute information corresponding to the unconfigured configured information control node, the node (shown as new_played_data in FIG. 7) is chained to the queue end of the played queue (as shown in FIG. 7). 7 played_tail shown).

根据上述步骤所描述的技术方案,在WDMA开始捕获待播放音频数据后,每到一个threshold中断,从tobe_pushed队列的队列头 unchain下待配置的信息控制节点,然后对该threshold中断对应的[rpt,wpt]之间的待播放音频数据建立控制信息(即上述的待播放音频数据的起始地址、长度、采样率等信息),这样,从tobe_pushed队列unchain下的信息控制节点就具备了这些信息,并且这些信息对应的是该笔中断所要读取的待播放音频数据,然后pushed队列接收(或对接)该信息控制节点,并调用后端提供的deliver接口,该接口将该信息控制节点给后端,后端接收后将其chain到tobe_played队列的队列尾(注意,此时并未将该信息控制节点从pushed队列中卸载),后端RDMA开始读取数据以送给功放,播放前需调用paly_item接口,该接口从tobe_played队列头unchian下信息控制节点,将其所携带的待播放音频数据的属性信息配置给与RDMA对应的第二缓冲区的item后,将该信息控制节点chain到played队列尾部。According to the technical solution described in the above steps, after the WDMA starts capturing the audio data to be played, each threshold is interrupted, and the queue header from the tobe_pushed queue The information control node to be configured in the unchain, and then establish control information for the audio data to be played between the [rpt, wpt] corresponding to the threshold interrupt (that is, the start address, length, sampling rate, and the like of the audio data to be played. In this way, the information control node under the unbe_pushed queue unchain has the information, and the information corresponds to the audio data to be played that the interrupt is to be read, and then the shed queue receives (or docks) the information control node. And calling the deliver interface provided by the backend, the interface controls the node to the backend, and the backend receives it and then chains it to the tail of the tobe_played queue (note that the information control node is not uninstalled from the pushed queue at this time) ), the backend RDMA starts to read data for the power amplifier, and needs to call the paly_item interface before playing. The interface from the tobe_played queue header unchian information control node, and configures the attribute information of the audio data to be played carried by it to correspond to the RDMA. After the item of the second buffer, the information control node is chained to the end of the played queue.

为了使信息控制节点在合适的时机进行卸载和添加,以利于初始化时分配的信息控制节点的循环利用,解决系统内存空间浪费及实施频繁分配信息控制节点导致的内存碎片过多的问题。如图3所示,该方法还包括:In order to make the information control node unload and add at the appropriate time, in order to facilitate the recycling of the information control node allocated during initialization, the problem of waste of system memory space and excessive memory fragmentation caused by frequent allocation of information control nodes are solved. As shown in FIG. 3, the method further includes:

步骤211、确定第二缓冲区中读指针所在的位置。Step 211: Determine a location where the read pointer is located in the second buffer.

步骤212、计算第二缓冲区中第一标记指针和第二标记指针的差值。Step 212: Calculate a difference between the first marker pointer and the second marker pointer in the second buffer.

其中,第一标记指针指向第二缓冲区中的读指针所在的位置的上一个配置节点所在的位置,第二标记指针为上一次释放时第一标记指针所在的位置。The first mark pointer points to a position where the last configuration node at the position where the read pointer is located in the second buffer, and the second mark pointer is the position where the first mark pointer is located when the last release.

步骤213、若第二缓冲区中第一标记指针和第二标记指针的差值大于或等于第三预设阈值,则将第四队列中与第一标记指针和第二标记指针之间已配置的配置节点对应的已播放的音频数据的信息控制节点卸载。Step 213: If the difference between the first marker pointer and the second marker pointer in the second buffer is greater than or equal to a third preset threshold, the fourth queue is configured with the first marker pointer and the second marker pointer. The information of the played audio data corresponding to the configuration node controls the node to be unloaded.

其中,第三预设阈值可以根据第二缓冲区中item的个数、CPU的处理能力等进行设定。The third preset threshold may be set according to the number of items in the second buffer, the processing capability of the CPU, and the like.

进一步的,在将第四队列中的已播放音频数据的信息控制节点卸载的同时或者之后,如图3所示,该方法还包括: Further, at the same time as or after the information control node of the played audio data in the fourth queue is unloaded, as shown in FIG. 3, the method further includes:

步骤214、将第二队列中与已播放音频数据对应的已配置的信息控制节点卸载并释放。Step 214: Unload and release the configured information control node corresponding to the played audio data in the second queue.

步骤215、将第二队列中卸载并释放的信息控制节点链接到第一队列中。Step 215: Link the information control node that is unloaded and released in the second queue to the first queue.

根据步骤211-215所描述的步骤,在具体的实现中,在播放完一笔音频数据后,调用play_item接口,通过判定第一标记指针和第二标记指针,在满足条件的情况下,判定played队列是否非空;若played队列非空,则从played队列头unchain一个已播音频数据对应的信息控制节点;同时,由于第二队列pushed队列中包含与已播放的音频数据对应的信息控制节点,在该待播放音频数据被播放后,通过回调机制(回调释放接口,该接口用于完成对tobe_pushed队列和pushed队列中信息控制节点的操作)将pushed队列中与已播放的音频数据对应的信息控制节点进行卸载,并释放(该释放是指清空信息控制节点中的配置信息),紧接着将其链接到tobe_pushed队列的队列尾,这样,可以达到初始化时分配的固定个数的信息控制节点能够循环往复利用的目的,解决系统内存空间浪费及实施频繁分配信息控制节点导致的内存碎片过多的问题,避免系统资源的浪费。According to the steps described in steps 211-215, in a specific implementation, after playing an audio data, the play_item interface is called, and by determining the first marker pointer and the second marker pointer, if the condition is satisfied, the played is determined. If the queue is not empty, if the played queue is not empty, the information control node corresponding to the broadcasted audio data is unchained from the played queue; at the same time, because the second queue includes the information control node corresponding to the played audio data, After the to-be-played audio data is played, the callback mechanism (the callback release interface, the interface is used to complete the operation of the information control node in the tobe_pushed queue and the pushed queue) controls the information corresponding to the played audio data in the pushed queue. The node is unloaded and released (the release refers to clearing the configuration information in the information control node), and then it is linked to the tail of the queue of the tobe_pushed queue, so that a fixed number of information control nodes allocated at initialization can be circulated. Reuse of the purpose, to solve the system memory space waste and implement frequent distribution of letters The problem of excessive memory fragmentation caused by the control node avoids the waste of system resources.

需要说明的是,tobe_played队列在接收到deliver接口传递过来的已配置的信息控制节点时,未将该已配置的信息控制节点从pushed队列中卸载的原因是:如果此时将该已配置的信息控制节点从pushed队列中卸载,同时将其chain到tobe_pushed队列上,那意味着tobe_pushed队列可以使用该信息控制节点制定新内存位置上的待播放音频数据,如果前端在后端tobe_played队列配置信息控制节点携带的待播放音频数据的属性信息给RDMA的item之前,重新配置了该信息控制节点,当RDMA读取该新位置上的数据并播放时,会出现声音跳播的问题。因此,要确保该信息控制节点对应的DDR上的音频数据已被播放,再将其从pushed队列上卸载,同时chain到tobe_pushed队列的队列尾。It should be noted that when the tobe_played queue receives the configured information control node passed by the deliver interface, the configured information control node is not uninstalled from the pushed queue because the configured information is configured at this time. The control node is unloaded from the pushed queue and chained to the tobe_pushed queue. This means that the tobe_pushed queue can use this information to control the node to create audio data to be played on the new memory location. If the front end is in the backend tobe_played queue configuration information control node Before the attribute information of the audio data to be played is carried to the item of the RDMA, the information control node is reconfigured, and when the RDMA reads the data at the new location and plays, a problem of sound skipping occurs. Therefore, it is ensured that the audio data on the DDR corresponding to the information control node has been played, and then unloaded from the pushed queue, and chained to the tail of the tobe_pushed queue.

进一步的,由于音频数据为来源于不同通路上的音频数据,因此,当待播放音频数据为第一通路的音频数据时,在步骤209之后, 如图3所示,该方法还包括:Further, since the audio data is derived from audio data on different paths, when the audio data to be played is the audio data of the first path, after step 209, As shown in FIG. 3, the method further includes:

216、检测是否从第一通路切换到第二通路。216. Detect whether to switch from the first path to the second path.

217、若检测到从第一通路切换到第二通路,则卸载并释放第三队列中剩余的已配置的信息控制节点。217. If detecting the switch from the first path to the second path, uninstalling and releasing the configured information control nodes remaining in the third queue.

本发明实施例中的第二通道异于第一通道,在检测到从第一通道切换为第二通道时,卸载并释放第三队列中剩余的已配置的信息控制节点。具体来说,因为在通路切换前分配的音频数据,对应的是上一通路中的音频数据,而通路切换完毕开始新切换到的通路的音频数据的播放时,会先从tobe_played队列头unchain下一个结点,如果该队列上仍然有未释放的上个通路的音频数据,这些音频数据会先配置给RDMA的item,从而RDMA会先读走这些item对应的音频数据,再播放实时配置的新通路的音频数据。因此,会产生通路切换后,先播放一会上一通路残留的音频数据,再播放新切换到的通路的音频数据的现象。本发明实施例在每次通路切换时,可以将chain到tobe_played队列上从队列头到队列尾的每笔未配置给RDMA的item,即剩余的未播放的音频数据对应的已配置的信息控制节点卸载并释放掉,以解决切换通路时,先播放一会上一通路残留的音频数据再播放新切换到的通路的音频数据的问题。另外,该卸载及释放的动作非常迅速,以毫秒级计算,如此,可以大大降低用户的等待通道切换的时间,进而提升用户的视听体验。The second channel in the embodiment of the present invention is different from the first channel, and when detecting the switch from the first channel to the second channel, unloads and releases the remaining configured information control nodes in the third queue. Specifically, because the audio data allocated before the path switching corresponds to the audio data in the previous path, and the audio data of the path that is newly switched to the path switching is completed, the tobe_played queue head is first unchained. A node, if there is still audio data of the last channel that is not released on the queue, the audio data will be first configured to the RDMA item, so that the RDMA will read the audio data corresponding to the items first, and then play the new real-time configuration. Audio data for the path. Therefore, after the path switching, the audio data remaining in the previous path is played first, and the audio data of the newly switched path is played. In the embodiment of the present invention, each time the path is switched, each item that is not configured to the RDMA from the queue head to the tail of the queue on the tobe_played queue, that is, the configured information control node corresponding to the remaining unplayed audio data may be configured. Unloading and releasing, in order to solve the problem of switching the channel, first play the audio data remaining in the previous channel and then play the audio data of the newly switched path. In addition, the unloading and releasing actions are very fast, and are calculated in milliseconds. Thus, the time for the user to wait for channel switching can be greatly reduced, thereby improving the user's audiovisual experience.

本发明实施例提供了一种音频数据的处理方法,通过设定用于管理待配置的信息控制节点的第一队列,当阈值中断触发时,从第一队列中卸载单位数据的待配置的信息控制节点,并根据阈值中断时捕获的待播放音频数据对卸载的待配置的信息控制节点进行配置,将已配置的信息控制节点链接到用于管理已配置的信息控制节点的第二队列和第三队列中,在第三队列非空时,从第三队列中卸载单位数据的已配置的信息控制节点,根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,播放对应的待播放音频数据,进而将卸载的已配置的信息控制节点链接到管理已播放音频数据的信息控制节点的第四队列中。通过队列的形式,可以实时地对待播 放音频数据的属性信息进行配置,并对待播放音频数据和已播放音频数据分别进行管理,同时,根据已配置的信息控制节点,读取相应的待播放音频数据,无需像现有技术那样,将待播放音频数据拷贝到另外一块内存空间上,读取拷贝后的内存空间上的待播放音频数据所带来的问题。采用本发明实施例所述的技术方案,在待播音频数据不会被覆盖的同时,省去之前备份用的内存空间的开辟和使用,剔除频繁的内存拷贝对系统性能的影响,省去了内存对齐动作进而简化操作流程,规避复杂的内存池实现、管理及后期维护的开销,简化了设计思路,即本发明实施例在避免设置内存池的同时实现待播放音频数据不会被覆盖的问题。The embodiment of the present invention provides a method for processing audio data. By setting a first queue for managing an information control node to be configured, when the threshold interrupt is triggered, the information to be configured of the unit data is unloaded from the first queue. Controlling the node, and configuring the unloaded information control node to be unloaded according to the to-be-played audio data captured when the threshold is interrupted, linking the configured information control node to the second queue and the second queue for managing the configured information control node In the three queues, when the third queue is not empty, the configured information control node that unloads the unit data from the third queue controls the attribute information of the audio data to be played in the node according to the configured information of the uninstallation, and plays the corresponding to-be-played The audio data is played, and the unloaded configured information control node is linked to the fourth queue of the information control node that manages the played audio data. In the form of a queue, you can treat it in real time. The attribute information of the audio data is configured, and the audio data to be played and the audio data to be played are separately managed, and at the same time, the node is controlled according to the configured information, and the corresponding audio data to be played is read, without the prior art The audio data to be played is copied to another memory space, and the problem caused by the audio data to be played on the copied memory space is read. By adopting the technical solution described in the embodiment of the present invention, the audio data to be broadcasted is not covered, the development and use of the memory space used for backup is omitted, and the influence of frequent memory copy on system performance is eliminated, and the effect is eliminated. The memory alignment action simplifies the operation process, circumvents the complexity of the memory pool implementation, management, and maintenance, and simplifies the design. The embodiment of the present invention avoids setting the memory pool while preventing the audio data to be played from being overwritten. .

实施例三Embodiment 3

本发明实施例提供了一种音频数据的处理装置,该音频数据的处理装置中各个功能单元执行实施例一或实施例二中相对应的方法步骤,具体可参考实施例一或实施例二所描述的,在此不再赘述。如图9所示,该音频数据的捕获装置110包括:The embodiment of the present invention provides an apparatus for processing audio data. The function units of the audio data processing apparatus perform the corresponding method steps in the first embodiment or the second embodiment. For details, refer to the first embodiment or the second embodiment. The description is not repeated here. As shown in FIG. 9, the audio data capturing apparatus 110 includes:

节点卸载单元1101,用于当接收到触发指令时,从第一队列中卸载单位数据的待配置的信息控制节点,并对卸载的待配置的信息控制节点进行配置,已配置的信息控制节点包含待播放音频数据的属性信息,第一队列中包含至少一个待配置的信息控制节点;The node unloading unit 1101 is configured to: when the triggering instruction is received, uninstall the information control node to be configured of the unit data from the first queue, and configure the uninstalled information control node to be configured, where the configured information control node includes The attribute information of the audio data to be played, the first queue includes at least one information control node to be configured;

节点链接单元1102,用于将已配置的信息控制节点链接到第二队列和第三队列中,第二队列和第三队列均用于管理已配置的信息控制节点;a node linking unit 1102, configured to link the configured information control node to the second queue and the third queue, where the second queue and the third queue are both used to manage the configured information control node;

节点卸载单元1101,用于从第三队列中卸载单位数据的已配置的信息控制节点;a node unloading unit 1101, configured to uninstall the configured information control node of the unit data from the third queue;

读取单元1103,用于根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,读取对应的待播放音频数据;The reading unit 1103 is configured to control attribute information of the audio data to be played in the node according to the unconfigured configured information, and read corresponding audio data to be played;

节点链接单元1102,还用于将卸载的已配置的信息控制节点链接到第四队列,第四队列用于管理已播放音频数据的信息控制节点。The node linking unit 1102 is further configured to link the uninstalled configured information control node to the fourth queue, and the fourth queue is used to manage the information control node of the played audio data.

可选的,如图10所示,该装置110还包括:Optionally, as shown in FIG. 10, the device 110 further includes:

捕获单元1104,用于采用直接内存写入WDMA捕获待播放音 频数据,其中,WDMA与第一缓冲区对应,第一缓冲区中包括读指针和写指针;The capturing unit 1104 is configured to capture a to-be-played tone by using a direct memory write WDMA Frequency data, wherein the WDMA corresponds to the first buffer, and the first buffer includes a read pointer and a write pointer;

检测单元1105,用于检测第一缓冲区中写指针和读指针的差值是否大于或等于第一预设阈值;The detecting unit 1105 is configured to detect whether a difference between the write pointer and the read pointer in the first buffer is greater than or equal to a first preset threshold;

触发单元1106,用于若第一缓冲区中写指针和读指针的差值大于或等于第一预设阈值,则触发阈值中断,生成触发指令。The triggering unit 1106 is configured to trigger a threshold interrupt to generate a trigger instruction if a difference between the write pointer and the read pointer in the first buffer is greater than or equal to a first preset threshold.

可选的,如图10所示,该装置110还包括:第一配置单元1107;Optionally, as shown in FIG. 10, the device 110 further includes: a first configuration unit 1107;

节点卸载单元1101,具体用于根据触发指令,从第一队列中卸载单位数据的待配置的信息控制节点;The node unloading unit 1101 is specifically configured to: according to the triggering instruction, uninstall the information control node to be configured of the unit data from the first queue;

第一配置单元1107,具体用于根据第一缓冲区中从读指针到写指针之间的待播放音频数据,对卸载的待配置的信息控制节点进行配置。The first configuration unit 1107 is specifically configured to configure the offloaded information control node to be configured according to the audio data to be played between the read pointer and the write pointer in the first buffer.

可选的,第一配置单元1107具体用于将待播放音频数据的起始地址、待播放音频数据的长度配置在卸载的待配置的信息控制节点中。Optionally, the first configuration unit 1107 is configured to configure a starting address of the audio data to be played and a length of the audio data to be played in the unloaded information control node to be configured.

可选的,如图10所示,该装置110还包括:第二配置节点1108;Optionally, as shown in FIG. 10, the apparatus 110 further includes: a second configuration node 1108;

第二配置单元1108,用于根据卸载的已配置的信息控制节点,对与直接内存读取RDMA对应的第二缓冲区中的配置节点进行配置,第二缓冲区中包括读指针、写指针以及多个配置节点,配置节点具有配置信息。a second configuration unit 1108, configured to, according to the unconfigured configured information control node, configure a configuration node in a second buffer corresponding to the direct memory read RDMA, where the second buffer includes a read pointer, a write pointer, and Multiple configuration nodes, configuration nodes have configuration information.

可选的,待播放音频数据的属性信息中包括待播放音频数据的起始地址,以及待播放音频数据的长度,配置信息中包括配置节点的起始地址参数,以及对应的长度参数;Optionally, the attribute information of the audio data to be played includes a start address of the audio data to be played, and a length of the audio data to be played, where the configuration information includes a start address parameter of the configuration node, and a corresponding length parameter;

具体的,如图10所示,该第二配置单元1108包括:Specifically, as shown in FIG. 10, the second configuration unit 1108 includes:

确定子单元1108a,用于确定第二缓冲区中的写指针所指向的目标配置节点;Determining a subunit 1108a for determining a target configuration node pointed to by the write pointer in the second buffer;

配置子单元1108b,用于将目标配置节点的起始地址参数设置为待播放音频数据的起始地址;a configuration subunit 1108b, configured to set a start address parameter of the target configuration node to a start address of audio data to be played;

配置子单元1108b,还用于将目标配置节点的长度参数设置为待播放音频数据的数据长度。 The configuration subunit 1108b is further configured to set the length parameter of the target configuration node to the data length of the audio data to be played.

可选的,如图10所示,读取单元1103包括:Optionally, as shown in FIG. 10, the reading unit 1103 includes:

更新子单元1103a,用于更新第二缓冲区中的写指针;Updating subunit 1103a for updating a write pointer in the second buffer;

计算子单元1103b,用于计算第二缓冲区中的写指针与读指针的差值;The calculating subunit 1103b is configured to calculate a difference between the write pointer and the read pointer in the second buffer;

读取子单元1103c,用于若第二缓冲区中的写指针与读指针的差值大于或等于第二预设阈值,则读取第二缓冲区中的读指针所指向的配置节点对应的待播放音频数据。The reading subunit 1103c is configured to: if the difference between the write pointer and the read pointer in the second buffer is greater than or equal to a second preset threshold, read a corresponding configuration node pointed by the read pointer in the second buffer Audio data to be played.

可选的,更新子单元1103a,具体用于:Optionally, the update subunit 1103a is specifically configured to:

判断目标配置节点是否为第二缓冲区的最后一个配置节点;Determining whether the target configuration node is the last configuration node of the second buffer;

若是,则配置第二缓冲区中的写指针为第二缓冲区的起始地址对应的第一个配置节点所在的位置;If yes, configuring the write pointer in the second buffer to be the location of the first configuration node corresponding to the start address of the second buffer;

若否,则配置第二缓冲区中的写指针为第二缓冲区中目标配置节点紧邻的下一个配置节点的位置。If not, the write pointer in the second buffer is configured to be the location of the next configuration node immediately adjacent to the target configuration node in the second buffer.

可选的,如图10所示,该装置110还包括:确定单元1109和计算单元1110;Optionally, as shown in FIG. 10, the apparatus 110 further includes: a determining unit 1109 and a calculating unit 1110;

确定单元1109,用于确定第二缓冲区中读指针所在的位置;a determining unit 1109, configured to determine a location of the read pointer in the second buffer;

计算单元1110,用于确定第二缓冲区中第一标记指针和第二标记指针的差值,第一标记指针指向第二缓冲区中的读指针所在位置的上一个配置节点所在的位置,第二标记指针为上一次释放时第一标记指针所在的位置;The calculating unit 1110 is configured to determine a difference between the first mark pointer and the second mark pointer in the second buffer, where the first mark pointer points to a position of a previous configuration node where the read pointer in the second buffer is located, The second mark pointer is the position where the first mark pointer is located when the last release;

节点卸载单元1101,还用于若计算单元1110计算第二缓冲区中第一标记指针和第二标记指针的差值大于或等于第三预设阈值,则将第四队列中与第一标记指针和第二标记指针之间已配置的配置节点对应的已播放音频数据的信息控制节点卸载。The node unloading unit 1101 is further configured to: if the calculating unit 1110 calculates that the difference between the first marker pointer and the second marker pointer in the second buffer is greater than or equal to a third preset threshold, then the fourth queue and the first marker pointer The information of the played audio data corresponding to the configured configuration node between the second marker pointer and the control node is unloaded.

可选的,节点卸载单元1101,还用于将第二队列中与已播放音频数据对应的已配置的信息控制节点卸载并释放;Optionally, the node unloading unit 1101 is further configured to uninstall and release the configured information control node corresponding to the played audio data in the second queue;

节点链接单元1102,还用于将所述第二队列中卸载并释放的信息控制节点链接到第一队列中。The node linking unit 1102 is further configured to link the information control node that is unloaded and released in the second queue to the first queue.

可选的,待播放音频数据为第一通路的音频数据;Optionally, the audio data to be played is the audio data of the first path;

检测单元1105,用于检测是否从第一通路切换到第二通路; a detecting unit 1105, configured to detect whether to switch from the first path to the second path;

节点卸载单元1102,还用于若检测单元1105检测到从第一通路切换到第二通路,则卸载并释放第三队列中剩余的已配置的信息控制节点。The node unloading unit 1102 is further configured to: if the detecting unit 1105 detects the switch from the first path to the second path, uninstall and release the configured information control nodes remaining in the third queue.

本发明实施例提供了一种音频数据的处理装置,通过设定用于管理待配置的信息控制节点的第一队列,当阈值中断触发时,从第一队列中卸载单位数据的待配置的信息控制节点,并根据阈值中断时捕获的待播放音频数据对卸载的待配置的信息控制节点进行配置,将已配置的信息控制节点链接到用于管理已配置的信息控制节点的第二队列和第三队列中,在第三队列非空时,从第三队列中卸载单位数据的已配置的信息控制节点,根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,播放对应的待播放音频数据,进而将卸载的已配置的信息控制节点链接到管理已播放音频数据的信息控制节点的第四队列中。通过队列的形式,可以实时地对待播放音频数据的属性信息进行配置,并对待播放音频数据和已播放音频数据分别进行管理,同时,根据已配置的信息控制节点,读取相应的待播放音频数据,无需像现有技术那样,将待播放音频数据拷贝到另外一块内存空间上,读取拷贝后的内存空间上的待播放音频数据所带来的问题。采用本发明实施例所述的技术方案,在待播音频数据不会被覆盖的同时,省去之前备份用的内存空间的开辟和使用,剔除频繁的内存拷贝对系统性能的影响,省去了内存对齐动作进而简化操作流程,规避复杂的内存池实现、管理及后期维护的开销,简化了设计思路,即本发明实施例在避免设置内存池的同时实现待播放音频数据不会被覆盖的问题。The embodiment of the present invention provides an apparatus for processing audio data, by setting a first queue for managing an information control node to be configured, and when the threshold interrupt is triggered, the information to be configured of the unit data is unloaded from the first queue. Controlling the node, and configuring the unloaded information control node to be unloaded according to the to-be-played audio data captured when the threshold is interrupted, linking the configured information control node to the second queue and the second queue for managing the configured information control node In the three queues, when the third queue is not empty, the configured information control node that unloads the unit data from the third queue controls the attribute information of the audio data to be played in the node according to the configured information of the uninstallation, and plays the corresponding to-be-played The audio data is played, and the unloaded configured information control node is linked to the fourth queue of the information control node that manages the played audio data. Through the form of the queue, the attribute information of the played audio data can be configured in real time, and the audio data to be played and the played audio data are separately managed, and at the same time, the node is controlled according to the configured information, and the corresponding audio data to be played is read. There is no need to copy the audio data to be played to another memory space as in the prior art, and read the problem caused by the audio data to be played on the copied memory space. By adopting the technical solution described in the embodiment of the present invention, the audio data to be broadcasted is not covered, the development and use of the memory space used for backup is omitted, and the influence of frequent memory copy on system performance is eliminated, and the effect is eliminated. The memory alignment action simplifies the operation process, circumvents the complexity of the memory pool implementation, management, and maintenance, and simplifies the design. The embodiment of the present invention avoids setting the memory pool while preventing the audio data to be played from being overwritten. .

实施例四Embodiment 4

本发明实施例还提供一种音频数据的处理系统,如图11所示,该系统160包括:The embodiment of the present invention further provides a processing system for audio data. As shown in FIG. 11, the system 160 includes:

输入模块1601,用于接收多个电视通路输入的音频数据;The input module 1601 is configured to receive audio data input by multiple television channels;

通路切换模块1602,用于切换不同的电视通路;a path switching module 1602, configured to switch between different television channels;

音频捕获模块1603,用于捕获不同通路的音频数据;An audio capture module 1603, configured to capture audio data of different paths;

缓冲区1604,用于缓存音频捕获模块1603捕获的音频数据;以 及,a buffer 1604, configured to cache audio data captured by the audio capture module 1603; and,

控制读取模块1605,用于控制读取缓冲区1604中的音频数据;Controlling the reading module 1605, for controlling the audio data in the read buffer 1604;

其中,控制读取模块1605包括:The control reading module 1605 includes:

节点卸载单元,用于当接收到触发指令时,从第一队列中卸载单位数据的待配置的信息控制节点,并对卸载的待配置的信息控制节点进行配置,已配置的信息控制节点包含待播放音频数据的属性信息,第一队列中包含至少一个待配置的信息控制节点;a node unloading unit, configured to: when the triggering instruction is received, unload the information control node to be configured of the unit data from the first queue, and configure the offloaded information control node to be configured, where the configured information control node includes Playing attribute information of the audio data, where the first queue includes at least one information control node to be configured;

节点链接单元,用于将已配置的信息控制节点链接到第二队列和第三队列中,第二队列和第三队列均用于管理已配置的信息控制节点;a node linking unit, configured to link the configured information control node to the second queue and the third queue, where the second queue and the third queue are used to manage the configured information control node;

节点卸载单元,用于从第三队列中卸载单位数据的已配置的信息控制节点;a node unloading unit, configured to unload unit data from the third queue;

读取单元,用于根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,读取对应的待播放音频数据;a reading unit, configured to control attribute information of the to-be-played audio data in the node according to the unconfigured configured information, and read corresponding audio data to be played;

节点链接单元,还用于将卸载的已配置的信息控制节点链接到第四队列,第四队列用于管理已播放音频数据的信息控制节点;a node linking unit, configured to link the uninstalled configured information control node to the fourth queue, where the fourth queue is used to manage the information control node of the played audio data;

该系统160还包括音频后处理模块1606,用于对读取单元读取的音频数据进行预设音效处理;以及The system 160 further includes an audio post-processing module 1606 for performing preset sound processing on the audio data read by the reading unit;

音频播放模块1607,用于播放音频后处理模块1606处理的音频数据。The audio playing module 1607 is configured to play the audio data processed by the audio post-processing module 1606.

进一步的,如图11所示,该系统160还包括:文件存储模块1608;其中,文件存储模块1608,用于将音频捕获模块1603捕获的音频数据存储在文件中;Further, as shown in FIG. 11 , the system 160 further includes: a file storage module 1608; wherein the file storage module 1608 is configured to store audio data captured by the audio capture module 1603 in a file;

音频播放模块1607还用于播放文件存储模块1608中存储的音频数据。The audio play module 1607 is also used to play the audio data stored in the file storage module 1608.

其中,对于控制读取模块1605的描述,可以参考实施例一至实施例三中对音频数据的处理装置所描述的,在此不再赘述。For the description of the control reading module 1605, reference may be made to the processing device for the audio data in the first embodiment to the third embodiment, and details are not described herein again.

具体的,对于输入模块1601为音频数据的输入来源,包括ATV Demod、AV、Component、VGA、HDMI等电视通路;Specifically, the input module 1601 is an input source of audio data, including ATV Demod, AV, Component, VGA, HDMI, and the like;

通路切换模块1602负责上述各电视通路进行切换,并打通所切 换的电视通路;The path switching module 1602 is responsible for switching the above-mentioned television channels and opening and cutting Changed TV channel;

音频捕获模块1603负责捕获各电视通路中的音频数据,该模块主要由CPU控制WDMA实现,其中包括音频缓冲区,音频缓冲区为一片暂存捕获的音频数据的内存区域;The audio capture module 1603 is responsible for capturing audio data in each television channel. The module is mainly implemented by a CPU to control WDMA, including an audio buffer, and the audio buffer is a memory area for temporarily storing the captured audio data;

文件存储模块1608将音频捕获模块1603捕获的所切换到的电视通路上的音频数据实时存储在文件中,该音频数据可以用作电视产品的开机音乐,也可以通过网络或USB接口,作为本地音频进行播放,播放的过程中可以通过感官验证音频捕获模块捕获到的音频数据的正确性。另外,还可以作为软硬件研发人员实现相关音频后处理功能(例如:采样率转换(英文:Sample Rate Convert)的测试源用;The file storage module 1608 stores the audio data on the switched TV channel captured by the audio capture module 1603 in a file in real time, and the audio data can be used as the boot music of the television product, or can be used as a local audio through a network or a USB interface. During playback, the correctness of the audio data captured by the audio capture module can be verified by the sensory verification process. In addition, it can also be used as a hardware and hardware developer to implement related audio post-processing functions (for example, sample rate conversion (English: Sample Rate Convert) test source;

控制读取模块1605将音频数据由音频缓冲区经由AXI(Advanced eXtensible Interface)高速总线读取到音频信号线上,该模块主要由CPU控制RDMA实现,读取音频捕获模块捕获到的音频数据,并将其通过音频数据传输线送往音频后处理模块1606;The control reading module 1605 reads the audio data from the audio buffer to the audio signal line via the AXI (Advanced eXtensible Interface) high-speed bus, and the module is mainly controlled by the CPU to control the RDMA, and reads the audio data captured by the audio capture module, and Passing it to the audio post-processing module 1606 through the audio data transmission line;

音频后处理模块1606用于对控制读取模块1605读取的音频数据进行一系列音效方面的处理,如AVC(Automatic Volume Control,自动音量控制)、SRC、EQ(Equalizer,均衡)、Balance(均衡)等;The audio post-processing module 1606 is configured to perform a series of sound effects processing on the audio data read by the control reading module 1605, such as AVC (Automatic Volume Control), SRC, EQ (Equalizer), Balance (balance). )Wait;

音频播放模块1607,将经过音频后处理单元1606处理后的音频数据,或文件存储模块1608存储的音频数据经由喇叭、耳机、Spdif或Subwoofer播放输出。The audio playing module 1607 outputs the audio data processed by the audio post-processing unit 1606 or the audio data stored by the file storage module 1608 via a speaker, earphone, Spdif or Subwoofer.

对于系统实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。For the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.

需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在 没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply such entities or operations. There is any such actual relationship or order between them. Furthermore, the terms "comprises" or "comprising" or "comprising" or any other variations are intended to encompass a non-exclusive inclusion, such that a process, method, item, Other elements, or elements that are inherent to such a process, method, commodity, or equipment. In The elements defined by the phrase "comprising a ..." are not excluded, and there are no additional equivalents in the process, method, item, or device including the element.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理包括,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium. The software functional units described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform portions of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, and the program code can be stored. Medium.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。 Finally, it should be noted that the above embodiments are only for explaining the technical solutions of the present invention, and are not limited thereto; although the present invention has been described in detail with reference to the foregoing embodiments, It should be understood by those skilled in the art that the technical solutions described in the foregoing embodiments may be modified, or some of the technical features may be equivalently replaced; and the modifications or replacements do not deviate from the essence of the corresponding technical solutions. The spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims (23)

一种音频数据的处理方法,其特征在于,包括:A method for processing audio data, comprising: 当接收到触发指令时,从第一队列中卸载单位数据的待配置的信息控制节点,并对所述卸载的待配置的信息控制节点进行配置,已配置的信息控制节点包含待播放音频数据的属性信息,所述第一队列中包含至少一个待配置的信息控制节点;When the triggering instruction is received, the information control node to be configured of the unit data is unloaded from the first queue, and the unloaded information control node to be configured is configured, and the configured information control node includes the audio data to be played. Attribute information, the first queue includes at least one information control node to be configured; 将所述已配置的信息控制节点链接到第二队列和第三队列中,所述第二队列和所述第三队列均用于管理已配置的信息控制节点;Linking the configured information control node to the second queue and the third queue, the second queue and the third queue are both used to manage the configured information control node; 从所述第三队列中卸载单位数据的已配置的信息控制节点;Unconfiguring the configured information control node of the unit data from the third queue; 根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,读取对应的待播放音频数据;The attribute information of the to-be-played audio data in the node is controlled according to the unconfigured configured information, and the corresponding audio data to be played is read; 将所述卸载的已配置的信息控制节点链接到第四队列,所述第四队列用于管理已播放音频数据的信息控制节点。The offloaded configured information control node is linked to a fourth queue for managing an information control node that has played audio data. 根据权利要求1所述的方法,其特征在于,所述当接收到触发指令时,从所述第一队列中卸载单位数据的待配置的信息控制节点,并对所述卸载的待配置的信息控制节点进行配置之前,所述方法还包括:The method according to claim 1, wherein when the triggering instruction is received, the information control node to be configured of the unit data is unloaded from the first queue, and the information to be configured for the uninstallation is Before the control node is configured, the method further includes: 采用直接内存写入WDMA捕获待播放音频数据,其中,所述WDMA与第一缓冲区对应,所述第一缓冲区中包括读指针和写指针;The audio data to be played is captured by the direct memory write WDMA, wherein the WDMA corresponds to the first buffer, and the first buffer includes a read pointer and a write pointer; 检测所述第一缓冲区中写指针和读指针的差值是否大于或等于第一预设阈值;Detecting whether a difference between the write pointer and the read pointer in the first buffer is greater than or equal to a first preset threshold; 若所述第一缓冲区中写指针和读指针的差值大于或等于所述第一预设阈值,则触发阈值中断,生成所述触发指令。And if the difference between the write pointer and the read pointer in the first buffer is greater than or equal to the first preset threshold, triggering a threshold interrupt to generate the trigger instruction. 根据权利要求2所述的方法,其特征在于,所述当接收到触发指令时,从所述第一队列中卸载单位数据的待配置的信息控制节点,并对所述卸载的待配置的信息控制节点进行配置,包括:The method according to claim 2, wherein when the triggering instruction is received, the information control node to be configured of the unit data is unloaded from the first queue, and the information to be configured for the uninstallation is The control node is configured, including: 根据所述触发指令,从所述第一队列中卸载单位数据的待配置的信息控制节点;Unloading the information control node of the unit data to be configured from the first queue according to the triggering instruction; 根据所述第一缓冲区中从所述读指针到所述写指针之间的待播 放音频数据,对所述卸载的待配置的信息控制节点进行配置。According to the pending broadcast from the read pointer to the write pointer in the first buffer The audio data is played, and the unloaded information control node to be configured is configured. 根据权利要求3所述的方法,其特征在于,所述根据所述第一缓冲区中从所述读指针到所述写指针之间的待播放音频数据,对所述卸载的待配置的信息控制节点进行配置包括:The method according to claim 3, wherein said information to be configured for said unloading is based on audio data to be played between said read pointer and said write pointer in said first buffer The configuration of the control node includes: 将所述待播放音频数据的起始地址、所述待播放音频数据的长度配置在所述卸载的待配置的信息控制节点中。The start address of the to-be-played audio data and the length of the to-be-played audio data are configured in the offloaded information control node to be configured. 根据权利要求1所述的方法,其特征在于,所述根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,读取对应的待播放音频数据之前,所述方法还包括:The method according to claim 1, wherein the method further comprises: before the reading of the attribute information of the audio data to be played in the node according to the unconfigured configured information, and reading the corresponding audio data to be played. 根据所述卸载的已配置的信息控制节点,对与直接内存读取RDMA对应的第二缓冲区中的配置节点进行配置,所述第二缓冲区中包括读指针、写指针以及多个配置节点,所述配置节点具有配置信息。Configuring a configuration node in a second buffer corresponding to the direct memory read RDMA according to the unconfigured configured information control node, where the second buffer includes a read pointer, a write pointer, and a plurality of configuration nodes The configuration node has configuration information. 根据权利要求5所述的方法,其特征在于,所述待播放音频数据的属性信息中包括所述待播放音频数据的起始地址,以及所述待播放音频数据的长度,所述配置信息中包括所述配置节点的起始地址参数,以及对应的长度参数;The method according to claim 5, wherein the attribute information of the audio data to be played includes a start address of the audio data to be played, and a length of the audio data to be played, in the configuration information. Include a starting address parameter of the configuration node, and a corresponding length parameter; 所述根据所述卸载的已配置的信息控制节点,对与直接内存读取RDMA对应的第二缓冲区中的配置节点进行配置包括:The configuring, according to the offloaded configured information control node, the configuration node in the second buffer corresponding to the direct memory read RDMA includes: 确定所述第二缓冲区中的写指针所指向的目标配置节点;Determining a target configuration node pointed to by the write pointer in the second buffer; 将所述目标配置节点的起始地址参数设置为所述待播放音频数据的起始地址;Setting a starting address parameter of the target configuration node to a starting address of the audio data to be played; 将所述目标配置节点的长度参数设置为所述待播放音频数据的数据长度。Setting a length parameter of the target configuration node to a data length of the audio data to be played. 根据权利要求6所述的方法,其特征在于,所述根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,读取对应的待播放音频数据包括:The method according to claim 6, wherein the controlling the attribute information of the audio data to be played in the node according to the unconfigured configured information, and reading the corresponding audio data to be played comprises: 更新所述第二缓冲区中的写指针;Updating a write pointer in the second buffer; 计算所述第二缓冲区中的写指针与读指针的差值;Calculating a difference between the write pointer and the read pointer in the second buffer; 若所述第二缓冲区中的写指针与读指针的差值大于或等于第二 预设阈值,则读取所述第二缓冲区中的读指针所指向的配置节点对应的待播放音频数据。If the difference between the write pointer and the read pointer in the second buffer is greater than or equal to the second The preset threshold is used to read the audio data to be played corresponding to the configuration node pointed by the read pointer in the second buffer. 根据权利要求7所述的方法,其特征在于,所述第二缓冲区为环形缓冲区,所述更新所述第二缓冲区中的写指针的步骤包括:The method according to claim 7, wherein the second buffer is a ring buffer, and the step of updating the write pointer in the second buffer comprises: 判断所述目标配置节点是否为所述第二缓冲区的最后一个配置节点;Determining whether the target configuration node is the last configuration node of the second buffer; 若是,则配置所述第二缓冲区中的写指针为所述第二缓冲区的起始地址对应的第一个配置节点所在的位置;If yes, configuring the write pointer in the second buffer to be the location of the first configuration node corresponding to the start address of the second buffer; 若否,则配置所述第二缓冲区中的写指针为所述第二缓冲区中所述目标配置节点的下一个配置节点的位置。If not, configuring the write pointer in the second buffer to be the location of the next configuration node of the target configuration node in the second buffer. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method of claim 5, wherein the method further comprises: 确定所述第二缓冲区中读指针所在的位置;Determining a location of the read pointer in the second buffer; 计算所述第二缓冲区中第一标记指针和第二标记指针的差值,所述第一标记指针指向所述第二缓冲区中的读指针所在位置的上一个配置节点所在的位置,所述第二标记指针为上一次释放时所述第一标记指针所在的位置;Calculating a difference between the first mark pointer and the second mark pointer in the second buffer, where the first mark pointer points to a position of a previous configuration node where the read pointer in the second buffer is located, The second mark pointer is a position where the first mark pointer is located when the last release is performed; 若所述第二缓冲区中第一标记指针和第二标记指针的差值大于或等于第三预设阈值,则将所述第四队列中与所述第一标记指针和所述第二标记指针之间已配置的配置节点对应的已播放音频数据的信息控制节点卸载。And if the difference between the first marker pointer and the second marker pointer in the second buffer is greater than or equal to a third preset threshold, then the fourth marker and the first marker pointer and the second marker are The information of the played audio data corresponding to the configured configuration node between the pointers controls the node to be unloaded. 根据权利要求1所述的方法,其特征在于,若与所述卸载的已配置的信息控制节点对应的待播放音频数据被播放后,所述方法还包括:The method according to claim 1, wherein the method further comprises: if the audio data to be played corresponding to the unloaded configured information control node is played, 将所述第二队列中与已播放音频数据对应的已配置的信息控制节点卸载并释放;Unconfiguring and releasing the configured information control node corresponding to the played audio data in the second queue; 将所述第二队列中卸载并释放的信息控制节点链接到所述第一队列中。An information control node that is unloaded and released in the second queue is linked to the first queue. 根据权利要求1所述的方法,其特征在于,所述待播放音频数据为第一通路的音频数据; The method according to claim 1, wherein the audio data to be played is audio data of a first path; 所述根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,读取对应的待播放音频数据之后,所述方法还包括:The method further includes: after the function information of the to-be-played audio data in the node is controlled according to the uninstalled configured information, and the corresponding to-be-played audio data is read, the method further includes: 检测是否从第一通路切换到第二通路;Detecting whether to switch from the first path to the second path; 若检测到从所述第一通路切换到所述第二通路,则卸载并释放所述第三队列中剩余的已配置的信息控制节点。If it is detected that switching from the first path to the second path, the configured configured information control node remaining in the third queue is unloaded and released. 一种音频数据的处理装置,其特征在于,包括:An apparatus for processing audio data, comprising: 节点卸载单元,用于当接收到触发指令时,从第一队列中卸载单位数据的待配置的信息控制节点,并对所述卸载的待配置的信息控制节点进行配置,已配置的信息控制节点包含待播放音频数据的属性信息,所述第一队列中包含至少一个待配置的信息控制节点;a node unloading unit, configured to: when the triggering instruction is received, uninstall the information control node of the unit data to be configured from the first queue, and configure the unconfigured information control node to be configured, and the configured information control node Attribute information including audio data to be played, the first queue includes at least one information control node to be configured; 节点链接单元,用于将所述已配置的信息控制节点链接到第二队列和第三队列中,所述第二队列和所述第三队列均用于管理已配置的信息控制节点;a node linking unit, configured to link the configured information control node to the second queue and the third queue, where the second queue and the third queue are both used to manage the configured information control node; 所述节点卸载单元,用于从所述第三队列中卸载单位数据的已配置的信息控制节点;The node unloading unit is configured to uninstall the configured information control node of the unit data from the third queue; 读取单元,用于根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,读取对应的待播放音频数据;a reading unit, configured to control attribute information of the to-be-played audio data in the node according to the unconfigured configured information, and read corresponding audio data to be played; 所述节点链接单元,还用于将所述卸载的已配置的信息控制节点链接到第四队列,所述第四队列用于管理已播放音频数据的信息控制节点。The node linking unit is further configured to link the unloaded configured information control node to a fourth queue, where the fourth queue is used to manage an information control node that has played audio data. 根据权利要求12所述的装置,其特征在于,所述装置还包括:The device of claim 12, wherein the device further comprises: 捕获单元,用于采用直接内存写入WDMA捕获待播放音频数据,其中,所述WDMA与第一缓冲区对应,所述第一缓冲区中包括读指针和写指针;a capture unit, configured to capture audio data to be played by using a direct memory write WDMA, where the WDMA corresponds to a first buffer, and the first buffer includes a read pointer and a write pointer; 检测单元,用于检测所述第一缓冲区中写指针和读指针的差值是否大于或等于第一预设阈值;a detecting unit, configured to detect whether a difference between the write pointer and the read pointer in the first buffer is greater than or equal to a first preset threshold; 触发单元,用于若所述第一缓冲区中写指针和读指针的差值大于或等于所述第一预设阈值,则触发所述阈值中断,生成所述触发指令。 The triggering unit is configured to trigger the threshold interrupt to generate the triggering instruction if a difference between the write pointer and the read pointer in the first buffer is greater than or equal to the first preset threshold. 根据权利要求13所述的装置,其特征在于,所述装置还包括:第一配置单元;The device according to claim 13, wherein the device further comprises: a first configuration unit; 所述节点卸载单元,具体用于根据所述触发指令,从所述第一队列中卸载单位数据的待配置的信息控制节点;The node unloading unit is specifically configured to: according to the triggering instruction, offload the information control node of the unit data to be configured from the first queue; 所述第一配置单元,具体用于根据所述第一缓冲区中从所述读指针到所述写指针之间的待播放音频数据,对所述卸载的待配置的信息控制节点进行配置。The first configuration unit is configured to configure, according to the to-be-played audio data from the read pointer to the write pointer in the first buffer, the offloaded information control node to be configured. 根据权利要求14所述的装置,其特征在于,所述第一配置单元,具体用于将所述待播放音频数据的起始地址、所述待播放音频数据的长度配置在所述卸载的待配置的信息控制节点中。The device according to claim 14, wherein the first configuration unit is configured to configure a start address of the to-be-played audio data and a length of the to-be-played audio data in the unloading The configured information is in the control node. 根据权利要求12所述的装置,其特征在于,所述装置还包括:第二配置单元;The device according to claim 12, wherein the device further comprises: a second configuration unit; 所述第二配置单元,用于根据所述卸载的已配置的信息控制节点,对与直接内存读取RDMA对应的第二缓冲区中的配置节点进行配置,所述第二缓冲区中包括读指针、写指针以及多个配置节点,所述配置节点具有配置信息。The second configuration unit is configured to configure, according to the uninstalled configured information control node, a configuration node in a second buffer corresponding to the direct memory read RDMA, where the second buffer includes reading A pointer, a write pointer, and a plurality of configuration nodes, the configuration node having configuration information. 根据权利要求16所述的装置,其特征在于,所述待播放音频数据的属性信息中包括所述待播放音频数据的起始地址,以及所述待播放音频数据的长度,所述配置信息中包括所述配置节点的起始地址参数,以及对应的长度参数;The device according to claim 16, wherein the attribute information of the audio data to be played includes a start address of the audio data to be played, and a length of the audio data to be played, in the configuration information. Include a starting address parameter of the configuration node, and a corresponding length parameter; 所述第二配置单元包括:The second configuration unit includes: 确定子单元,用于确定所述第二缓冲区中的写指针所指向的目标配置节点;Determining a subunit, configured to determine a target configuration node pointed to by the write pointer in the second buffer; 配置子单元,用于将所述目标配置节点的起始地址参数设置为所述待播放音频数据的起始地址;a configuration subunit, configured to set a start address parameter of the target configuration node to a start address of the audio data to be played; 所述配置子单元,还用于将所述目标配置节点的长度参数设置为所述待播放音频数据的数据长度。The configuration subunit is further configured to set a length parameter of the target configuration node to a data length of the audio data to be played. 根据权利要求17所述的装置,其特征在于,所述读取单元包括: The apparatus according to claim 17, wherein said reading unit comprises: 更新子单元,用于更新所述第二缓冲区中的写指针;Updating a subunit for updating a write pointer in the second buffer; 计算子单元,用于计算所述第二缓冲区中的写指针与读指针的差值;a calculation subunit, configured to calculate a difference between the write pointer and the read pointer in the second buffer; 读取子单元,用于若所述第二缓冲区中的写指针与读指针的差值大于或等于第二预设阈值,则读取所述第二缓冲区中的读指针所指向的配置节点对应的待播放音频数据。Reading a subunit, configured to read a configuration pointed by the read pointer in the second buffer if a difference between the write pointer and the read pointer in the second buffer is greater than or equal to a second preset threshold The audio data to be played corresponding to the node. 根据权利要求16所述的装置,其特征在于,所述第二缓冲区为环形缓冲区;所述更新子单元,具体用于:The device according to claim 16, wherein the second buffer is a ring buffer; the update subunit is specifically configured to: 判断所述目标配置节点是否为所述第二缓冲区的最后一个配置节点;Determining whether the target configuration node is the last configuration node of the second buffer; 若是,则配置所述第二缓冲区中的写指针为所述第二缓冲区的起始地址对应的第一个配置节点所在的位置;If yes, configuring the write pointer in the second buffer to be the location of the first configuration node corresponding to the start address of the second buffer; 若否,则配置所述第二缓冲区中的写指针为所述第二缓冲区中所述目标配置节点的下一个配置节点的位置。If not, configuring the write pointer in the second buffer to be the location of the next configuration node of the target configuration node in the second buffer. 根据权利要求16所述的装置,其特征在于,所述装置还包括:确定单元和计算单元;The device according to claim 16, wherein the device further comprises: a determining unit and a calculating unit; 所述确定单元,用于确定所述第二缓冲区中读指针所在的位置;The determining unit is configured to determine a location where the read pointer is located in the second buffer; 所述计算单元,用于计算所述第二缓冲区中第一标记指针和第二标记指针的差值,所述第一标记指针指向所述第二缓冲区中的读指针所在位置的上一个配置节点所在的位置,所述第二标记指针为上一次释放时所述第一标记指针所在的位置;The calculating unit is configured to calculate a difference between the first mark pointer and the second mark pointer in the second buffer, where the first mark pointer points to a previous position of the read pointer in the second buffer Configuring a location where the node is located, where the second marker pointer is a location where the first marker pointer is located when the user is released last time; 所述确定单元,还用于若所述计算单元计算出所述第二缓冲区中第一标记指针和第二标记指针的差值大于或等于第三预设阈值,则将所述第四队列中与所述第一标记指针和所述第二标记指针之间已配置的配置节点对应的已播放音频数据的信息控制节点卸载。The determining unit is further configured to: if the calculating unit calculates that the difference between the first marker pointer and the second marker pointer in the second buffer is greater than or equal to a third preset threshold, then the fourth queue The information control node in the played audio data corresponding to the configured configuration node between the first marker pointer and the second marker pointer is offloaded. 根据权利要求12所述的装置,其特征在于,The device according to claim 12, characterized in that 所述节点卸载单元,还用于将所述第二队列中与已播放音频数据对应的已配置的信息控制节点卸载并释放;The node unloading unit is further configured to uninstall and release the configured information control node corresponding to the played audio data in the second queue; 所述节点链接单元,还用于将所述第二队列中卸载并释放的信息 控制节点链接到所述第一队列中。The node linking unit is further configured to: uninstall and release information in the second queue A control node is linked into the first queue. 根据权利要求12所述的装置,其特征在于,所述待播放音频数据为第一通路的音频数据;The device according to claim 12, wherein the audio data to be played is audio data of the first path; 所述检测单元,还用于检测是否从第一通路切换到第二通路;The detecting unit is further configured to detect whether to switch from the first path to the second path; 所述节点卸载单元,还用于若检测到从所述第一通路切换到所述第二通路,则卸载并释放所述第三队列中剩余的已配置的信息控制节点。The node unloading unit is further configured to: if the switch from the first path to the second path is detected, uninstall and release the configured information control node remaining in the third queue. 一种音频数据的处理系统,其特征在于,包括:A processing system for audio data, comprising: 输入模块,用于接收多个电视通路输入的音频数据;An input module, configured to receive audio data input by multiple television channels; 通路切换模块,用于切换不同的电视通路;a path switching module for switching different television channels; 音频捕获模块,用于捕获不同通路的音频数据;An audio capture module for capturing audio data of different paths; 缓冲区,用于缓存所述音频捕获模块捕获的音频数据;以及,a buffer for buffering audio data captured by the audio capture module; 控制读取模块,用于控制读取所述缓冲区中的音频数据;Controlling a reading module for controlling reading of audio data in the buffer; 其中,所述控制读取模块包括:The control reading module includes: 节点卸载单元,用于当接收到触发指令时,从第一队列中卸载单位数据的待配置的信息控制节点,并对所述卸载的待配置的信息控制节点进行配置,已配置的信息控制节点包含待播放音频数据的属性信息,所述第一队列中包含至少一个待配置的信息控制节点;a node unloading unit, configured to: when the triggering instruction is received, uninstall the information control node of the unit data to be configured from the first queue, and configure the unconfigured information control node to be configured, and the configured information control node Attribute information including audio data to be played, the first queue includes at least one information control node to be configured; 节点链接单元,用于将所述已配置的信息控制节点链接到第二队列和第三队列中,所述第二队列和所述第三队列均用于管理已配置的信息控制节点;a node linking unit, configured to link the configured information control node to the second queue and the third queue, where the second queue and the third queue are both used to manage the configured information control node; 所述节点卸载单元,用于从所述第三队列中卸载单位数据的已配置的信息控制节点;The node unloading unit is configured to uninstall the configured information control node of the unit data from the third queue; 读取单元,用于根据卸载的已配置的信息控制节点中待播放音频数据的属性信息,读取对应的待播放音频数据;a reading unit, configured to control attribute information of the to-be-played audio data in the node according to the unconfigured configured information, and read corresponding audio data to be played; 所述节点链接单元,还用于将所述卸载的已配置的信息控制节点链接到第四队列,所述第四队列用于管理已播放音频数据的信息控制节点;The node linking unit is further configured to link the uninstalled configured information control node to a fourth queue, where the fourth queue is used to manage an information control node that has played audio data; 所述系统还包括音频后处理模块,用于对所述读取单元读取的音 频数据进行预设音效处理;以及The system also includes an audio post-processing module for reading the sound of the reading unit Frequency data for preset sound processing; 音频播放模块,用于播放所述音频后处理模块处理的音频数据。 And an audio playing module, configured to play audio data processed by the audio post-processing module.
PCT/CN2016/072032 2015-09-28 2016-01-25 Audio data processing method, apparatus and system Ceased WO2017054378A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510631096.6 2015-09-28
CN201510631096.6A CN106559705B (en) 2015-09-28 2015-09-28 A kind of processing method of audio data, device and system

Publications (1)

Publication Number Publication Date
WO2017054378A1 true WO2017054378A1 (en) 2017-04-06

Family

ID=58416842

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/072032 Ceased WO2017054378A1 (en) 2015-09-28 2016-01-25 Audio data processing method, apparatus and system

Country Status (2)

Country Link
CN (1) CN106559705B (en)
WO (1) WO2017054378A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115696173A (en) * 2022-09-14 2023-02-03 合肥杰发科技有限公司 Chip, vehicle sound source playing method, vehicle-mounted equipment and storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108053821B (en) * 2017-12-12 2022-09-06 腾讯科技(深圳)有限公司 Method and apparatus for generating audio data
CN109743668B (en) * 2019-01-04 2021-06-22 深圳时空壶技术有限公司 Audio testing method and device
CN116246655A (en) * 2023-03-14 2023-06-09 北斗星通智联科技有限责任公司 Audio processing method, device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004318467A (en) * 2003-04-16 2004-11-11 Sony Corp Memory control method and memory control device
CN101330472A (en) * 2008-07-28 2008-12-24 中兴通讯股份有限公司 Cache processing method for streaming media data
CN101404764A (en) * 2008-10-30 2009-04-08 宁波中科集成电路设计中心有限公司 Internal memory management method in audio/video decoding course
CN104505109A (en) * 2014-12-29 2015-04-08 珠海全志科技股份有限公司 Audio track switching method and system of multimedia player and corresponding player and equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080301189A1 (en) * 2007-05-31 2008-12-04 Ads Holdings, Llc. System and method for providing a real-time content distribution network
CN102521279A (en) * 2011-11-25 2012-06-27 Tcl集团股份有限公司 Playing method, playing system and player of streaming media files

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004318467A (en) * 2003-04-16 2004-11-11 Sony Corp Memory control method and memory control device
CN101330472A (en) * 2008-07-28 2008-12-24 中兴通讯股份有限公司 Cache processing method for streaming media data
CN101404764A (en) * 2008-10-30 2009-04-08 宁波中科集成电路设计中心有限公司 Internal memory management method in audio/video decoding course
CN104505109A (en) * 2014-12-29 2015-04-08 珠海全志科技股份有限公司 Audio track switching method and system of multimedia player and corresponding player and equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115696173A (en) * 2022-09-14 2023-02-03 合肥杰发科技有限公司 Chip, vehicle sound source playing method, vehicle-mounted equipment and storage medium

Also Published As

Publication number Publication date
CN106559705B (en) 2019-07-12
CN106559705A (en) 2017-04-05

Similar Documents

Publication Publication Date Title
US8738884B2 (en) Efficient loading of data into memory of a computing system
WO2017005010A1 (en) Audio processing method and device, and computer storage medium
WO2017054378A1 (en) Audio data processing method, apparatus and system
CN106559706A (en) A kind of processing method of voice data, device and system
CN110019527B (en) Slave library reading method, related device and equipment
AU2021202098B2 (en) Multimedia data playing method and terminal device
JP7691463B2 (en) MEMORY-EFFICIENT SOFTWARE PATCHING FOR UPDATING APPLICATIONS ON A COMPUTING DEVICE - Patent application
CN109599133B (en) Language audio track switching method and device, computer equipment and storage medium
US10171868B2 (en) Method for processing audio data, terminal and television
CN104601535A (en) Video processing method and system
US8416658B2 (en) Recording apparatus and recording method for data and file system information
US8938596B2 (en) Storage apparatus, control apparatus, and storage apparatus control method
US7684883B2 (en) Information processing apparatus, information processing method, and program
JP2005317115A (en) Information processing apparatus, information processing method, and program
WO2017054376A1 (en) Audio data processing method and apparatus
US8730348B2 (en) Recording apparatus and control method thereof
US20180052786A1 (en) Improvement in sending of multimedia streams
EP4068692A1 (en) Blockchain system, program, and network connection device
WO2025246677A1 (en) Video editing method and device, and storage medium
KR101795258B1 (en) Snapshot boot in cloud network
CN103780947A (en) Apparatus for receiving broadcast and method of managing file used for time shift
CN106445402A (en) Storage unit formatting method and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16850012

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16850012

Country of ref document: EP

Kind code of ref document: A1