CN117519633A - GPU multichannel HDMI audio synchronous output method, device and storage medium - Google Patents

GPU multichannel HDMI audio synchronous output method, device and storage medium Download PDF

Info

Publication number
CN117519633A
CN117519633A CN202311500638.7A CN202311500638A CN117519633A CN 117519633 A CN117519633 A CN 117519633A CN 202311500638 A CN202311500638 A CN 202311500638A CN 117519633 A CN117519633 A CN 117519633A
Authority
CN
China
Prior art keywords
hdmi
audio
pcm
data
buffer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311500638.7A
Other languages
Chinese (zh)
Inventor
徐锋
李烨姗
黎杰豪
韩汝椿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Icube Corp ltd
Original Assignee
Icube Corp 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 Icube Corp ltd filed Critical Icube Corp ltd
Priority to CN202311500638.7A priority Critical patent/CN117519633A/en
Publication of CN117519633A publication Critical patent/CN117519633A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/165Management of the audio stream, e.g. setting of volume, audio stream path
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/32Handling requests for interconnection or transfer for access to input/output bus using combination of interrupt and burst mode transfer
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/162Interface to dedicated audio devices, e.g. audio drivers, interface to CODECs
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention discloses a GPU multipath HDMI audio synchronous output method, which comprises the following steps: registering a plurality of PCM devices to be respectively and independently associated with a corresponding HDMI device, and registering a virtual PCM device to be associated with each HDMI device; each PCM device processes the audio data and copies the processed audio data to a corresponding HDMI device Buffer; setting an HDMI device Buffer starting address to an HDMI DMA, enabling the DMA transmission of the HDMI device to be completed and interrupted, enabling an HDMI external device to start audio playing, and triggering a PCM device to conduct next audio data and copying through the interruption of the DMA transmission; and triggering each path of HDMI equipment to multiplex the interrupt processing program by using the DMA transmission completion interrupt of one HDMI equipment associated with the virtual PCM equipment, so as to realize the synchronous output of the multi-path HDMI audio. The invention interrupts multiplexing to realize hardware synchronization, and ensures that each frame of audio of the multi-channel HMDI is output simultaneously; and meanwhile, the double buffering technology is utilized to improve the program execution efficiency.

Description

