CN115658572A - Task processing method and device, electronic equipment and computer readable storage medium - Google Patents

Task processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN115658572A
CN115658572A CN202211587922.8A CN202211587922A CN115658572A CN 115658572 A CN115658572 A CN 115658572A CN 202211587922 A CN202211587922 A CN 202211587922A CN 115658572 A CN115658572 A CN 115658572A
Authority
CN
China
Prior art keywords
task
dma
fifo
audio
node
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.)
Granted
Application number
CN202211587922.8A
Other languages
Chinese (zh)
Other versions
CN115658572B (en
Inventor
郭飞飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiangdixian Computing Technology Chongqing Co ltd
Original Assignee
Beijing Xiangdixian Computing Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiangdixian Computing Technology Co Ltd filed Critical Beijing Xiangdixian Computing Technology Co Ltd
Priority to CN202211587922.8A priority Critical patent/CN115658572B/en
Publication of CN115658572A publication Critical patent/CN115658572A/en
Application granted granted Critical
Publication of CN115658572B publication Critical patent/CN115658572B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The present disclosure provides a task processing method, apparatus, electronic device and computer-readable storage medium, the method comprising: when the audio data amount currently stored in the FIFO reaches a first depth threshold value of the FIFO, controlling the DMA to suspend executing an audio moving task, and controlling the DMA multiplexing audio transmission channel to execute an image moving task; when the audio data amount currently stored in the FIFO is determined to be consumed to a second depth threshold value of the FIFO, controlling the DMA to pause multiplexing the audio transmission channel to execute the image moving task, and controlling the DMA to move the remaining audio data in the audio moving task to the FIFO through the audio transmission channel; the second depth threshold is greater than zero and less than the first depth threshold. By the method, the processing efficiency of the image moving task can be improved.

Description

Task processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of task processing technologies, and in particular, to a task processing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
With the progress of technology, the present video cards on the market basically support an HDMI (High Definition Multimedia Interface) Interface, which means that the video card device outputs images and simultaneously outputs sound, and accordingly, when a DMA (Direct Memory Access) in the video card device executes a move task, the DMA includes an image move task and an audio move task. The DMA transfers Audio Data (pulse code modulation (PCM) waveform Data) in the memory to a FIFO of an Audio (Audio) module through an Audio transfer channel when executing an Audio transfer task, and transfers image Data in the memory to a GDDR (Graphics Double Data Rate, double Data synchronous dynamic random access memory) through an image transfer channel when executing an image transfer task. In the process of playing Audio based on Audio data In a FIFO (First In First Out, queue), once the FIFO is empty, the Audio module will pause or output noise. Human beings are sensitive to sound, and the transient pause or noise can be captured by the human beings, so that the use feeling is influenced.
Based on the above current situation and considering the hardware cost and the complexity of hardware design, in the prior art, a dedicated DMA is generally set in the graphics card device, and an audio dedicated channel and an image dedicated channel are set for the DMA. When an audio moving task and an image moving task exist at the same time, the DMA preferentially uses the audio special channel to move audio data to the FIFO, and then uses the image transmission channel to transmit the image data after the audio moving task is executed, so as to ensure that the audio heard by a user is not interrupted. That is to say, under the condition that two tasks exist simultaneously, the DMA will be occupied by the audio moving task all the time, and the DMA will not process the image moving task until the whole audio moving task is processed, which results in lower processing efficiency of the image moving task.
Disclosure of Invention
The purpose of the disclosure is to provide a task processing method and device, an SOC, an electronic device and a readable storage medium, so as to improve the processing efficiency of an image moving task.
According to an aspect of the present disclosure, there is provided a task processing method, the method including: when the audio data amount currently stored in the FIFO reaches a first depth threshold value of the FIFO, controlling the DMA to suspend executing an audio moving task, and controlling the DMA multiplexing audio transmission channel to execute an image moving task; when the audio data amount currently stored in the FIFO is determined to be consumed to a second depth threshold value of the FIFO, controlling the DMA to pause multiplexing the audio transmission channel to execute the image moving task, and controlling the DMA to move the remaining audio data in the audio moving task to the FIFO through the audio transmission channel; the second depth threshold is greater than zero and less than the first depth threshold.
In a feasible implementation manner of the present disclosure, the controlling the DMA multiplexing audio transmission channel to execute an image moving task includes: selecting nodes which are not executed currently from a target linked list according to the connection sequence of each node in the target linked list corresponding to the image moving task; and configuring a register of the DMA according to the node information of the node so as to start the DMA to move the image data corresponding to the node to the GDDR through the audio transmission channel.
In a feasible implementation manner of the present disclosure, the target linked list is an original linked list automatically generated by upper software, or a linked list obtained by modifying the original linked list.
In a feasible implementation manner of the present disclosure, when the target linked list is a linked list obtained by modifying the original linked list, the method further includes: acquiring the original linked list, wherein the original linked list comprises a plurality of original nodes; splitting each target original node which meets the splitting condition in the plurality of original nodes to obtain a plurality of corresponding nodes, wherein the data volume of the image data corresponding to each node is not greater than a data volume threshold value; aiming at each target original node, connecting a plurality of nodes corresponding to the target original node, and replacing the position of the target original node in the original linked list by using a node sequence obtained after connection to obtain the target linked list; the data amount threshold represents an amount of data that the DMA is capable of transferring at a corresponding time during which the FIFO is depleted from the first depth threshold to the second depth threshold.
In a possible implementation manner of the present disclosure, the data size threshold = (the first depth threshold — the second depth threshold) × the full depth of the FIFO corresponds to the playback time length × the transmission rate of the DMA.
In one possible implementation manner of the present disclosure, before the controlling the DMA multiplexing audio transmission channel to execute the image moving task, the method further includes:
determining a target image moving task of the reusable audio transmission channel from image moving tasks which are not started to be executed currently; correspondingly, the controlling the DMA multiplexing audio transmission channel to execute an image moving task includes: and controlling the DMA to multiplex the audio transmission channel to execute the target image moving task.
In a feasible implementation manner of the present disclosure, the determining a target image transfer task that can multiplex an audio transmission channel includes: randomly selecting the target image moving task from the image moving tasks which are not started to be executed currently; or, from the image transfer tasks which are not started to be executed currently, selecting the image transfer task with the minimum data size required to be transmitted as the target image transfer task.
In a possible implementation manner of the present disclosure, the first depth threshold is a depth value of the FIFO, and the second depth threshold is a depth value of 1/4 of the FIFO.
According to another aspect of the present disclosure, there is also provided a task processing apparatus including: the device comprises a first control module and a second control module.
The first control module is used for controlling the DMA to suspend executing the audio moving task and controlling the DMA to multiplex the audio transmission channel to execute the image moving task when the audio data amount currently stored in the FIFO reaches the first depth threshold of the FIFO;
the second control module is used for controlling the DMA to pause multiplexing the audio transmission channel to execute the image moving task and controlling the DMA to move the audio data left in the audio moving task to the FIFO through the audio transmission channel when the fact that the audio data amount currently stored in the FIFO is consumed to a second depth threshold value of the FIFO is determined; the second depth threshold is greater than zero and less than the first depth threshold.
In a feasible implementation manner of the present disclosure, the first control module is configured to select a node that is not currently executed from a target linked list according to a connection order of each node in the target linked list corresponding to the image moving task; and configuring a register of the DMA according to the node information of the node so as to start the DMA to move the image data corresponding to the node to the GDDR through the audio transmission channel.
In a feasible implementation manner of the present disclosure, the target linked list is an original linked list automatically generated by upper software, or a linked list obtained by modifying the original linked list.
In a feasible implementation manner of the present disclosure, the apparatus further includes a modification module, configured to obtain the original linked list, where the original linked list includes a plurality of original nodes; splitting each target original node which meets the splitting condition in the plurality of original nodes to obtain a plurality of corresponding nodes, wherein the data volume of the image data corresponding to each node is not greater than a data volume threshold value; aiming at each target original node, connecting a plurality of nodes corresponding to the target original node, and replacing the position of the target original node in the original linked list by using a node sequence obtained after connection to obtain the target linked list; the data amount threshold represents an amount of data that the DMA is capable of transferring at a corresponding time during which the FIFO is depleted from the first depth threshold to the second depth threshold.
In a possible implementation manner of the present disclosure, the data size threshold = (the first depth threshold — the second depth threshold) × the full depth of the FIFO corresponds to the playback time length × the transmission rate of the DMA.
In a possible implementation manner of the present disclosure, the first depth threshold is a depth value of the FIFO, and the second depth threshold is a depth value of 1/4 of the FIFO.
In a feasible implementation manner of the present disclosure, the apparatus further includes a determining module, configured to determine a target image transfer task that can multiplex an audio transmission channel from image transfer tasks that are not currently executed; correspondingly, the first control module is configured to control the DMA to multiplex the audio transmission channel to execute the target image moving task.
In a feasible implementation manner of the present disclosure, the determining module is configured to randomly select the target image moving task from image moving tasks that are not executed at present; or, from the image transfer tasks that are not started to be executed currently, the image transfer task with the minimum data size required to be transferred is selected as the target image transfer task.
According to another aspect of the present disclosure, there is also provided an electronic device including a memory, a processor, and an SOC including a DMA, the memory having stored thereon a computer program, which when executed by the processor, can implement the task processing method in any of the above-described implementations. For the mobile terminal, the electronic device can be an electronic product such as a smart phone, a tablet computer, VR glasses, a vehicle-mounted computer, and the like; for the desktop end, the electronic device may be an electronic product such as a desktop computer and a notebook computer.
According to another aspect of the present disclosure, a computer-readable storage medium is further provided, in which a task processing program is stored, and when the task processing program is executed, the task processing method provided in any one of the possible implementation manners is implemented.
Drawings
FIG. 1 is a schematic flow chart diagram illustrating a task processing method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of an audio playing scene provided by an embodiment of the present disclosure;
FIG. 3A is a diagram of an original linked list according to an embodiment of the present disclosure;
FIG. 3B is a schematic diagram of a target linked list according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a task processing device according to an embodiment of the present disclosure.
Reference numerals: 400-a task processing device; 410-a first control module; 420-a second control module.
Detailed Description
Before the embodiments of the present disclosure are described, it should be noted that:
some embodiments of the disclosure are described as a process flow, and although various operational steps of the flow may be referred to by sequential step numbers, the operational steps therein may be performed in parallel, concurrently, or simultaneously.
The terms "first," "second," and so forth, may be used in embodiments of the disclosure to describe various features, but these features should not be limited by these terms. These terms are used merely to distinguish one feature from another.
The term "and/or," "and/or," may be used in embodiments of the present disclosure to include any and all combinations of one or more of the associated listed features.
It should be understood that when a connection or communication between two components is described, the connection or communication between the two components may be understood as either a direct connection or communication or an indirect connection or communication through intermediate components, unless a direct connection or direct communication between the two components is explicitly indicated.
In order to make the technical solutions and advantages of the embodiments of the present disclosure more clearly understood, the following detailed description of the exemplary embodiments of the present disclosure with reference to the accompanying drawings makes it obvious that the described embodiments are only a part of the embodiments of the present disclosure, rather than an exhaustive list of all the embodiments. It should be noted that, in the present disclosure, the embodiments and the features of the embodiments may be combined with each other without conflict.
In the prior art, a DMA provided in an electronic device (e.g., a graphics card device) includes at least two transmission channels, namely an audio transmission channel for transmitting audio data and an image transmission channel for transmitting image data. The DMA transmits the audio data in the audio moving task to the FIFO through the audio transmission channel, and transmits the image data in the image moving task to the GDDR through the image transmission channel.
The Audio module may play out the sound by consuming the Audio data in the FIFO. During playback, the Audio module will pause playback or output a noise once the FIFO is empty. Because the sound is temporarily suspended or the noise is captured by the human, in order to ensure the use experience of the user, in the electronic setting in the prior art, when an audio moving task and an image moving task exist at the same time, the DMA preferentially uses the audio transmission channel to execute the audio moving task, and after the audio moving task is completed, the image transmission channel is used for transmitting image data, so that the audio heard by the user is ensured not to be interrupted. That is to say, under the condition that two tasks exist simultaneously, the DMA will be occupied by the audio moving task all the time, and the DMA will not process the image moving task until the whole audio moving task is processed. For the electronic device, the frequency of image shift tasks is much higher than the frequency of audio shift tasks, and if one of the audio shift tasks occupies the DMA for a long time, a large number of image shift tasks cannot be pushed, and the processing efficiency of the image shift tasks is low.
On the premise that an audio moving task and an image moving task exist in the electronic device at the same time, in order to avoid the problem of low processing efficiency of the image moving task, the embodiment of the disclosure provides a task processing method. The following will describe in detail the task processing scheme provided by the present disclosure.
Referring to fig. 1, an embodiment of the present disclosure provides a task processing method, which may include:
s110: and when the audio data amount currently stored in the FIFO reaches the first depth threshold value of the FIFO, controlling the DMA to suspend executing the audio moving task, and controlling the DMA multiplexing audio transmission channel to execute the image moving task.
S120: and when the audio data amount currently stored in the FIFO is determined to be consumed to a second depth threshold value of the FIFO, controlling the DMA to suspend multiplexing the audio transmission channel to execute the image moving task, and controlling the DMA to move the remaining audio data in the audio moving task to the FIFO through the audio transmission channel.
The second depth threshold is greater than zero and less than the first depth threshold.
That is, in the process that the DMA executes the image shifting task through the audio transmission channel, when it is determined that the amount of the audio data in the FIFO reaches the first depth threshold of the FIFO, the DMA is controlled to suspend transmitting the audio data to the FIFO through the audio transmission channel, and the DMA is controlled to multiplex the audio transmission channel dedicated to transmitting the audio data to transmit the image data. During the transmission of the image data by the multiplexing Audio transmission channel, the Audio data in the FIFO is consumed by the Audio module to play sound to the outside, and in order to avoid sound pause or noise occurrence caused by the FIFO being empty, when it is determined that the amount of the Audio data in the FIFO is consumed to the second depth threshold of the FIFO, the transmission of the image data by the multiplexing Audio transmission channel is paused, and the DMA is controlled to resume the transmission of the Audio data to the FIFO by using the Audio transmission channel.
In the above process, since the execution of the audio moving task is resumed when the audio data in the FIFO is consumed to the second depth threshold, it is possible to avoid the phenomenon that the audio data in the FIFO is consumed and sound is suspended or murmurmur occurs. In addition, due to the fact that the Audio transmission channel is multiplexed to execute at least part of the image moving task in part of the time period when the Audio module consumes the Audio data in the FIFO, the image moving task does not need to be executed after the Audio moving task is executed completely, and therefore the processing efficiency of the image moving task can be improved while user experience is guaranteed.
The above steps will be described in detail below.
S110: and when the audio data amount currently stored in the FIFO reaches the first depth threshold value of the FIFO, controlling the DMA to suspend executing the audio moving task, and controlling the DMA multiplexing audio transmission channel to execute the image moving task.
Because the DMA continuously moves the Audio data into the FIFO and the Audio module continuously consumes the Audio data in the FIFO when playing the sound, the amount of the Audio data currently stored in the FIFO is a dynamically changing value.
In the embodiment of the present disclosure, the FIFO is a hardware structure, and may be set in a manner of configuring a register, so that the FIFO monitors the amount of audio data currently stored by itself, and when it is monitored that the amount of audio data currently stored reaches a preset depth threshold, the audio data may be reported to the driver in an interrupt manner.
Based on this, in some embodiments of the present disclosure, a first depth threshold may be configured to the FIFO, so that once the FIFO monitors that the amount of currently stored audio data reaches the first depth threshold, the amount of currently stored audio data of the FIFO is reported to the driver in a first interrupt manner, so as to indicate that the amount of currently stored audio data of the FIFO reaches the first depth threshold of the FIFO.
Of course, in other embodiments of the present disclosure, the driver may determine that the amount of audio data currently held by the FIFO reaches the first depth threshold of the FIFO in other ways, such as by informing the driver by the DMA.
For the driving, when it is determined that the amount of Audio data currently stored in the FIFO reaches the first depth threshold, it indicates that the amount of Audio data currently stored in the FIFO is sufficient, and it can be ensured that the FIFO is not empty after the Audio module consumes the amount of Audio data within a certain period of time.
That is, in the certain period of time, even if the DMA does not transfer the audio data into the FIFO, the amount of the audio data in the FIFO will not be consumed, so in the embodiment of the present disclosure, in order to improve the processing efficiency of the image transfer task, when it is determined that the amount of the audio data currently stored in the FIFO reaches the first depth threshold, the DMA may be notified to suspend executing the audio transfer task in an interrupt manner, and the DMA is controlled to multiplex the audio transmission channel to execute the image transfer task.
Correspondingly, before the DMA multiplexing audio transmission channel is controlled for the first time to execute the image transfer task, the target image transfer task of the multiplexing audio transmission channel can be determined from the image transfer tasks which are not started to be executed currently, and correspondingly, when the DMA multiplexing audio transmission channel is controlled to execute the image transfer task, the image transfer task executed by the DMA multiplexing audio transmission channel is the target image transfer task.
As for the target image transfer task, in some embodiments, it may be randomly determined, for example, one image transfer task is randomly selected as the target image transfer task from among image transfer tasks that are not currently started to be executed. In other embodiments, the target image transfer task may also be specifically designated, for example, an image transfer task with the minimum amount of data to be transferred is selected as the target image transfer task from among image transfer tasks that are not currently executed.
Of course, if the other image transfer tasks that are not selected as the target image transfer task are not selected, the DMA continues to transmit the audio transfer task through the image transmission channel after the DMA completes the execution of the audio transfer task.
It should be noted that, in the image moving task mentioned in the embodiment of the present disclosure, the image data corresponding to the image moving task may be image data belonging to different local areas of the same image, or image data belonging to different images. In addition, when each image moving task corresponds to different local areas of the same image, a strict transmission sequence does not exist among the image moving tasks.
S120: and when the audio data amount currently stored in the FIFO is determined to be consumed to a second depth threshold value of the FIFO, controlling the DMA to suspend multiplexing the audio transmission channel to execute the image moving task, and controlling the DMA to move the remaining audio data in the audio moving task to the FIFO through the audio transmission channel.
In the process of executing the image shifting task by the DMA multiplexing audio transmission channel, the audio data volume in the FIFO is continuously consumed. In the embodiment of the present disclosure, once the amount of audio data in the FIFO is consumed to the second depth threshold, it indicates that the amount of audio data currently stored in the FIFO is in short supply, and if the amount of audio data in the FIFO cannot be supplemented, the FIFO may be empty and a sound pause or noise may occur.
In order to avoid the above-mentioned sound pause or the sound noise, similarly to the above, in the embodiment of the present disclosure, a second depth threshold may be configured to the FIFO, so that once the FIFO monitors that the amount of the audio data currently stored in the FIFO is consumed to the second depth threshold, the audio data currently stored in the FIFO is reported to the driver in a second interrupt manner, so as to indicate that the amount of the audio data currently stored in the FIFO is consumed to the second depth threshold, and the amount of the audio data currently stored in the FIFO is in short supply.
Accordingly, in the embodiment of the present disclosure, in order to ensure the user experience, when it is determined that the amount of the audio data currently stored in the FIFO is consumed to the second depth threshold of the FIFO and the audio shift task corresponding to the amount of the audio data in the FIFO is not completely executed, the DMA may be notified to suspend the multiplexing audio transmission channel to execute the image shift task in an interrupted manner, and the DMA is controlled to resume executing the unfinished audio shift task through the audio transmission channel, that is, the remaining audio data in the audio shift task is shifted into the FIFO to supplement the amount of the audio data in the FIFO.
Of course, it is worth pointing out that in the conventional audio playing scenario, as shown in fig. 2, the transmission length of the audio data included in the audio moving task is generally greater than the depth of the FIFO. In the process of executing an audio shift task, there may be cases where the execution of the audio shift task is suspended and the execution of the image shift task by the multiplexed audio transmission channel is resumed, and where the execution of the image shift task by the multiplexed audio transmission channel is suspended and the execution of the unfinished audio shift task is resumed. In this case, when the audio transfer task is interrupted next time and the multiplexed audio transmission channel executes the image transfer task, if the target image transfer task of the previously selected multiplexed audio transmission channel has not been executed, the target image transfer task that has not been executed is continuously executed, and if the target image transfer task of the previously selected multiplexed audio transmission channel has been executed, a new target image transfer task may be newly selected.
Optionally, the first depth threshold of the FIFO may be a depth value of the FIFO, and the second depth threshold of the FIFO may be a depth value of 1/4 of the FIFO. In this embodiment, when the FIFO is full of audio data, the execution of the audio shift task is suspended and the multiplexed audio transmission channel executes the video shift task, and when the amount of audio data in the FIFO is consumed to 1/4 of the depth value of the FIFO, the execution of the video shift task by the multiplexed audio transmission channel is suspended and the execution of the unfinished audio shift task is resumed. That is, during the period from the full state to the 1/4 state, the DMA can suspend the audio shift task and the multiplexed audio transmission channel performs the image shift task.
In the embodiment of the present disclosure, each image moving task has a corresponding target linked list, and the target linked list includes a plurality of SGL nodes (may be referred to as nodes for short) connected in sequence.
Correspondingly, when the DMA multiplexing audio transmission channel is controlled to execute the image moving task, the nodes which are not executed at present are selected from the target linked list according to the connection sequence of each node in the target linked list corresponding to the image moving task; and then configuring a register of the DMA according to the node information of the node to start the DMA to move the image data corresponding to the currently selected node to the GDDR through the audio transmission channel. That is, in the embodiment of the present disclosure, when the DMA multiplexes the audio transmission channel to move the image data, the image data is transmitted in a direct manner.
The process of configuring the register of the DMA according to the node information of the node is as follows:
the node information of each node record included in the target linked list may include: the starting physical address Start Addr1 of the memory of the image data corresponding to the node, the memory Length1 of the memory corresponding to the node, and the virtual address of the next node.
When the registers of the DMA are configured, the starting physical address Start Addr1 and the memory Length1 in the node information of the current node are stored in the registers of the DMA. After the configuration is completed, a DMA transmission command is sent to the DMA controller, and the DMA is appointed to adopt an audio transmission channel to execute the moving task in the transmission command.
Of course, it should be noted that, in the process of multiplexing the audio transmission channel to execute the image moving task, if the data of the selected node is moved completely, the next node that is not executed completely can be selected from the target linked list according to the above process, and the DMA is started to move the image data corresponding to the currently selected node to the GDDR through the audio transmission channel by continuously configuring the register of the DMA.
In some embodiments, the target linked list of the image moving task may be an original linked list automatically generated by upper-layer software.
The generation process of the original linked list is a conventional prior art, and generally comprises the following steps: after the upper layer software acquires the address information of the image corresponding to the image moving task in the user state virtual address space, the driving layer acquires an actual physical page according to the user state virtual address of the image, and the acquired page generates a corresponding SGL node by using an operating system interface and is connected to obtain an original linked list Linklist 0.
In this embodiment, when the DMA multiplexes the audio transmission channel to execute the image transfer task, a node that is not currently executed is selected from the original linked list corresponding to the image transfer task, and then a register of the DMA is configured according to the node information of the selected node to start the DMA.
It should be noted that if the DMA multiplexes the audio transmission channel to execute the image transfer task, the node is directly selected from the original linked list corresponding to the image transfer task to start the DMA, and since the data size corresponding to the node in the original linked list is relatively random, if the data size of the image corresponding to the image transfer task is relatively large, it is very likely that the DMA executes the image data transfer operation for the selected node a, and the data size corresponding to the node a is not completely transferred by the DMA, and an interrupt notification for suspending the multiplexing of the audio transmission channel to execute the image transfer task is received. Therefore, when the audio moving task is suspended and the image moving task is executed by multiplexing the audio transmission channel next time, the image data corresponding to the node a needs to be completely retransmitted, which reduces the transmission efficiency and also causes resource waste. And a potential error exists, when the image moving task is interrupted again in the process of transmitting the image data corresponding to the node A again by the DMA, the original linked list corresponding to the image moving task is interrupted repeatedly in such a cycle, and the image data is not transmitted until the audio moving task is finished.
Based on the above problem, in other embodiments, the target linked list is a linked list obtained by modifying an original linked list of the image transfer task. The modification time of the original linked list for the image transfer task can be when the target image transfer task of the reusable audio transmission channel is determined, or between the determination of the target image transfer task of the reusable audio transmission channel and the control of the DMA multiplexing audio transmission channel to execute the target image transfer task.
Correspondingly, when the DMA multiplexes the audio transmission channel to execute the image moving task, the nodes which are not executed currently are selected from the chain table obtained by transforming the original chain table corresponding to the image moving task, and then the registers of the DMA are configured according to the node information of the selected nodes to start the DMA.
The following description will be directed to a process of modifying an original linked list.
The information of each node record included in the original linked list includes: the starting physical address Start Addr1 of the memory of the image data corresponding to the node, the memory Length1 of the memory corresponding to the node, and the address of the next node.
Optionally, after the original linked list is obtained, for each original node included in the original linked list, the data size of the image data corresponding to the original node may be calculated based on the information recorded by the original node. If the data volume of the image data corresponding to a certain original node is larger than the data volume threshold, the original node meets the splitting condition and is a target original node, and the target original node can be split to obtain a plurality of nodes corresponding to the target original node.
The target original node is split, and actually, the image data corresponding to the target original node is split.
Specifically, for each target original node, the data volume of the image data may be calculated from the start point of the image data corresponding to the target original node, and if the accumulated data volume reaches the data volume threshold, data segmentation is performed once at a position in the image data that reaches the data volume threshold, so that the whole image data corresponding to the target original node may be split into a plurality of image data packets, so as to ensure that the data volume of each image data packet obtained after splitting is not greater than the data volume threshold.
Certainly, in the splitting process, the initial physical address and the memory length occupied by the split image data packet are also required to be recorded, and then a node corresponding to each split image data packet can be generated.
Similar to the original node, the starting physical address Start Addr1 of the memory of the image data packet corresponding to the original node, the memory Length1 of the memory corresponding to the image data packet node, and the address of the next node are recorded in the generated node.
After the target original nodes are split to obtain the corresponding nodes, the corresponding nodes can be connected to obtain a node sequence for each target original node. As for the connection order of the plurality of nodes, the formation order of the image data packets corresponding to the nodes is kept consistent.
After the node sequences corresponding to the target original nodes are obtained, the positions of the target original nodes corresponding to the node sequences in the original linked list are replaced by the node sequences, and then the target linked list can be obtained.
Of course, if a certain original node in the original linked list does not meet the splitting condition, the original node does not need to be split, and the original node is still included in the finally obtained target linked list.
Specifically, it is assumed that the original linked list includes three original nodes, as shown in fig. 3A, the original nodes are original node a, original node B, and original node C, and the data volumes of the image data corresponding to the three original nodes are 10K, 50K, and 15K, respectively. Now, assuming that the threshold of the data amount is 15K, for the three original nodes, it is not necessary to split the original node a and the original node C, and the original node B is a target original node and needs to split the target original node.
Correspondingly, after the original node B is split according to the splitting process, three nodes are obtained, namely node B1 (15K) -node B2 (15K) -node B3 (15K) -node B4 (5K). The final target linked list is shown in fig. 3B and is original node a-node B1-node B2-node B3-node B4-original node C.
Wherein the data amount threshold represents an amount of data that the DMA is capable of transferring at a time corresponding to the time during which the FIFO is consumed from the first depth threshold to the second depth threshold.
Optionally, the data size threshold = (the first depth threshold — the second depth threshold) × the playing duration corresponding to the full-depth FIFO × the transfer rate of the DMA.
The playing time length corresponding to the full-depth FIFO depends on the size of the FIFO, and in the case of a fixed FIFO depth, the playing time length is generally constant. The transfer rate of the DMA depends on the hardware configuration of the DMA and is generally constant. Of course, the playing duration corresponding to the full-depth FIFO and the DMA transfer rate may be pre-fixed in the video card by the operator and may be read by the software executing the scheme.
Of course, in some embodiments, for some special DMAs that may have multiple different transfer rates, a data amount threshold may need to be calculated based on the maximum transfer rate of the DMA, and accordingly, the data amount threshold represents the maximum amount of data that the DMA can transfer during the time that the FIFO is consumed from the first depth threshold to the second depth threshold.
For example, if the FIFO with full depth corresponds to 32K data amount and the playable time is 1S, then the data amount threshold =750ms × DMA transfer rate if the first depth threshold and the second depth threshold are the depth value of the FIFO and the depth value of 1/4 of the FIFO, respectively.
In the embodiment of the application, the Audio transmission channel is multiplexed to execute at least part of the image moving task in a part of time period when the Audio module consumes the Audio data in the FIFO, and the image moving task is not required to be executed after the Audio moving task is executed, so that the processing efficiency of the image moving task can be improved while the user experience is guaranteed. In addition, because the execution of the audio shifting task is resumed when the audio data in the FIFO is consumed to the second depth threshold, the phenomenon that the audio data in the FIFO is consumed to cause sound pause or noise can be avoided.
In addition, referring to fig. 2, in the process of transferring audio data to the FIFO through the audio transmission channel by the DMA of the prior art, once the FIFO is full, the DMA cannot transfer the audio data to the FIFO continuously, and the DMA can transfer the audio data to the FIFO only when the FIFO has a free space, so that the DMA is always in an idle blocking state during the period from when the DMA cannot transfer the audio data to when the DMA transfers the audio data to the FIFO continuously, and at this time, the image transfer task cannot be executed because the audio transfer task monopolizes the DMA. By adopting the scheme, the efficiency of the image moving task can be improved, and the utilization rate of the DMA can also be improved.
In addition, referring to fig. 4, an embodiment of the disclosure further provides a task processing device 400, which may include a first control module 410 and a second control module 420.
The first control module 410 is configured to control the DMA to suspend executing an audio moving task and control the DMA to multiplex the audio transmission channel to execute an image moving task when it is determined that the amount of audio data currently stored in the FIFO reaches the first depth threshold of the FIFO;
a second control module 420, configured to control the DMA to suspend multiplexing the audio transmission channel to execute the image moving task and control the DMA to move remaining audio data in the audio moving task to the FIFO through the audio transmission channel when it is determined that the amount of the audio data currently stored in the FIFO is consumed to a second depth threshold of the FIFO; the second depth threshold is greater than zero and less than the first depth threshold.
In a feasible implementation manner of the present disclosure, the first control module 410 is configured to select, according to a connection order of each node in a target linked list corresponding to the image moving task, a node that is not executed currently from the target linked list; and configuring a register of the DMA according to the node information of the node so as to start the DMA to move the image data corresponding to the node to the GDDR through the audio transmission channel.
In a feasible implementation manner of the present disclosure, the target linked list is an original linked list automatically generated by upper software, or a linked list obtained by modifying the original linked list.
In a feasible implementation manner of the present disclosure, the apparatus further includes a modification module, configured to obtain the original linked list, where the original linked list includes a plurality of original nodes; splitting each target original node which meets the splitting condition in the plurality of original nodes to obtain a plurality of corresponding nodes, wherein the data volume of the image data corresponding to each node is not greater than a data volume threshold value; aiming at each target original node, connecting a plurality of nodes corresponding to the target original node, and replacing the position of the target original node in the original linked list by using a node sequence obtained after connection to obtain the target linked list; the data amount threshold represents an amount of data that the DMA is capable of transferring at a corresponding time during which the FIFO is depleted from the first depth threshold to the second depth threshold.
In a possible implementation manner of the present disclosure, the data size threshold = (the first depth threshold — the second depth threshold) × the full depth of the FIFO corresponds to the playback time length × the transmission rate of the DMA.
In a possible implementation manner of the present disclosure, the first depth threshold is a depth value of the FIFO, and the second depth threshold is a depth value of 1/4 of the FIFO.
In a feasible implementation manner of the present disclosure, the apparatus further includes a determining module, configured to determine a target image transfer task that can multiplex an audio transmission channel from image transfer tasks that are not currently executed; correspondingly, the first control module 410 is configured to control the DMA to multiplex the audio transmission channel to execute the target image moving task.
In a feasible implementation manner of the present disclosure, the determining module is configured to randomly select the target image moving task from image moving tasks that are not executed at present; or, from the image transfer tasks that are not started to be executed currently, the image transfer task with the minimum data size required to be transferred is selected as the target image transfer task.
In addition, the embodiment of the disclosure also provides an electronic device, which comprises a memory, a processor, an SOC and other necessary components, wherein the SOC comprises the DMA. The memory stores a computer program, and when the computer program is executed by the processor, the method for processing the task in any one of the above-mentioned implementation modes can be implemented.
The memory and the processor can be understood as components included in the Host side or the microkernel independent of the SOC.
In some usage scenarios, the electronic device is in the form of a portable electronic device, such as a multimedia device, e.g., a smart phone, a television, a tablet computer, a VR device, etc.; in some usage scenarios, the electronic device is in the form of a personal computer, a game console, a workstation, a server, or the like.
In addition, the embodiment of the disclosure also provides a computer readable storage medium, on which a task processing program is stored, and when the task processing program is executed, the task processing method provided by any feasible implementation manner can be realized. For the specific implementation process, reference may be made to the above method embodiments, which are not described herein again.
In summary, in the embodiment of the present application, since the Audio transmission channel is multiplexed to execute at least part of the image shift task in a part of the time period when the Audio module consumes the Audio data in the FIFO, it is not necessary to start executing the image shift task after the Audio shift task is executed, and therefore, by using the scheme, the processing efficiency of the image shift task and the utilization rate of the DMA can be improved while the user experience is ensured. In addition, because the execution of the audio shifting task is resumed when the audio data in the FIFO is consumed to the second depth threshold, the phenomenon that the audio data in the FIFO is consumed to cause sound pause or noise can be avoided.
While preferred embodiments of the present disclosure have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all changes and modifications that fall within the scope of the present disclosure.
It will be apparent to those skilled in the art that various changes and modifications can be made in the present disclosure without departing from the spirit and scope of the disclosure. Thus, the present disclosure is intended to include such modifications and variations insofar as they come within the scope of the appended claims and their equivalents.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: although the present disclosure has been described in detail with reference to the above embodiments, those skilled in the art will appreciate that various changes, modifications and equivalents can be made in the embodiments of the invention without departing from the scope of the invention as set forth in the claims.

Claims (16)

1. A method of task processing, the method comprising:
when the audio data amount currently stored in the FIFO reaches a first depth threshold value of the FIFO, controlling the DMA to suspend executing an audio moving task, and controlling the DMA multiplexing audio transmission channel to execute an image moving task;
when the audio data amount currently stored in the FIFO is determined to be consumed to a second depth threshold value of the FIFO, controlling the DMA to pause multiplexing the audio transmission channel to execute the image moving task, and controlling the DMA to move the remaining audio data in the audio moving task to the FIFO through the audio transmission channel;
the second depth threshold is greater than zero and less than the first depth threshold.
2. The method of claim 1, wherein the controlling the DMA multiplexed audio transport channel to perform an image movement task comprises:
selecting nodes which are not executed currently from a target linked list according to the connection sequence of each node in the target linked list corresponding to the image moving task;
and configuring a register of the DMA according to the node information of the node so as to start the DMA to move the image data corresponding to the node to the GDDR through the audio transmission channel.
3. The method of claim 2, wherein the target linked list is an original linked list automatically generated by upper layer software or a linked list obtained by modifying the original linked list.
4. The method of claim 3, when the target linked list is a modified linked list from the original linked list, the method further comprising:
acquiring the original linked list, wherein the original linked list comprises a plurality of original nodes;
splitting each target original node which meets the splitting condition in the plurality of original nodes to obtain a plurality of corresponding nodes, wherein the data volume of the image data corresponding to each node is not greater than a data volume threshold value;
aiming at each target original node, connecting a plurality of nodes corresponding to the target original node, and replacing the position of the target original node in the original linked list by using a node sequence obtained after connection to obtain the target linked list;
the data amount threshold represents an amount of data that the DMA is capable of transferring at a corresponding time during which the FIFO is depleted from the first depth threshold to the second depth threshold.
5. The method of claim 4, wherein the data volume threshold = (first depth threshold-second depth threshold) x full depth FIFO corresponding play duration x DMA transfer rate.
6. The method of claim 1, prior to said controlling the DMA multiplexed audio transport channel to perform an image shuffle task, further comprising:
determining a target image moving task of the reusable audio transmission channel from image moving tasks which are not started to be executed currently;
correspondingly, the controlling the DMA multiplexing audio transmission channel to execute an image moving task includes:
and controlling the DMA to multiplex the audio transmission channel to execute the target image moving task.
7. The method of claim 6, wherein determining a target image migration task for a reusable audio transmission channel comprises:
randomly selecting the target image moving task from image moving tasks which are not started to be executed currently; alternatively, the first and second electrodes may be,
and selecting the image shifting task with the minimum data volume required to be transmitted as the target image shifting task from the image shifting tasks which are not executed at present.
8. The method of any of claims 1-7, the first depth threshold being a depth value of the FIFO, the second depth threshold being a depth value of 1/4 FIFO.
9. A task processing device comprising:
the first control module is used for controlling the DMA to suspend executing the audio moving task and controlling the DMA to multiplex the audio transmission channel to execute the image moving task when the audio data amount currently stored in the FIFO reaches the first depth threshold of the FIFO;
the second control module is used for controlling the DMA to suspend multiplexing the audio transmission channel to execute the image moving task and controlling the DMA to move the audio data remained in the audio moving task to the FIFO through the audio transmission channel when the condition that the audio data amount currently stored in the FIFO is consumed to a second depth threshold value of the FIFO is determined;
the second depth threshold is greater than zero and less than the first depth threshold.
10. The task processing device according to claim 9, wherein the first control module is configured to select, according to a connection order of each node in a target linked list corresponding to the image transfer task, a node that is not currently executed; and configuring a register of the DMA according to the node information of the node so as to start the DMA to move the image data corresponding to the node to the GDDR through the audio transmission channel.
11. The task processing device according to claim 10, wherein the target linked list is an original linked list automatically generated by upper-layer software, or a linked list obtained by modifying the original linked list.
12. The task processing device of claim 11, further comprising a transformation module to obtain the original linked list, the original linked list comprising a plurality of original nodes; splitting each target original node which meets the splitting condition in the plurality of original nodes to obtain a plurality of corresponding nodes, wherein the data volume of the image data corresponding to each node is not greater than a data volume threshold value; aiming at each target original node, connecting a plurality of nodes corresponding to the target original node, and replacing the position of the target original node in the original linked list by using a node sequence obtained after connection to obtain the target linked list; the data amount threshold represents an amount of data that the DMA is capable of transferring at a corresponding time during which the FIFO is depleted from the first depth threshold to the second depth threshold.
13. The task processing device of claim 12, the data volume threshold = (first depth threshold-second depth threshold) x full depth FIFO corresponding playout duration x DMA transfer rate.
14. Task processing device according to one of the claims 9-13, wherein the first depth threshold is a depth value of the FIFO and the second depth threshold is a depth value of a 1/4 FIFO.
15. An electronic device comprising a memory, a processor and an SOC comprising a DMA, said memory having stored thereon a computer program which, when executed by said processor, carries out the task processing method according to any one of claims 1 to 8.
16. A computer-readable storage medium having stored thereon a task processing program which, when executed, implements a task processing method according to any one of claims 1 to 8.
CN202211587922.8A 2022-12-12 2022-12-12 Task processing method and device, electronic equipment and computer readable storage medium Active CN115658572B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211587922.8A CN115658572B (en) 2022-12-12 2022-12-12 Task processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211587922.8A CN115658572B (en) 2022-12-12 2022-12-12 Task processing method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN115658572A true CN115658572A (en) 2023-01-31
CN115658572B CN115658572B (en) 2023-04-14

Family

ID=85019346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211587922.8A Active CN115658572B (en) 2022-12-12 2022-12-12 Task processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115658572B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5553220A (en) * 1993-09-07 1996-09-03 Cirrus Logic, Inc. Managing audio data using a graphics display controller
CN106792070A (en) * 2016-12-19 2017-05-31 广东威创视讯科技股份有限公司 A kind of audio, video data DMA transfer method and device
CN106937137A (en) * 2015-12-30 2017-07-07 惠州市伟乐科技股份有限公司 A kind of synchronous method of multi-channel digital audio coding audio-visual
CN113886052A (en) * 2021-10-26 2022-01-04 上海商汤科技开发有限公司 Task scheduling method, device, equipment and storage medium
CN114443529A (en) * 2022-04-02 2022-05-06 苏州浪潮智能科技有限公司 Direct memory access architecture, system, method, electronic device and medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5553220A (en) * 1993-09-07 1996-09-03 Cirrus Logic, Inc. Managing audio data using a graphics display controller
CN106937137A (en) * 2015-12-30 2017-07-07 惠州市伟乐科技股份有限公司 A kind of synchronous method of multi-channel digital audio coding audio-visual
CN106792070A (en) * 2016-12-19 2017-05-31 广东威创视讯科技股份有限公司 A kind of audio, video data DMA transfer method and device
CN113886052A (en) * 2021-10-26 2022-01-04 上海商汤科技开发有限公司 Task scheduling method, device, equipment and storage medium
CN114443529A (en) * 2022-04-02 2022-05-06 苏州浪潮智能科技有限公司 Direct memory access architecture, system, method, electronic device and medium

Also Published As

Publication number Publication date
CN115658572B (en) 2023-04-14

Similar Documents

Publication Publication Date Title
KR0163234B1 (en) Data streaming between peer subsystems of a computer system
JP4456490B2 (en) DMA equipment
CN102981990B (en) Data transmission method and device of terminal equipment with Androild platform
CN104092763B (en) A kind of application program installation kit method for pushing and device
JP2004348246A (en) Data transfer controller, electronic equipment, and data transfer control method
CN103294444B (en) The supplying method of computing machine shared platform sound intermediate frequency data and device
CN113037929B (en) Information relay output method and device, electronic equipment and storage medium
US20140149984A1 (en) Information processing apparatus, information processing method, and computer readable medium
CN108777812A (en) A kind of record screen live broadcasting method, device, electronic equipment and storage medium
CN111569417A (en) Peripheral data transmission method and system for cloud games
TW202004492A (en) Task management method, host and storage device for electronic storage device
CN113038273B (en) Video frame processing method and device, storage medium and electronic equipment
CN115658572B (en) Task processing method and device, electronic equipment and computer readable storage medium
US20170171276A1 (en) Method, Electronic Device and System for Slicing Streaming Media Files
CN114501134A (en) iOS cross-page video playing method, device, equipment and storage medium
WO2018133556A1 (en) Method, device and apparatus implementing communication in application
CN106933646B (en) Method and device for creating virtual machine
CN111400213B (en) Method, device and system for transmitting data
CN110457522B (en) Information sharing method and device, terminal and storage medium
CN104052801A (en) Information processing method and electronic equipment
CN103514126B (en) The method of reseptance of a kind of data, system and device
CN113992660A (en) File transmission method and device, electronic equipment and storage medium
CN109032965B (en) Data reading method, host and storage device
CN113316022A (en) Video playing method, device, equipment, system and storage medium
CN115883022B (en) DMA transmission control method, apparatus, electronic device and readable storage medium

Legal Events

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

Effective date of registration: 20240115

Address after: 401135 No. 618 Liangjiang Avenue, Longxing Town, Yubei District, Chongqing

Patentee after: Xiangdixian Computing Technology (Chongqing) Co.,Ltd.

Address before: Room 901, 901, floor 9 (09), building 1, yard 5, Anding Road, Chaoyang District, Beijing 100029

Patentee before: Beijing xiangdixian Computing Technology Co.,Ltd.

TR01 Transfer of patent right