Embodiments included herein generally relate to processing data samples. More particularly, embodiments relate to processing a plurality of data samples using a multi-agent ring-buffer and a plurality of agents configured to communicate within the ring-buffer to process each of the plurality of data samples.
In a data processing flow, content may be processed by a number of components in communication with one another. In these data processing flows, the components are commonly structured in a sequential fashion, and to facilitate communications between the components, the components may store data in one or more buffers. Commonly this processing flow is implemented with data queues. However, when queues are used, it may be difficult to determine exactly how much data is contained in the processing flow between the input and output stages. For example, the individual processing agents within the data flow may mis-report the amount of data in their queues, and the amount of data they are currently processing. For real-time processing systems, it is critical to know exactly how much data is contained within the flow so the system may predict, with high precision, when data at the input of the flow will exit the output of the flow. In addition, knowing exactly how much data is within a flow, and how much data each individual stage of the flow has at its input assists the system in properly scheduling processing resources to guarantee a predictable, low latency from the input of the flow to the output.
The accompanying drawings, which are incorporated herein and form a part of the specification.
In the drawings, like reference numbers generally indicate identical or similar elements. Additionally, generally, the left-most digit(s) of a reference number identifies the drawing in which the reference number first appears.
Provided herein are system, apparatus, article of manufacture, method and/or computer program product embodiments, and/or combinations and sub-combinations thereof, for using a multi-agent ring-buffer and a plurality of agents configured to communicate with the ring-buffer to process each of the plurality of data samples.
In some embodiments, the present disclosure is directed to a device. The device may include a ring-buffer configured to store a plurality of data samples in a plurality of partitions of the ring-buffer. Each data sample may be stored in a respective partition of the plurality of partition. The device may further include a plurality of agents configured to communicate within the ring-buffer to process each of the plurality of data samples.
In some embodiments, the present disclosure is directed to a method. The method may include: writing, by a first agent of a plurality of agents, data samples into respective partitions of a plurality of partitions of a ring-buffer; reading, by a second agent of the plurality of agents, the data samples from the respective partitions; processing, by the second agent, the data samples to generate second data samples; writing, by the second agent, the second data samples into the respective partitions; and outputting, by a third agent of the plurality of agents, the second data samples from the respective partitions.
In some embodiments, the present disclosure is directed to a non-transitory, tangible computer-readable device having instructions stored thereon that, when executed by at least one computing device, causes the at least one computing device to perform operations. The operations may include: writing, by a first agent of a plurality of agents, data samples into respective partitions of a plurality of partitions of a ring-buffer; reading, by a second agent of the plurality of agents, the data samples from the respective partitions; processing, by the second agent, the data samples to generate second data samples; writing, by the second agent, the second data samples into the respective partitions; and outputting, by a third agent of the plurality of agents, the second data samples from the respective partitions.
Further features and advantages of the embodiments disclosed herein, as well as the structure and operation of various embodiments, are described in details below with reference to the accompanying drawings. It is noted that this disclosure is not limited to the specific embodiments described herein. Such embodiments are presented herein for illustrative purposes only. Additional embodiments will be apparent to a person skilled in the relevant art based on the teachings contained herein.
Provided herein are system, method, computer program product and/or device embodiments, and/or combinations thereof, for processing a plurality of data samples using a multi-agent ring-buffer and a plurality of agents configured to communicate within the ring-buffer to process each of the plurality of data samples.
In some embodiments, media content 115 may be stored on the media source 105 and transmitted to the playback device 110, such that the playback device 110 may reproduce the media content 115. The playback device 110 may include a communication interface 125 for receiving media content 115 from the media source 105, a decoder 127 for decoding the media content 115, a ring-buffer 130 for storing data, and a plurality of agents 135 in communication with the ring-buffer 130, a processor 140, a power supply 145, a non-transitory, tangible computer readable memory (CRM) 150 used to store any number of functional components that are executable by the processor 140 and/or one or more of the plurality of agents 135, and an output 155. The communication interface 125 may include one or more interfaces and hardware components for enabling communication with various other devices. For example, communication interface 125 facilitate communication through one or more of the Internet, cellular networks, and wireless networks (e.g., Wi-Fi, cellular). In some implementations, these functional components comprise instructions or programs that are executable by the processor 140 and and/or one or more of the plurality of agents 135 that, when executed, specifically configure the processor 140 and/or one or more of the plurality of agents 135 to perform the actions described herein. In addition, the CRM 150 stores data used for performing the operations described herein. The output 155 may be, for example, an audio output of a television or wireless speaker, or the like. In some embodiments, the ring-buffer 130 may be configured to provide for precise scheduling of every audio sample sent to the output 155, e.g., a digital to analog converter of the output 155.
In some embodiments, the ring-buffer 130 may be a data structure that uses a single, fixed-size buffer. For example, the ring-buffer 130 may be a data structure having a fixed size of 2n data samples of storage capacity. The ring-buffer 130 may be divided into 2n data samples, with each data sample being represented by a respective partition. The ring-buffer 130 may be configured to store data samples of a single type within the ring-buffer 130. For example, the data samples may be single channel audio samples, two-channel audio samples, four-channel audio samples, eleven-channel audio samples, to name a few examples. In some embodiments, the type of data sample stored by the ring-buffer 130 may be defined by a user. Although the ring-buffer 130 is described as being used to process audio data samples, it should be understood by those of ordinary skill in the arts that the systems described herein may be used to process any data sample that is processed in a multi-stage data flow, such as, but not limited to, messages, characters, network packets, pointers to system memory, etc.
Based on the type of data sample being stored thereon, the ring-buffer 130 may be configured to operate at a corresponding frequency. For example, for two-channel audio samples, the ring-buffer 130 may be configured to operate at a frequency of 48 kHz. In some embodiments, the ring-buffer 130 may be configured to operate at a fixed delay. That is, the ring-buffer 130 may be configured to output an incoming data sample after, for example, 10 ms, where an input agent may write samples into the ring-buffer 130 and an output agent may output the samples 10 ms later. In some embodiments, one or more intervening agents may process the data samples between the input agent and the output agent.
In some embodiments, the ring-buffer 130 may manage and track which agents are communicating within the ring-buffer 130, e.g., reading data from or writing data to the ring-buffer 130. For example, each agent of the plurality of agents 135 may be assigned a starting position with respect to the ring-buffer (e.g., a starting partition on the ring-buffer 130), and the ring-buffer 130 may be configured to track a position of each agent 135 relative to all of the other agents 135. By tracking a starting position of each agent 135, the ring-buffer may manage (e.g., add or remove agents) based on the respective position of each of the plurality of agents 135. In some embodiments, the positions of each agent 135 communicating within the ring-buffer 130 may be continuously incremented irrespective of the size of the ring-buffer 130. The number of partitions within the ring-buffer 130 may be N, and as such, an agent 135 at position P of a continuously incrementing position may be calculated as P modulo N, as should be understood by those of ordinary skill in the art. Alternatively, an agent at position P of a continuously incrementing position may be calculated as P bitwise AND with (2n-1), as should be understood by those of ordinary skill in the art. In some embodiments, the plurality of agents 135 may be spaced apart from one another, such that the plurality of agents 135 may operate on a plurality of data samples within the ring-buffer 130 at time.
In some embodiments, the plurality of agents 135 may include one or more agents used in an audio flow process. The plurality of agents 135 may include a combination of one or more of the following: a sound source, such a microphone, a user interface (UI) sound source, a content source (e.g., a media content source); an audio renderer; an audio sink; digital signal processing and control (DSPC) unit; a pulse code modulator (PCM); a PCM combined with a presentation time stamp; a precision PCM; a mixer; and an output device, such as a speaker or the like. It should be understood that these are merely example agents that may communicate with the ring-buffer 130, and that other agents are further contemplated in accordance with aspects of the present disclosure.
In some embodiments, each agent 135 may be configured to operate on a currently available data sample of the ring-buffer 130 between the current partition and an adjacent agent 135 ahead of it in the ring-buffer 130. In this way, each agent 135 may be configured to operate on as many data samples as possible without interfering with the functions of any of the other agents 135. In further embodiments, each of the plurality of agents 135 may be configured to operate on a respective number of samples stored in the ring-buffer 130 at a time. For example, a first agent of the plurality of agents may be configured to operate on, for example, three (3) data samples at a time, whereas a second agent may be configured to operate on, for example, four (4) data samples, at a time. In some embodiments, the plurality of agents 135 may be positioned with respect to one another such that the number of data samples the respective agent is configured to operate on is the same as a distance between a agent and a preceding agent.
In some embodiments, the plurality of agents 135 may be configured to move with respect to the ring-buffer 130. In this way, the plurality of agents 135 may read and/or write data within a given partition of the ring-buffer 130 in a choreographed manner. In one example illustrated in
Subsequently, the DSPC 235(3) may read the second data from the ring-buffer 130 and process the second data to generate third data. Processing the second data may include any digital signal processing techniques as should be understood by those of ordinary skill in the art. The DSPC 235(3) may then store the third data into the given partition of the ring-buffer 130. Lastly, the output device 235(4) may read the third data and generate an audible output. In this example, the first, second, and third agents 235(1)-(3) may be configured to track a distance to the fourth agent 235(4). That is, each of the non-output agents may be configured to track a distance to an output agent. As a result, the first, second, and third agents 235(1)-(3) are configured to know when the samples stored within the ring-buffer 130 are scheduled to be output by the fourth agent 235(4). By reading and writing data to and from the ring-buffer 130, the present disclosure eliminates the need to use multiple buffers used in conventional audio processing systems and the shortcomings associated with using multiple buffers (e.g., unpredictable processing delay and loss of data synchronization, for example).
To operate in the choreographed manner, each of the plurality of agents 135 may be assigned a particular position with respect to the ring-buffer 130, as discussed above. For example, the plurality of agents 135 may positioned such that the plurality of agents 135 move in a clock-wise direction with respect to the ring-buffer 130. However, it should be understood by those of ordinary skill in the art that the plurality of agents 135 may positioned such that the plurality of agents 135 move in a counter clock-wise direction with respect to the ring-buffer 130 as well. In further embodiments, each of the plurality of agents 135 may be configured to move and operate in relation to one another. That is, the plurality of agents 135 may be configured to read, write, and/or read and process data stored in the ring-buffer based on a number of partitions having data stored thereon or available to have data written into. In some embodiments, the number of partitions available for any agent to process, e.g., read from or write to, is calculated as a position within the ring-buffer 130 of a preceding agent in the data flow minus a position of the current within the ring-buffer 130. In further embodiments, a number of partitions available to an input agent of the plurality of agents is calculated as a position of an output agent of the plurality of agents within the ring-buffer 130 plus a size of the ring-buffer 130 minus a position of the input agent.
By configuring the plurality of agents 135 to move and operate in relation to one another, the plurality agents 135 operate in a sequential manner, thereby ensuring that the plurality of agents 135 avoid operating on data stored in the ring-buffer 130 out of order, which would cause disruptions in the data flow.
In some embodiments, one or more of the plurality of agents 135 may be configured to read and process data (e.g., modify the data) stored in the ring-buffer 130 when a first minimum number of partitions have data stored thereon and to remain inactive until the first minimum number of partitions is satisfied. Using the example shown in
Furthermore, in some embodiments, one or more of the plurality of agents 135 may be configured to read data from the ring-buffer 130 when a second minimum number of partitions have data stored thereon and to remain inactive until the second minimum number of partitions is satisfied. In some embodiments, after reading the data from the second minimum number of partitions, the one or more of the plurality of agents 135 may move along the ring-buffer 130 to a partition after the last partition of the second minimum number of partitions. Again using the example shown in
Furthermore, in some embodiments, one or more of the plurality of agents 135 may be configured to write data to the ring-buffer 130 when a third minimum number of partitions are available in the ring-buffer 130 and to remain inactive until the third minimum number of partitions is satisfied. In some embodiments, after writing data into the third minimum number of partitions, the one or more of the plurality of agents 135 may move along the ring-buffer 130 to a partition after the last partition of the third minimum number of partitions. Again using the example shown in
In some embodiments, the one or more agents of the plurality of agents 135 may be configured to determine whether the minimum number of partitions (e.g., the first minimum number, the second minimum number, or the third minimum number) is available to the one or more agents 135 and to go into an inactive state until the minimum number of partitions are available. Alternatively, in some embodiments, when the one or more agents of the plurality of agents 135 are in the inactive state, the one or more agents of the plurality of agents 135 may be configured to go into an active state after a preceding agent performs its functions with respect to the ring-buffer 130 and to determine whether the minimum number of partitions is available. Once the minimum number of partitions is available, the one or more agents of the plurality of agents 135 may perform the operations described herein. By configuring the plurality of agents 135 to go into an inactive state, the present disclosure advantageously reduces the amount of resources required to operate the plurality of agents 135, as should be understood by those of ordinary skill in the arts.
In some embodiments, the agent 335(2) may be, for example, a user interface (UI) notification sound source configured to store UI sounds and to write audio samples of such UI sounds in the ring-buffer 330(2), which may, in turn, be accessed by the agent 235(2). In some embodiments, the agent 235(2) may modify, e.g., mix, the sound samples stored in the ring-buffer 130 by the agent 235(1), the sound samples stored in the ring-buffer 330(1) by the agent 335(1), and the sound samples stored in the ring-buffer 330(2) by the agent 335(2), and store the resultant mixed audio sample in the ring-buffer 130, as should be understood by those of ordinary skill in the art. To achieve this, the agents 335(2), 235(2) may communication with the ring-buffers 330(1), 330(2), respectively, in a similar manner discussed above with respect to
In some embodiments, the agent 335(3) may include a microphone, and the ring-buffer 330(3) may be configured to store data from the microphone into a partition of the ring-buffer 330(3), which may, in turn, be accessed by the agent 235(3). In further embodiments, the agent 335(3) may include a plurality of microphones, and the agent 335(3) may be configured to consolidate data samples from the plurality of microphones into a single audio sample, and store the consolidated audio sample sin the ring-buffer 330(3). As a result, the agent 235(3) may read a single output from the ring-buffer 330(3), rather than a separate output from each respective microphone. The agent 235(3) may be configured to distinguish between audio samples received from a user, e.g., audio commands received using a remote control or microphone array (e.g., the remote control 117 of
As illustrated in
Thus, in some embodiments, a pipeline of multi-agent ring-buffers may include a first ring-buffer (e.g., ring-buffer 130 of
In 520, a second agent (e.g., agent 235(2) or agent 235(3) of
In 525, the second agent may process the data samples to generate second data samples, and in 530, the second agent may write the second data samples back into the respective partition it read the data samples from.
In 540, a third agent (e.g., agent 235(4) of
It will be appreciated by those skilled in the art that the functionality of the speaker devices described herein may be performed by other entertainment devices, such as a media player, television, a wireless device, a smartphone, a tablet computer, a laptop/mobile computer, a handheld computer, a server computer, an in-appliance device, streaming media player, a game console, an audio/video receiver, and so forth.
Various embodiments can be implemented, for example, using one or more well-known computer systems, such as computer system 600 shown in
Computer system 600 includes one or more processors (also called central processing units, or CPUs), such as a processor 604. Processor 604 is connected to a communication infrastructure or bus 606.
Computer system 600 also includes user input/output device(s) 603, such as monitors, keyboards, pointing devices, etc., which communicate with communication infrastructure or bus 606 through user input/output interface(s) 602.
Computer system 600 also includes a main or primary memory 608, such as random access memory (RAM). Main memory 608 may include one or more levels of cache. Main memory 608 has stored therein control logic (i.e., computer software) and/or data.
Computer system 600 may also include one or more secondary storage devices or memory 610. Secondary memory 610 may include, for example, a hard disk drive 612 and/or a removable storage device or drive 614. Removable storage drive 614 may be a floppy disk drive, a magnetic tape drive, a compact disk drive, an optical storage device, tape backup device, and/or any other storage device/drive.
Removable storage drive 614 may interact with a removable storage unit 618. Removable storage unit 618 includes a computer usable or readable storage device having stored thereon computer software (control logic) and/or data. Removable storage unit 618 may be a floppy disk, magnetic tape, compact disk, DVD, optical storage disk, and/any other computer data storage device. Removable storage drive 614 reads from and/or writes to removable storage unit 618 in a well-known manner.
According to an exemplary embodiment, secondary memory 610 may include other means, instrumentalities or other approaches for allowing computer programs and/or other instructions and/or data to be accessed by computer system 600. Such means, instrumentalities or other approaches may include, for example, a removable storage unit 622 and an interface 620. Examples of the removable storage unit 622 and the interface 620 may include a program cartridge and cartridge interface (such as that found in video game devices), a removable memory chip (such as an EPROM or PROM) and associated socket, a memory stick and USB port, a memory card and associated memory card slot, and/or any other removable storage unit and associated interface.
Computer system 600 may further include a communication or network interface 624. Communication interface 624 enables computer system 600 to communicate and interact with any combination of remote devices, remote networks, remote entities, etc. (individually and collectively referenced by reference number 628). For example, communication interface 624 may allow computer system 600 to communicate with remote devices 628 over communications path 626, which may be wired and/or wireless, and which may include any combination of LANs, WANs, the Internet, etc. Control logic and/or data may be transmitted to and from computer system 600 via communication path 626.
In an embodiment, a tangible apparatus or article of manufacture comprising a tangible computer useable or readable medium having control logic (software) stored thereon is also referred to herein as a computer program product or program storage device. This includes, but is not limited to, computer system 600, main memory 608, secondary memory 610, and removable storage units 618 and 622, as well as tangible articles of manufacture embodying any combination of the foregoing. Such control logic, when executed by one or more data processing devices (such as computer system 600), causes such data processing devices to operate as described herein.
Based on the teachings contained in this disclosure, it will be apparent to persons skilled in the relevant art(s) how to make and use embodiments of this disclosure using data processing devices, computer systems and/or computer architectures other than that shown in
It is to be appreciated that the Detailed Description section, and not any other section, is intended to be used to interpret the claims. Other sections can set forth one or more but not all exemplary embodiments as contemplated by the inventor(s), and thus, are not intended to limit this disclosure or the appended claims in any way.
While this disclosure describes exemplary embodiments for exemplary fields and applications, it should be understood that the disclosure is not limited thereto. Other embodiments and modifications thereto are possible, and are within the scope and spirit of this disclosure. For example, and without limiting the generality of this paragraph, embodiments are not limited to the software, hardware, firmware, and/or entities illustrated in the figures and/or described herein. Further, embodiments (whether or not explicitly described herein) have significant utility to fields and applications beyond the examples described herein.
Embodiments have been described herein with the aid of functional building blocks illustrating the implementation of specified functions and relationships thereof. The boundaries of these functional building blocks have been arbitrarily defined herein for the convenience of the description. Alternate boundaries can be defined as long as the specified functions and relationships (or equivalents thereof) are appropriately performed. Also, alternative embodiments can perform functional blocks, steps, operations, methods, etc. using orderings different than those described herein.
References herein to “one embodiment,” “an embodiment,” “an example embodiment,” or similar phrases, indicate that the embodiment described can include a particular feature, structure, or characteristic, but every embodiment can not necessarily include the particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same embodiment. Further, when a particular feature, structure, or characteristic is described in connection with an embodiment, it would be within the knowledge of persons skilled in the relevant art(s) to incorporate such feature, structure, or characteristic into other embodiments whether or not explicitly mentioned or described herein. Additionally, some embodiments can be described using the expression “coupled” and “connected” along with their derivatives. These terms are not necessarily intended as synonyms for each other. For example, some embodiments can be described using the terms “connected” and/or “coupled” to indicate that two or more elements are in direct physical or electrical contact with each other. The term “coupled,” however, can also mean that two or more elements are not in direct contact with each other, but yet still co-operate or interact with each other.
The breadth and scope of this disclosure should not be limited by any of the above-described exemplary embodiments, but should be defined only in accordance with the following claims and their equivalents.
This application is a continuation of U.S. patent application Ser. No. 16/542,915, filed Aug. 16, 2019, now allowed, and is herein incorporated by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | 16542915 | Aug 2019 | US |
Child | 17485909 | US |