GPU multichannel HDMI audio synchronous output method, device and storage medium
Technical Field
The application relates to the technical field of GPU display, in particular to a method, a device and a storage medium for synchronously outputting multichannel HDMI audios of a GPU.
Background
In the process of outputting an image by the GPU through the HDMI, it is necessary to support transmission of audio Data, and the Data to be transmitted includes Control Data (Control), auxiliary Data (Data Island) and display Data (Video) as known from the HDMI protocol specification, and the essence of the audio Data transmission is that the HDMI mixer packages the audio Data in the auxiliary Data and transmits the audio Data to the display screen together with other Data. Along with market demands, part of GPUs support two or more HDMI output interfaces, but generally only output audio data from one HDMI at the same time, and the need for multiple HDMI synchronous output requires additional application software modification or hardware implementation, and at present, the modes of multiple HDMI synchronous output audio of the GPU include: implemented by application software or by HDMI hardware converter.
It is assumed that the GPU has two HDMI output interfaces, i.e., HDMI1 and HDMI2, respectively. The principle of the two methods to output audio synchronously is as follows: the first method is an application software implementation method: the data flow of GPU audio playing is generally that an application program selects one PCM device, then sets audio parameters including channel number, sampling rate and the like, then writes audio data into the PCM device through an audio write data interface and enables playing, to realize synchronous playing of HDMI1 and HDMI2 audio in application software, two threads are needed, one thread opens a sound card corresponding to HDMI1, the other thread opens a sound card corresponding to HDMI2, when audio data is written and played, the two threads perform thread synchronization in a software mode, the bottom layer drives HDMI1 and HDMI2 to respectively set DMA, after one frame of data is transmitted, transmission completion interrupt of HDMI1 and HDMI2 is triggered respectively, then the application is informed to perform synchronous writing, and audio data continues to be written and played after application synchronization. The method has the advantages that: the logic is simple, and the dependence between the HDMI1 and HDMI2 paths is small; disadvantages: the system is low in efficiency and unreliable, two programs are needed to realize software synchronization, the aim of simultaneously transmitting audio data to the HDMI1 and the HDMI2 is fulfilled, meanwhile, the HDMI1 and the HDMI2 are required to respectively acquire and process the same audio data, interrupts are respectively configured, a large number of repeated operations are generated by the HDMI1 and the HDMI2 in the interrupts and frequently occur, and the system is likely to respond slowly, so that an audio clamping phenomenon occurs. The second method is an HDMI hardware converter implementation method: the HDMI hardware converter principle does not involve software, and the GPUHDMI1 or HDMI2 interface is connected to the HDMI hardware converter inlet with an HDMI line, and the input signal is copied into the same multiple paths by a circuit, and the copied content contains both video and audio. The method II has the advantages that: the synchronization efficiency is high, and the complete signal of one audio signal can be copied into multiple paths of audios at the same time; disadvantages: the HDMI signal is copied based on one path of HDMI signal, if the HDMI2 does not output audio based on the HDMI1 copy signal, the hardware resource utilization is not high, and at the same time, the method requires additional hardware, which increases the use cost.
Disclosure of Invention
Aiming at the problems, the invention provides a method, a device and a storage medium for synchronously outputting multi-channel HDMI audios of a GPU, which are characterized in that one virtual PCM device is generated when PCM devices are registered, the PCM devices are connected with all HDMI devices, one HDMI interrupt is utilized to trigger the relevant configuration of each channel of HDMI audios, so that the multi-channel HDMI audios are synchronously output, and meanwhile, the double-buffer technology is utilized to improve the program execution efficiency.
In a first aspect of the present invention, a GPU multipath HDMI audio synchronization output method, the method includes:
registering a plurality of PCM devices to be respectively and independently associated with a corresponding HDMI device, and registering a virtual PCM device to be associated with each HDMI device;
each PCM device processes the audio data and copies the processed audio data to a corresponding HDMI device Buffer;
setting an HDMI device Buffer starting address to an HDMIMDMA to enable DMA transmission of the HDMI device to be completed and interrupted, starting audio playing by the HDMI external device, and triggering the PCM device to conduct next audio data and copying by the DMA transmission completion interruption;
and triggering each path of HDMI equipment to multiplex the interrupt processing program by using the DMA transmission completion interrupt of one HDMI equipment associated with the virtual PCM equipment, so as to realize the synchronous output of the multi-path HDMI audio.
In an embodiment, a dual Buffer technology is adopted, when DMA transmission is performed on one Buffer data of the dual buffers, the PCM device processes audio at the same time, copies the processed data in the other Buffer of the dual buffers, and is used for directly continuing the next DMA transmission after the completion of the interrupt of one DMA transmission.
The invention provides a GPU multipath HDMI audio synchronous output device, which comprises a registration module, a data processing and copying module, a DMA transmission module and an interrupt multiplexing module, wherein the registration module is used for registering that a plurality of PCM devices are respectively and independently associated with a corresponding HDMI device, and registering that a virtual PCM device is associated with each HDMI device; the data processing and copying module is used for processing the audio data by each PCM device and copying the processed audio data into the corresponding HDMI device Buffer; the DMA transmission module is used for setting the starting address of the HDMI device Buffer to the HDMIMMA to enable the DMA transmission of the HDMI device to be completed and interrupted, the HDMI external device starts the playing of the audio, and the interruption of the DMA transmission is completed to trigger the PCM device to carry out the next audio data and copy; the interrupt multiplexing module is used for triggering each path of HDMI equipment to multiplex the interrupt processing program by using the DMA transmission completion interrupt of one HDMI equipment associated with the virtual PCM equipment, so as to realize the synchronous output of the multi-path HDMI audio.
In an embodiment, the data processing and copying module and the DMA transfer module adopt a double Buffer technology, when DMA transfer is performed on one Buffer data of the double buffers, the PCM device processes the audio at the same time, copies the processed data in the other Buffer of the double buffers, and is used for directly continuing the next DMA transfer after the completion of the interrupt of one DMA transfer.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the GPU multi-channel HDMI audio synchronization output method described above when executing the program.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the GPU multi-channel HDMI audio synchronization output method described above.
According to the GPU multipath HDMI audio synchronous output method, device and storage medium, the same logic is used for a plurality of PCM devices and virtual PCM device paths in terms of realization logic, and the code multiplexing rate is high; from parallelism, the method is improved based on a GPU single-channel HDMI audio transmission flow, a double Buffer mechanism is used, time-consuming operations such as audio format conversion and data copying are put after DMA transmission starts, and when one frame is transmitted by the DMA, the other frame of data is processed and the data copying is completed, so that after the DMA transmission is triggered, the DMA is directly configured without additional time-consuming operations in the interrupt, and the system performance is improved; from the hardware realization, the invention is realized by using virtual PCM equipment, uses one interrupt resource in a plurality of HDMIs to carry out interrupt multiplexing to operate other HDMIs, and does not need additional hardware expenditure; from the characteristic realization, the invention realizes the synchronous transmission of the GPU multipath HDMI audios on the drive, simultaneously supports the independent output of each path of HDMI audios of the GPU, can flexibly update the drive in the system, does not need to modify application programs, and has great application value. In summary, the beneficial effects of the invention are as follows: the parallelism is high, a double Buffer strategy is used, and parameters are configured and next frame data is copied while one frame of audio data is transmitted; the reliability is high, the hardware synchronization is realized by interrupting multiplexing, and each frame of audio of the multi-channel HMDI is ensured to be output simultaneously; the compatibility is good, the original process is packaged with a layer of virtual audio equipment, and simultaneously multi-channel HDMI synchronous audio output and single-channel HDMI audio output are supported, and meanwhile, external HDMI conversion hardware is not required, so that the hardware realization cost is reduced.
Drawings
Fig. 1 is a schematic diagram of a GPU single-channel HDMI audio output method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a GPU multi-channel HDMI audio synchronous output method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a GPU multi-channel HDMI audio synchronous output device according to an embodiment of the present invention;
fig. 4 is a block diagram of an electronic device in an embodiment of the invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts steps as a sequential process, many of the steps may be implemented in parallel, concurrently, or with other steps. Furthermore, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
The embodiment of the invention provides a GPU multipath HDMI audio synchronous output method, a device and a storage medium, and provides the following embodiments:
in an embodiment, a method for synchronously outputting multichannel HDMI audio of a GPU includes:
registering a plurality of PCM devices to be respectively and independently associated with a corresponding HDMI device, and registering a virtual PCM device to be associated with each HDMI device;
each PCM device processes the audio data and copies the processed audio data to a corresponding HDMI device Buffer;
setting an HDMI device Buffer starting address to an HDMIMDMA to enable DMA transmission of the HDMI device to be completed and interrupted, starting audio playing by the HDMI external device, and triggering the PCM device to conduct next audio data and copying by the DMA transmission completion interruption;
and triggering each path of HDMI equipment to multiplex the interrupt processing program by using the DMA transmission completion interrupt of one HDMI equipment associated with the virtual PCM equipment, so as to realize the synchronous output of the multi-path HDMI audio.
In another embodiment, a dual Buffer technology is adopted, when DMA transmission is performed on one Buffer data of the dual buffers, the PCM device processes audio at the same time, copies the processed data in the other Buffer of the dual buffers, and is used for directly continuing the next DMA transmission after the completion of the interrupt of one DMA transmission.
In the embodiment, the GPU is improved by single-channel HDMI audio output, as shown in fig. 1, the processing flow of playing audio through HDMI1 or HDMI2 alone is the same, and the following is illustrated by taking HDMI1 playing audio as an example:
step one: the user selects the PCM1 device, writes the original audio data to the PCM1 device, and the PCM1 device defaults to be associated with the HDMI1 operation handle in the drive.
Step two: the audio is processed first, including channel setting, format conversion, etc., and then the processed data is copied to HDMI1 Buffer.
Step three: and setting the HDMI1 Buffer starting address to HDMI1DMA, enabling the HDMI1DMA transmission to complete interruption, and enabling the HDMI1 external device to start playing the audio.
Step four: when the HDMI1DMA transmission is completed, the HDMI1 interrupt is triggered, the HDMI1 interrupt processing program executes the second step to process audio and copy data, and then executes the third step to perform HDMI1DMA setting, so that continuous audio is played on the HDMI1 external device through the HDMI1 interrupt triggering cycle.
The implementation manner in the improved embodiment is as follows: when the PCM equipment is registered, one virtual PCM equipment is generated, the PCM equipment is connected with all HDMI equipment, one HDMI interrupt is utilized to trigger the relevant configuration of each path of HDMI audio, so that the synchronous output of multiple paths of HDMI audio is realized, and meanwhile, the program execution efficiency is improved by utilizing the double buffering technology. As shown in fig. 2, the GPU multi-channel HDMI audio synchronous output method:
in the first step, the PCM device may be associated with one HDMI device, or may be associated with all HDMI devices, and when the user selects the PCM1 or PCM2 device, the user individually associates the HDMI1 device and the HDMI2 device, and when the user selects the virtual PCM device, the virtual PCM device in the driving is simultaneously associated with the HDMI1 and HDMI2 operation handles.
And step two, the user writes the audio data into the PCM equipment, firstly processes the audio, and then copies the audio data processed by the first frame into the HDMI double Buffer associated with the PCM equipment.
Setting an HDMIMDMA starting address for all HDMI devices associated with the PCM device, wherein the address value is a starting value of HDMI double Buffer copying completion data, and enabling DMA transmission completion interruption of all HDMI devices associated with the PCM device.
And step four, a certain time is needed for DMA transmission of a frame, when the DMA transmission starts, audio is processed in parallel, all HDMI devices associated with the PCM device are subjected to data copying, and the data is copied to the other Buffer in the double buffers.
Step five, continuous audio data transmission needs interrupt event to drive, each PCM device configures a main interrupt, PCM1 device defaults to HDMI1 interrupt, PCM2 device defaults to HDMI2 interrupt, virtual PCM device defaults to HDMI1 interrupt, and all associated HDMI devices of virtual PCM device multiplex main interrupt handler. Triggering an interrupt after the transmission of the HDMIMMA is completed, and executing the corresponding main interrupt processing program from the third step again, and directly returning to do not process when the triggered interrupt is not the main interrupt. When one frame of audio data is transmitted, the hardware interrupt is triggered, and the transmission time of each frame of audio of different HDMI devices is the same, so that when the audio is synchronously output, each PCM device only needs one audio transmission completion interrupt signal, the virtual PCM device uses HDMI1 main interrupt as a hardware synchronous signal, the operation of HDMI2 devices corresponding to non-main interrupt is executed in an HMDI1 main interrupt processing program to realize interrupt multiplexing, and the main interrupt processing program executes the step three, and simultaneously starts the transmission of the next frame of audio data for the associated HDMI1 and HDMI2 devices to achieve hardware synchronization. When the PCM1 device triggers the main interrupt signal, in the third step, the next frame data transmission is started only for the HDMI1 device associated with the PCM1, and the same is true for the PCM2 device, so that the compatibility of the functions of the PCM1 and the PCM2 devices is achieved.
Another embodiment of the present invention is used to describe a GPU multi-path HDMI audio synchronous output device 300, referring to fig. 3, the device 300 includes a registration module 310, a data processing and copying module 320, a DMA transfer module 330, and an interrupt multiplexing module 340, where the registration module 310 is configured to register a plurality of PCM devices to be individually associated with a corresponding HDMI device, and register a virtual PCM device to be associated with each HDMI device; the data processing and copying module 320 is configured to process the audio data by each PCM device and copy the processed audio data into a corresponding HDMI device Buffer; the DMA transfer module 330 is configured to set a Buffer start address of the HDMI device to the HDMIDMA, so that the DMA transfer of the HDMI device is completed and interrupted, the device externally connected to the HDMI starts playing audio, and the DMA transfer completion interrupt triggers the PCM device to perform the next audio data and copy; the interrupt multiplexing module 340 is configured to trigger each path of HDMI devices to multiplex the interrupt handler by using a DMA transfer completion interrupt of one of the HDMI devices associated with the virtual PCM device, so as to implement multi-path HDMI audio synchronous output.
In a preferred embodiment, the data processing and copying module 330 and the DMA transfer module 340 use a double Buffer technology, and when DMA transfer is performed on one Buffer data of the double buffers, the PCM device processes the audio at the same time, copies the processed data in the other Buffer of the double buffers, and is used for directly continuing the next DMA transfer after the completion of the interrupt of one DMA transfer.
In addition to the above modules, the apparatus 300 may include other components, however, since these components are not related to the contents of the embodiments of the present disclosure, illustration and description thereof are omitted herein.
Other specific working processes of the GPU multi-channel HDMI audio synchronization output device 300 refer to the description of the GPU multi-channel HDMI audio synchronization output method embodiment, and are not repeated.
Example 3 according to the invention
Another embodiment is provided to illustrate that the system of the present invention may also be implemented with the architecture of the computing device shown in fig. 4. Fig. 4 illustrates an architecture of the computing device. As shown in fig. 4, a computer system 410, a system bus 430, one or more CPUs 440, input/output 420, memory 450, and the like. The memory 450 may store various data or files used for computer processing and/or communication and program instructions executed by the CPU including the embodiment GPU multi-channel HDMI audio synchronization output method. The architecture shown in fig. 4 is merely exemplary, and one or more of the components in fig. 4 may be adapted as needed to implement different devices. The memory 450 is used as a computer readable storage medium for storing software programs, computer executable programs, and modules, such as program instructions/modules corresponding to the GPU multi-channel HDMI audio synchronization output method in the embodiment of the present invention (e.g., the registration module 310, the data processing and copying module 320, the DMA transfer module 330, and the interrupt multiplexing module 340 in the GPU multi-channel HDMI audio synchronization output device 300). The one or more CPUs 340 execute the various functional applications and data processing of the system of the present invention by running the software programs, instructions and modules stored in the memory 350, that is, implement the GPU multi-channel HDMI audio synchronization output method described above, and the method includes:
registering a plurality of PCM devices to be respectively and independently associated with a corresponding HDMI device, and registering a virtual PCM device to be associated with each HDMI device;
each PCM device processes the audio data and copies the processed audio data to a corresponding HDMI device Buffer;
setting an HDMI device Buffer starting address to an HDMIMDMA to enable DMA transmission of the HDMI device to be completed and interrupted, starting audio playing by the HDMI external device, and triggering the PCM device to conduct next audio data and copying by the DMA transmission completion interruption;
and triggering each path of HDMI equipment to multiplex the interrupt processing program by using the DMA transmission completion interrupt of one HDMI equipment associated with the virtual PCM equipment, so as to realize the synchronous output of the multi-path HDMI audio.
Of course, the processor of the server provided by the embodiment of the present invention is not limited to executing the method operations described above, and may also execute the related operations in the GPU multipath HDMI audio synchronization output method provided by any embodiment of the present invention.
Memory 450 may include primarily a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application program required for functionality; the storage data area may store data created according to the use of the terminal, etc. In addition, memory 450 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, memory 450 may further include memory remotely located with respect to one or more CPUs 440, which may be connected to the device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Input/output 420 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the device. Input/output 420 may also include a display device such as a display screen.
The embodiment of the invention also provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the GPU multipath HDMI audio synchronization output method described in the above embodiment. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
In addition, other specific working processes of the non-transitory computer readable storage medium refer to the description of the above GPU multi-channel HDMI audio synchronization output method embodiment, and are not repeated.
In summary, according to the technical schemes provided by the embodiments, in terms of realizing logic, the same logic is used for a plurality of PCM devices and virtual PCM device paths, and the code multiplexing rate is high; from parallelism, the method is improved based on a GPU single-channel HDMI audio transmission flow, a double Buffer mechanism is used, time-consuming operations such as audio format conversion and data copying are put after DMA transmission starts, and when one frame is transmitted by the DMA, the other frame of data is processed and the data copying is completed, so that after the DMA transmission is triggered, the DMA is directly configured without additional time-consuming operations in the interrupt, and the system performance is improved; from the hardware realization, the invention is realized by using virtual PCM equipment, uses one interrupt resource in a plurality of HDMIs to carry out interrupt multiplexing to operate other HDMIs, and does not need additional hardware expenditure; from the characteristic realization, the invention realizes the synchronous transmission of the GPU multipath HDMI audios on the drive, simultaneously supports the independent output of each path of HDMI audios of the GPU, can flexibly update the drive in the system, does not need to modify application programs, and has great application value. In summary, the beneficial effects of the invention are as follows: the parallelism is high, a double Buffer strategy is used, and parameters are configured and next frame data is copied while one frame of audio data is transmitted; the reliability is high, the hardware synchronization is realized by interrupting multiplexing, and each frame of audio of the multi-channel HMDI is ensured to be output simultaneously; the compatibility is good, the original process is packaged with a layer of virtual audio equipment, and simultaneously multi-channel HDMI synchronous audio output and single-channel HDMI audio output are supported, and meanwhile, external HDMI conversion hardware is not required, so that the hardware realization cost is reduced.
In this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, or apparatus.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (6)

1. A GPU multipath HDMI audio synchronous output method, the method comprising:
registering a plurality of PCM devices to be respectively and independently associated with a corresponding HDMI device, and registering a virtual PCM device to be associated with each HDMI device;
each PCM device processes the audio data and copies the processed audio data to a corresponding HDMI device Buffer;
setting an HDMI device Buffer starting address to an HDMIMDMA to enable DMA transmission of the HDMI device to be completed and interrupted, starting audio playing by the HDMI external device, and triggering the PCM device to conduct next audio data and copying by the DMA transmission completion interruption;
and triggering each path of HDMI equipment to multiplex the interrupt processing program by using the DMA transmission completion interrupt of one HDMI equipment associated with the virtual PCM equipment, so as to realize the synchronous output of the multi-path HDMI audio.
2. The GPU multi-channel HDMI audio synchronous output method of claim 1, wherein the PCM device processes audio simultaneously and copies the processed data to the other Buffer of the double buffers by using the double Buffer technique when DMA transmission is performed on one Buffer data of the double buffers, for directly continuing the next DMA transmission after the completion of the one DMA transmission.
3. The GPU multichannel HDMI audio synchronous output device is characterized by comprising a registration module, a data processing and copying module, a DMA transmission module and an interrupt multiplexing module, wherein the registration module is used for registering that a plurality of PCM devices are respectively and independently associated with a corresponding HDMI device, and registering that a virtual PCM device is associated with each HDMI device; the data processing and copying module is used for processing the audio data by each PCM device and copying the processed audio data into the corresponding HDMI device Buffer; the DMA transmission module is used for setting the starting address of the HDMI device Buffer to the HDMIMMA to enable the DMA transmission of the HDMI device to be completed and interrupted, the HDMI external device starts the playing of the audio, and the interruption of the DMA transmission is completed to trigger the PCM device to carry out the next audio data and copy; the interrupt multiplexing module is used for triggering each path of HDMI equipment to multiplex the interrupt processing program by using the DMA transmission completion interrupt of one HDMI equipment associated with the virtual PCM equipment, so as to realize the synchronous output of the multi-path HDMI audio.
4. A GPU multipath HDMI audio synchronous output device according to claim 3, wherein the data processing and copying module and the DMA transfer module adopt a double Buffer technology, when DMA transfer is performed on one Buffer data of the double buffers, the PCM device processes the audio at the same time, and copies the processed data in the other Buffer of the double buffers, so that the next DMA transfer can be directly continued after the completion of the DMA transfer.
5. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor performs the steps of the GPU multi-path HDMI audio synchronization output method of any one of claims 1 to 2 when the program is executed by the processor.
6. A non-transitory computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the GPU multi-way HDMI audio synchronization output method of any of claims 1 to 2.
CN202311500638.7A 2023-11-13 2023-11-13 GPU multichannel HDMI audio synchronous output method, device and storage medium Pending CN117519633A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311500638.7A CN117519633A (en) 2023-11-13 2023-11-13 GPU multichannel HDMI audio synchronous output method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311500638.7A CN117519633A (en) 2023-11-13 2023-11-13 GPU multichannel HDMI audio synchronous output method, device and storage medium

Publications (1)

Publication Number Publication Date
CN117519633A true CN117519633A (en) 2024-02-06

Family

ID=89752521

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311500638.7A Pending CN117519633A (en) 2023-11-13 2023-11-13 GPU multichannel HDMI audio synchronous output method, device and storage medium

Country Status (1)

Country Link
CN (1) CN117519633A (en)

Similar Documents

Publication Publication Date Title
CN105122210B (en) GPU virtualization implementation method and related device and system
JP4669088B1 (en) Test apparatus, test method and program
US11290392B2 (en) Technologies for pooling accelerator over fabric
US11010859B2 (en) Display resource scheduling method and device for embedded system
CN109522257B (en) Universal serial bus concentrator
US20220365892A1 (en) Accelerating Method of Executing Comparison Functions and Accelerating System of Executing Comparison Functions
US10268606B2 (en) Method, device and system for switching access modes for data storage device
CN117519633A (en) GPU multichannel HDMI audio synchronous output method, device and storage medium
CN112218140A (en) Video synchronous playing method, device, system and storage medium
TWI235921B (en) System and method for effectively performing physical direct memory access operations
WO2007060932A1 (en) Multi thread processor having dynamic reconfiguration logic circuit
CN107562686B (en) information processing method and device
TWI766891B (en) Processor of semiconductor device and method of operating same
US11435942B2 (en) Method and apparatus for processing read-write-operation instruction in processing-in-memory
US7523468B1 (en) Virtual processing chains
US7984204B2 (en) Programmable direct memory access controller having pipelined and sequentially connected stages
US8866828B2 (en) Enabling display commands from an electronic device to an integrated display on a computer system
JP2008181524A (en) Digital signal processor using handshake interface system, and its driving method
CN117336177A (en) Network performance optimization method and device, storage medium and electronic equipment
JP2002175265A (en) Signal group exchange device and method between a plurality of components in digital signal processor having direct memory access controller
CN108804068B (en) Client of audio device redirection system and related audio device redirection method
KR20120066999A (en) Direct memory access controller and operating method thereof
JP6138482B2 (en) Embedded system
JPH05151137A (en) Electronic computer device
CN115934607A (en) Microkernel data transmission method, system, device and 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