WO2019090928A1 - 一种播放同步方法、装置和usb声卡 - Google Patents

一种播放同步方法、装置和usb声卡 Download PDF

Info

Publication number
WO2019090928A1
WO2019090928A1 PCT/CN2017/118089 CN2017118089W WO2019090928A1 WO 2019090928 A1 WO2019090928 A1 WO 2019090928A1 CN 2017118089 W CN2017118089 W CN 2017118089W WO 2019090928 A1 WO2019090928 A1 WO 2019090928A1
Authority
WO
WIPO (PCT)
Prior art keywords
data buffer
read
audio data
writes
pointer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2017/118089
Other languages
English (en)
French (fr)
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.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology 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 Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to US16/651,168 priority Critical patent/US10963213B2/en
Publication of WO2019090928A1 publication Critical patent/WO2019090928A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/36Handling requests for interconnection or transfer for access to common bus or bus system
    • G06F13/362Handling requests for interconnection or transfer for access to common bus or bus system with centralised access control
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Definitions

  • the present invention relates to the field of communication data transmission, and in particular, to a playback synchronization method, device and USB sound card.
  • a device When a device plays video or audio, it usually involves signal conversion and data transfer operations between the two devices.
  • the two devices performing data transmission are the master device and the slave device.
  • the clock offset between the master device and the slave device is relatively independent, and the clock skew of the master device and the slave device causes data. Transmission is not synchronized, resulting in loss of sound or distortion.
  • the prior art proposes a method of adding a peripheral circuit or the like for the problem that the master and slave devices are not synchronized, but the peripheral circuit increases the design complexity of the master-slave device and increases the cost.
  • the present invention provides a play synchronization method, device and USB sound card.
  • a playback synchronization method comprising: accumulating a write count of a write pointer of a master device to an audio data buffer, and a read pointer of a slave device from the audio data buffer, respectively. The number of times the read data is read in the area, and when the number of writes is accumulated to a predetermined number of times, the magnitude relationship between the number of writes and the number of read times is determined;
  • the read pointer of the slave device is redirected to the original position of the audio data buffer.
  • the method further comprises: periodically acquiring a write position of the write pointer of the master device in the audio data buffer and a read position of the read pointer of the slave device in the audio data buffer;
  • the difference between the write location and the read location is less than a single packet length, or the difference between the write location and the read location is greater than the audio data buffer length and a single packet length
  • the difference is to clear the data in the audio data buffer and clear the number of writes and the number of reads.
  • the read pointer of the slave device is moved in the audio data buffer to the reading direction by a certain length, or the read pointer of the slave device is redirected to the original position of the audio data buffer
  • the method further includes:
  • the number of writes and the number of reads are cleared to zero and re-accumulated.
  • a playback synchronization apparatus comprising:
  • the number accumulation unit is configured to respectively accumulate the number of writes of the write pointer of the master device to the audio data buffer and the number of times the read pointer of the slave device reads the data from the audio data buffer;
  • the determining unit is configured to determine, when the number of writes is accumulated to a predetermined number of times, a magnitude relationship between the number of writes and the number of times of reading;
  • the first processing unit is configured to: when the determining unit determines that the number of writes is greater than the number of readings, move the read pointer of the slave device to the reading direction in the audio data buffer by a certain length
  • the certain length is a product of a difference between the number of writes and the number of reads and a length of a single packet
  • the second processing unit is configured to, when the determining unit determines that the number of writes is less than the number of readings, point the read pointer of the slave device to the 0 data buffer, and write the pointer to the master device After the number of times the newly written data in the audio data buffer is equal to the difference between the number of readings and the number of times of writing, the read pointer of the slave device is redirected to the original position of the audio data buffer.
  • the device further comprises:
  • a location obtaining unit configured to periodically acquire a write position of a write pointer of the master device in the audio data buffer and a read position of a read pointer of the slave device in the audio data buffer;
  • a data clearing unit configured to: if a difference between the write location and the read location is less than a single packet length, or a difference between the write location and the read location is greater than the audio data buffer The difference between the length and the length of a single packet clears the data in the audio data buffer and clears the number of writes and the number of reads.
  • the device further comprises a number clearing unit,
  • the number of times clearing unit is configured to move a read pointer of the slave device in the audio data buffer to a read length by a certain length, or to redirect the read pointer of the slave device to the audio After the original position of the data buffer, the number of writes and the number of reads are cleared to zero and re-accumulated.
  • a USB sound card comprising an audio data buffer, a 0 data buffer, a time accumulation unit, a determination unit, a first processing unit, and a second processing unit;
  • the number-of-times accumulation unit is configured to respectively accumulate the number of writes of the write pointer of the master device to the audio data buffer and the read of the slave device from the audio data buffer. Number of times taken;
  • the determining unit is configured to determine, when the number of writes is accumulated to a predetermined number of times, a magnitude relationship between the number of writes and the number of times of reading;
  • the first processing unit is configured to move the read pointer of the slave device to the read direction in the audio data buffer when the determining unit determines that the number of writes is greater than the number of read times a certain length, the certain length being a product of a difference between the number of writes and the number of reads and a length of a single packet;
  • the second processing unit is configured to, when the determining unit determines that the number of writes is less than the number of readings, point the read pointer of the slave device to the 0 data buffer, and at the master device After the write pointer newly writes data to the audio data buffer for a number of times equal to the difference between the read count and the write count, the read pointer of the slave device is redirected to the audio data buffer. The original location.
  • the USB sound card further comprises:
  • a location obtaining unit configured to periodically acquire a write position of a write pointer of the master device in the audio data buffer and a read position of a read pointer of the slave device in the audio data buffer;
  • a data clearing unit configured to: if a difference between the write location and the read location is less than a single packet length, or a difference between the write location and the read location is greater than the audio data buffer The difference between the length and the length of a single packet clears the data in the audio data buffer and clears the number of writes and the number of reads.
  • the USB sound card further includes a number clearing unit configured to move the read pointer of the slave device to the reading direction by a certain length in the audio data buffer, or After the read pointer of the slave device is redirected to the original position of the audio data buffer, the number of writes and the number of reads are cleared to zero and re-accumulated respectively.
  • a number clearing unit configured to move the read pointer of the slave device to the reading direction by a certain length in the audio data buffer, or After the read pointer of the slave device is redirected to the original position of the audio data buffer, the number of writes and the number of reads are cleared to zero and re-accumulated respectively.
  • a USB sound card includes an audio data buffer, a 0 data buffer, a memory, and a processor, and the memory and the processor are connected by an internal bus communication.
  • the memory stores a computer program executable by the processor, the computer program being capable of implementing the method steps described above when executed by the processor.
  • the master and slave devices when the master and slave devices read and write data, the number of times the read pointer reads the data and the number of times the write pointer writes the data are acquired, and the read/write operation is detected by determining the relationship between the number of writes and the number of times of reading. Whether to synchronize. In the case that the read and write operations are not synchronized, the operation of reading the data is adjusted accordingly, so that the read and write data is synchronized.
  • the data synchronization of the master and slave devices is realized by a pure software method, and the peripheral circuit is not required, which simplifies the hardware design.
  • the synchronization process is performed in time to reduce data loss during the synchronization process and improve the accuracy of the read and write data synchronization.
  • FIG. 1 is a flowchart of a method for playing synchronization according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a function of a playback synchronization apparatus according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a USB sound card according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of another USB sound card according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for playing synchronization according to an embodiment of the present invention.
  • the method for playing synchronization in this embodiment includes:
  • Step S101 respectively, the number of times the write pointer of the master device writes data to the audio data buffer and the number of times the read pointer of the slave device reads data from the audio data buffer are accumulated.
  • step S102 when the number of writes is accumulated to a predetermined number of times, the magnitude relationship between the number of writes and the number of read times is determined.
  • the master device writes data once to the audio data buffer, and the number of writes is incremented by one.
  • the slave device reads data once from the audio data buffer, and the number of reads is also increased by one.
  • the master device and the slave device respectively write data and read data once every predetermined time. Since the clock of the master and slave devices is relatively independent, the clock deviation of the master and slave devices may cause the speed of writing data and the speed of reading data to be out of sync. As a result, there are cases where the number of writes and the number of reads are inconsistent.
  • the number of times of reading from the device at this time is acquired, and compared with the number of writes, and the size relationship between the two is determined, and the master device writes data and the slave device at this time. The speed at which the device reads data.
  • Step S103 if the number of writes is greater than the number of readings, the read pointer of the slave device is moved to the read direction by a certain length in the audio data buffer; if the write count is less than the read count, the read pointer of the slave device is pointed to the 0 data buffer. Area.
  • the length of each write and read data is the length of one packet. If the number of writes is greater than the number of reads, the master device writes data at a faster rate. The data read from the device is too slow, and the write data is not synchronized with the read data. If the operation is not performed, the gap between the data written by the master device and the data read from the device is increasing, which may cause the sound to be lost during playback of the device. At this time, the read pointer of the slave device is shifted by a certain length in the read direction of the audio data buffer, so that the write data and the read data are synchronized. A certain length of movement is the product of the difference between the number of writes and the number of reads and the length of a single packet. This operation keeps the distance between the read pointer and the write pointer equal to the start time, and the read pointer is again synchronized with the write pointer.
  • the master device If the number of writes is less than the number of reads, the master device writes data at a slower rate. The data is too fast to read from the device, and the write data is not synchronized with the read data. If you do not operate, it may cause distortion of the sound during playback.
  • the read pointer of the slave device is pointed to the 0 data buffer, the data 0 in the 0 data buffer is read, and the data written by the master device is stopped from the audio data buffer. After the write pointer of the master device writes data to the audio data buffer for a number of times equal to the difference between the number of reads and the number of writes, the read pointer of the slave device is redirected to the original position of the audio data buffer.
  • the write pointer continues to write data to the audio data buffer.
  • the read pointer is buffered from 0 data. Returned in the area, re-pointing to the position before leaving in the audio data buffer, starting to read data.
  • the write data is equal to the read data, and the two are in a synchronized state. In this case, the operation of reading the pointer is not required.
  • the play synchronization method further includes the step of position determination. Specifically, the write position of the write pointer of the master device in the audio data buffer and the read position of the read pointer of the slave device in the audio data buffer are periodically acquired. The write position of the write pointer and the read position of the read pointer are obtained to determine whether the write data and the read data exceed the limit state. If the difference between the write position and the read position is less than a single packet length, or the difference between the write position and the read position is greater than the difference between the length of the audio data buffer and the length of a single packet, the data is written and read. The relative state of the fetched data has exceeded the limit state.
  • the difference between the write position and the read position is less than the length of a single packet, indicating that the read pointer reads the data too fast, and the read pointer continues to read the data, so that the position of the read data may exceed the position where the write pointer writes data, resulting in data.
  • Overflow the difference between the write position and the read position is greater than the difference between the length of the audio data buffer and the length of a single packet, indicating that the read pointer reads the data too slowly, and if the write pointer continues to write data, it will not be read. Data coverage, resulting in data loss. Obtaining the write position of the write pointer and the read position of the read pointer.
  • the data in the audio data buffer is cleared, the write pointer and the read pointer are also cleared, and the accumulated The number of writes and the number of reads are cleared, the data is written from the beginning and the data is read, so that the read and write data is synchronized, and the integrity of the read and write data is guaranteed.
  • the corresponding move operation is performed from the read pointer of the device. After the mobile operation is completed, it is necessary to re-accumulate the number of writes and the number of reads, and perform the next acquisition judgment. Specifically, the read pointer of the slave device is moved to the read direction by a certain length in the audio data buffer, or the read pointer of the slave device is redirected to the original position of the audio data buffer, so that the read operation of the read pointer is completed, so that After the read/write data is synchronized, the number of writes and the number of reads are cleared, and the accumulation is restarted, waiting for the next judgment.
  • the playback synchronization apparatus includes:
  • the number accumulation unit 201 is configured to accumulate the number of times the write pointer of the master device writes data to the audio data buffer, and the number of times the read pointer of the slave device reads data from the audio data buffer.
  • the accumulator 1 and the accumulator 2 can be used to temporarily store the number of writes and the number of reads, the write pointer writes data once and the read pointer reads data once, and the arithmetic logic unit in the accumulator writes the number of times. And the number of readings is performed once for the cumulative arithmetic operation, and the operation results are stored in the accumulator one and the accumulator two, respectively.
  • the determining unit 202 is configured to determine the magnitude relationship between the number of writes and the number of times of reading when the number of writes is accumulated to a predetermined number of times. Specifically, when the number of writes in the accumulator 1 reaches a predetermined number of times, the processor acquires the number of readings in the accumulator 2, and determines the magnitude relationship between the number of writes and the number of reads.
  • the first processing unit 203 is configured to: when the determining unit 202 determines that the number of writes is greater than the number of readings, the read pointer of the slave device is moved to the reading direction by a certain length in the audio data buffer.
  • the certain length is the product of the difference between the number of writes and the number of reads and the length of a single packet.
  • the number of writes is greater than the number of reads, indicating that the master device writes data at a faster rate.
  • the data read from the device is too slow, causing the write data to be out of sync with the read data.
  • the processor shifts the read pointer of the device from the audio data buffer to the reading direction by a certain length, so that the write data and the read data are synchronized.
  • a certain length of movement is the product of the difference between the number of writes and the number of reads and the length of a single packet.
  • the second processing unit 204 is configured to, when the determining unit 202 determines that the number of writes is less than the number of readings, point the read pointer of the slave device to the 0 data buffer, and newly write the write pointer of the master device to the audio data buffer.
  • the number of times of data is equal to the difference between the number of reads and the number of writes, and the read pointer of the slave device is redirected to the original position of the audio data buffer.
  • the number of writes is less than the number of reads, indicating that the master device writes data at a slower rate.
  • the data is read too fast from the device, causing the write data to be out of sync with the read data.
  • the processor will point the read pointer of the device to the 0 data buffer, read the data 0 in the 0 data buffer, and stop reading the data written by the master device from the audio data buffer.
  • the read pointer of the slave device is redirected to the original position of the audio data buffer.
  • the play synchronization device further includes: a location acquisition unit and a data clearing unit (not shown in FIG. 2).
  • the location obtaining unit is configured to periodically acquire the write position of the write pointer of the master device in the audio data buffer and the read position of the read pointer of the slave device in the audio data buffer.
  • the write position of the write pointer and the read position of the read pointer can be obtained by using the algorithm unit in the processor, and stored in the specified storage unit.
  • a data clearing unit wherein the difference between the writing position and the reading position is less than a single packet length, or the difference between the writing position and the reading position is greater than a difference between the length of the audio data buffer and the length of the single packet, Clear the data in the audio data buffer and clear the number of writes and the number of reads.
  • the processor acquires the write position and the read position in the specified storage unit, and performs logical subtraction of the position by using the arithmetic logic unit, if the difference between the two is smaller than a single packet length, or larger than the length of the audio data buffer and a single
  • the difference in packet length indicates that the relative state of the written data and the read data has exceeded the limit state.
  • the data in the audio data buffer is emptied and rewritten and read, and the number of writes in the accumulator one and the number of reads in the accumulator 2 are cleared to restart the accumulation.
  • the playback synchronization device further includes a number clearing unit (not shown in FIG. 2) for moving the read pointer of the slave device in the audio data buffer to the reading direction by a certain length. Or, after re-pointing the read pointer of the device to the original position of the audio data buffer, the number of writes and the number of reads are cleared to zero and re-accumulated. Specifically, after the movement operation of the read pointer is completed, the number of writes in the accumulator one and the number of reads in the accumulator two are all cleared, the accumulation is restarted, and the next acquisition judgment is awaited.
  • a play synchronization device provided in this embodiment may be used to perform a play synchronization method in the first embodiment.
  • the principle and technical effects are similar, and details are not described herein again.
  • FIG. 3 is a schematic diagram of a functional structure of a USB sound card according to an embodiment of the present invention.
  • the USB sound card includes: an audio data buffer 301, a data buffer 302, a frequency accumulation unit 201, a determining unit 202, and a first Processing unit 203 and second processing unit 204.
  • the number accumulation unit 201 is configured to respectively accumulate the number of writes of the write pointer of the master device to the audio data buffer 301 and the number of times the read pointer of the slave device reads the data from the audio data buffer 301.
  • the determining unit 202 is configured to determine the magnitude relationship between the number of writes and the number of times of reading when the number of writes is accumulated to a predetermined number of times.
  • the first processing unit 203 is configured to: when the determining unit 202 determines that the number of writes is greater than the number of readings, the read pointer of the slave device moves in the audio data buffer to the reading direction by a certain length, and the certain length is the number of writes and the read. The product of the difference in the number of fetches and the length of a single packet.
  • the second processing unit 204 is configured to, when the determining unit 202 determines that the number of writes is less than the number of readings, point the read pointer of the slave device to the 0 data buffer 302, and the new write pointer of the master device to the audio data buffer 301. After the number of times the data is written is equal to the difference between the number of readings and the number of times of writing, the read pointer of the slave device is redirected to the original position of the audio data buffer 301.
  • the USB sound card further includes: a location acquisition unit and a data clearing unit (not shown in FIG. 3).
  • the location obtaining unit is configured to periodically acquire the write position of the write pointer of the master device in the audio data buffer and the read position of the read pointer of the slave device in the audio data buffer.
  • a data clearing unit wherein the difference between the writing position and the reading position is less than a single packet length, or the difference between the writing position and the reading position is greater than a difference between the length of the audio data buffer and the length of the single packet, Clear the data in the audio data buffer and clear the number of writes and the number of reads.
  • the USB sound card further includes a number clearing unit (not shown in FIG. 3) for moving the read pointer of the slave device in the audio data buffer to the reading direction by a certain length, Or, after re-pointing the read pointer of the device to the original position of the audio data buffer, the number of writes and the number of reads are cleared to zero and re-accumulated.
  • a number clearing unit (not shown in FIG. 3) for moving the read pointer of the slave device in the audio data buffer to the reading direction by a certain length, Or, after re-pointing the read pointer of the device to the original position of the audio data buffer, the number of writes and the number of reads are cleared to zero and re-accumulated.
  • the USB sound card provided in the third embodiment includes not only the play synchronization device provided in the second embodiment but also the audio data buffer 301 and the 0 data buffer 302.
  • the USB sound card includes an audio data buffer 402, a 0 data buffer 402, a memory 41, and a processor 42, a memory 41, and The processors 42 are communicably connected by an internal bus 43.
  • the memory 41 stores a computer program executable by the processor 42. When the computer program is executed by the processor, the playback synchronization method of the first embodiment can be implemented.
  • memory 41 can be a memory or a non-volatile memory.
  • the non-volatile memory may be: a storage drive (such as a hard drive), a solid state drive, any type of storage disk (such as a compact disc, a DVD, etc.), or a similar storage medium, or a combination thereof.
  • the memory can be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory.
  • RAM Random Access Memory
  • volatile memory non-volatile memory
  • flash memory flash memory.
  • the non-volatile memory and the memory are machine-readable storage media on which the computer program executed by the processor 42 can be stored to implement the aforementioned playback synchronization method, which has been made in the embodiment given in FIG. Detailed description will not be repeated here.
  • the technical solution implemented by the present invention acquires the number of writes of the write data written by the master device and the number of times the data is read from the device read pointer, and determines the data of the master and slave devices by judging the relationship between the two. Whether the transmission is synchronized. If it is not synchronized, adjust the position of the read pointer so that the write pointer and the read pointer are in sync again, that is, the write data is synchronized with the read data again.
  • the problem that the master-slave device clock is relatively independent and the data transmission is not synchronized due to clock deviation is solved.
  • the technical solution of the present invention also provides a solution when the state of writing data and reading data exceeds the limit state. Obtain the write position of the write pointer and the read position of the read pointer, and judge whether the read/write data exceeds the limit state by the difference between the two. If the limit state is exceeded, all written and read data is cleared and the data is read and written again. Solved the problem of data overflow and data loss caused by reading and writing data beyond the limit state.

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)
  • Information Transfer Systems (AREA)

Abstract

本发明公开了一种播放同步方法、装置和USB声卡。本发明的技术方案获取主设备写指针写入数据的写入次数和从设备读指针读取数据的读取次数,通过判断两者的大小关系确定主从设备的数据传输是否同步。若是不同步,则调整读指针的位置,使写指针与读指针重新处于同步状态,即写入数据与读取数据再次同步。解决了主从设备时钟相对独立,由于时钟偏差造成数据传输不同步引起的播放不同步的问题。

Description

一种播放同步方法、装置和USB声卡
交叉引用
本申请引用于2017年11月07日提交的专利名称为“一种播放同步方法、装置和USB声卡”的第201711083439.5号中国专利申请,其通过引用被全部并入本申请。
技术领域
本发明涉及通讯数据传输领域,尤其涉及一种播放同步方法、装置和USB声卡。
背景技术
在设备进行视频或音频播放时,通常涉及到两个设备之间的信号转换和数据传输操作。进行数据传输的两个设备为主设备和从设备,在主设备和从设备之间进行数据传输时,由于主设备和从设备的时钟源相对独立,主设备和从设备的时钟偏差会造成数据传输不同步问题,从而导致声音丢失或失真等现象。现有技术针对主从设备时钟不同步问题提出了增加外围电路等方法,但增加外围电路导致主从设备的设计复杂度增大,成本增加。
发明内容
为了解决上述背景技术中存在的主设备和从设备时钟不同步造成声音丢失以及失真等问题,本发明提供了一种播放同步方法、装置和USB声卡。
根据本发明的一个方面,提供一种播放同步方法,该方法包括:分别累计主设备的写指针向音频数据缓冲区中写入数据的写入次数和从设备的读指针从所述音频数据缓冲区中读取数据的读取次数,在所述写入次数累计至预定次数时,判断所述写入次数与所述读取次数的大小关系;
若所述写入次数大于所述读取次数,将所述从设备的读指针在所述音频数据缓冲区中向读取方向移动一定长度,所述一定长度为所述写入次数和所述读取次数的差值与单个数据包长度的乘积;
若所述写入次数小于所述读取次数,将所述从设备的读指针指向0数据缓冲区,并 在主设备的写指针向所述音频数据缓冲区中新写入数据的次数等于所述读取次数和所述写入次数的差值后,将所述从设备的读指针重新指向在所述音频数据缓冲区的原位置。
优选地,该方法还包括:定期获取主设备的写指针在所述音频数据缓冲区中的写入位置和从设备的读指针在所述音频数据缓冲区中的读取位置;
若所述写入位置与所述读取位置的差值小于单个数据包长度,或者所述写入位置与所述读取位置的差值大于所述音频数据缓冲区长度与单个数据包长度的差值,则将所述音频数据缓冲区内的数据清空,并将所述写入次数和所述读取次数清零。
优选地,在将所述从设备的读指针在所述音频数据缓冲区中向读取方向移动一定长度,或者将所述从设备的读指针重新指向在所述音频数据缓冲区的原位置之后,该方法还包括:
将所述写入次数和所述读取次数清零,分别重新累计。
根据本发明的另一个方面,提供一种播放同步装置,该装置包括:
次数累计单元,被配置为分别累计主设备的写指针向音频数据缓冲区中写入数据的写入次数和从设备的读指针从所述音频数据缓冲区中读取数据的读取次数;
判断单元,被配置为在所述写入次数累计至预定次数时,判断所述写入次数与所述读取次数的大小关系;
第一处理单元,被配置为在所述判断单元判断所述写入次数大于所述读取次数时,将所述从设备的读指针在所述音频数据缓冲区中向读取方向移动一定长度,所述一定长度为所述写入次数和所述读取次数的差值与单个数据包长度的乘积;
第二处理单元,被配置为在所述判断单元判断所述写入次数小于所述读取次数时,将所述从设备的读指针指向0数据缓冲区,并在主设备的写指针向所述音频数据缓冲区中新写入数据的次数等于所述读取次数和所述写入次数的差值后,将所述从设备的读指针重新指向在所述音频数据缓冲区的原位置。
优选地,该装置还包括:
位置获取单元,被配置为定期获取主设备的写指针在所述音频数据缓冲区中的写入位置和从设备的读指针在所述音频数据缓冲区中的读取位置;
数据清空单元,被配置为若所述写入位置与所述读取位置的差值小于单个数据包长 度,或者所述写入位置与所述读取位置的差值大于所述音频数据缓冲区长度与单个数据包长度的差值,则将所述音频数据缓冲区内的数据清空,并将所述写入次数和所述读取次数清零。
优选地,该装置还包括次数清零单元,
所述次数清零单元,被配置为在将所述从设备的读指针在所述音频数据缓冲区中向读取方向移动一定长度,或者将所述从设备的读指针重新指向在所述音频数据缓冲区的原位置之后,将所述写入次数和所述读取次数清零,分别重新累计。
根据本发明的再一个方面,提供一种USB声卡,该USB声卡包括音频数据缓冲区、0数据缓冲区、次数累计单元、判断单元、第一处理单元和第二处理单元;
所述次数累计单元,被配置为分别累计主设备的写指针向所述音频数据缓冲区中写入数据的写入次数和从设备的读指针从所述音频数据缓冲区中读取数据的读取次数;
所述判断单元,被配置为在所述写入次数累计至预定次数时,判断所述写入次数与所述读取次数的大小关系;
所述第一处理单元,被配置为在所述判断单元判断所述写入次数大于所述读取次数时,将所述从设备的读指针在所述音频数据缓冲区中向读取方向移动一定长度,所述一定长度为所述写入次数和所述读取次数的差值与单个数据包长度的乘积;
所述第二处理单元,被配置为在所述判断单元判断所述写入次数小于所述读取次数时,将所述从设备的读指针指向所述0数据缓冲区,并在主设备的写指针向所述音频数据缓冲区中新写入数据的次数等于所述读取次数和所述写入次数的差值后,将所述从设备的读指针重新指向在所述音频数据缓冲区的原位置。
优选地,该USB声卡还包括:
位置获取单元,被配置为定期获取主设备的写指针在所述音频数据缓冲区中的写入位置和从设备的读指针在所述音频数据缓冲区中的读取位置;
数据清空单元,被配置为若所述写入位置与所述读取位置的差值小于单个数据包长度,或者所述写入位置与所述读取位置的差值大于所述音频数据缓冲区长度与单个数据包长度的差值,则将所述音频数据缓冲区内的数据清空,并将所述写入次数和所述读取次数清零。
优选地,该USB声卡还包括次数清零单元,所述次数清零单元,被配置为在将所 述从设备的读指针在所述音频数据缓冲区中向读取方向移动一定长度,或者将所述从设备的读指针重新指向在所述音频数据缓冲区的原位置之后,将所述写入次数和所述读取次数清零,分别重新累计。
根据本发明的又一个方面,提供一种USB声卡,该USB声卡包括音频数据缓冲区、0数据缓冲区、存储器和处理器,所述存储器和所述处理器之间通过内部总线通讯连接,所述存储器存储有能够被所述处理器执行的计算机程序,所述计算机程序被所述处理器执行时能够实现上述的方法步骤。
本发明的有益效果是:
根据本发明的技术方案,在主从设备读写数据时,获取读指针读取数据的次数和写指针写入数据的次数,通过判断写入次数与读取次数的大小关系,检测读写操作是否同步。在读写操作不同步的情况下,对读取数据的操作进行相应的调整,使得读写数据同步。采用该技术方案,通过纯软件的方法实现主从设备的数据同步,无需增加外围电路,简化了硬件的设计。在数据传输不同步时,及时进行同步处理,减少在同步过程中的数据丢失,提高读写数据同步的精度。
附图说明
构成本申请的一部分的附图用来提供对本发明的进一步理解,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1为本发明实施例提供的一种播放同步方法的流程图;
图2为本发明实施例提供的一种播放同步装置的功能结构示意图;
图3为本发明实施例提供的一种USB声卡的功能结构示意图;
图4为本发明实施例提供的另一种USB声卡的功能结构示意图。
具体实施方式
为了解决背景技术中提出的技术问题,本申请的发明人想到采用纯软件方式,通过调整读取数据的操作,使得主从设备写入数据与读取数据同步,进而使得播放同步。为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。
实施例一
图1为本发明实施例提供的一种播放同步方法的流程图,参见图1,本实施例的播放同步方法包括:
步骤S101,分别累计主设备的写指针向音频数据缓冲区中写入数据的写入次数和从设备的读指针从音频数据缓冲区中读取数据的读取次数。
步骤S102,在写入次数累计至预定次数时,判断写入次数与读取次数的大小关系。
主设备每向音频数据缓冲区写入数据一次,写入次数累计加一;同时,从设备每从音频数据缓冲区读取数据一次,读取次数也累计加一。主设备和从设备每隔预定时间分别写入数据和读取数据一次,由于主从设备的时钟相对独立,主从设备的时钟偏差会造成写入数据的速度和读取数据的速度不同步,从而导致写入次数和读取次数存在不一致的情况。在写入次数累计至预定次数时,获取此时从设备的读取次数,并将其与写入次数进行对比,判断两者的大小关系,即可得知此时主设备写入数据和从设备读取数据的快慢情况。
步骤S103,若写入次数大于读取次数,将从设备的读指针在音频数据缓冲区向读取方向移动一定长度;若写入次数小于读取次数,将从设备的读指针指向0数据缓冲区。
主从设备在读写数据时,每次写入数据和读取数据的长度为一个数据包的长度。若写入次数大于读取次数,说明主设备写入数据的速度较快,从设备读取数据的速度太慢,写入数据与读取数据不同步。若不进行操作,主设备写入数据与从设备读取数据的差距越来越大,可能会造成设备播放过程中声音丢失的现象。此时,将从设备的读指针在音频数据缓冲区向读取方向移动一定长度,使得写入数据和读取数据同步。移动的一定长度为写入次数和读取次数的差值与单个数据包长度的乘积。这一操作使读指针和写指针的距离与开始时刻的距离保持相等,读指针再次与写指针同步。
若写入次数小于读取次数,说明主设备写入数据的速度较慢,从设备读取数据的速度太快,写入数据与读取数据也不同步。若不进行操作,可能会造成设备播放过程中声音失真的现象。此时,将从设备的读指针指向0数据缓冲区,读取0数据缓冲区中的数据0,停止从音频数据缓冲区读取主设备写入的数据。在主设备的写指针向音频数据缓冲区中新写入数据的次数等于读取次数和写入次数的差值后,将从设备的读指针重新指向在音频数据缓冲区的原位置。读指针指向0数据缓冲区后,写指针继续向音频数据缓冲区写入数据,当继续写入数据的次数等于判断时读取次数与写入次数的差值时,将读 指针从0数据缓冲区中返回,重新指向在音频数据缓冲区中离开前的位置,开始读取数据。
若写入次数等于读取次数,说明写入数据与读取数据的速度相等,两者处于同步的状态,此时不需要进行读指针的操作。
在本发明的一个实施例中,该播放同步方法还包括位置判断的步骤。具体地,定期获取主设备的写指针在音频数据缓冲区中的写入位置和从设备的读指针在音频数据缓冲区中的读取位置。获取写指针的写入位置和读指针的读取位置,是为了判断写入数据与读取数据是否超出极限状态。若写入位置与读取位置的差值小于单个数据包长度,或者写入位置与读取位置的差值大于音频数据缓冲区的长度与单个数据包长度的差值,说明写入数据与读取数据的相对状态已经超出了极限状态。写入位置与读取位置的差值小于单个数据包长度,说明读指针读取数据过快,读指针继续读取数据导致读取数据的位置可能会超过写指针写入数据的位置,造成数据溢出;写入位置与读取位置的差值大于音频数据缓冲区的长度与单个数据包长度的差值,说明读指针读取数据过慢,若写指针继续写入数据,会将未读取的数据覆盖,导致数据丢失。获取写指针的写入位置和读指针的读取位置,在判断两者的差值处于上述两种极限状态下,将音频数据缓冲区内的数据清空,写指针和读指针也清空,累计的写入次数和读取次数清零,从头开始写入数据和读取数据,以便读写数据的同步,保证读写数据的完整性。
在本发明的一个实施例中,每完成一次写入次数和读取次数的大小关系判断后,从设备的读指针进行相应的移动操作。在移动操作进行完成后,需要重新累计写入次数和读取次数,进行下一次的获取判断。具体地,在将从设备的读指针在音频数据缓冲区中向读取方向移动一定长度,或者将从设备的读指针重新指向在音频数据缓冲区的原位置,完成读指针的移动操作,使得读写数据同步后,将写入次数和读取次数清零,分别重新开始累计,等待下一次的判断。
实施例二
图2为本发明实施例提供的一种播放同步装置的功能结构示意图,参见图2,该播放同步装置包括:
次数累计单元201,用于累计主设备的写指针向音频数据缓冲区中写入数据的写入次数,和从设备的读指针从音频数据缓冲区中读取数据的读取次数。具体地,可以使用 累加器一和累加器二分别暂存写入次数和读取次数,写指针每写入数据一次和读指针每读取数据一次,累加器中的算术逻辑单元将写入次数和读取次数分别执行一次累计加一的算术运算,并将运算结果分别存放在累加器一和累加器二中。
判断单元202,用于在写入次数累计至预定次数时,判断写入次数与读取次数的大小关系。具体地,在累加器一中的写入次数达到预定次数时,利用处理器获取累加器二中的读取次数,并判断写入次数和读取次数的大小关系。
第一处理单元203,用于在判断单元202判断写入次数大于读取次数时,将从设备的读指针在音频数据缓冲区中向读取方向移动一定长度。该一定长度为写入次数和读取次数的差值与单个数据包长度的乘积。
写入次数大于读取次数,说明主设备写入数据的速度较快,从设备读取数据的速度太慢,导致写入数据与读取数据不同步。此时,处理器将从设备的读指针在音频数据缓冲区向读取方向移动一定长度,使得写入数据和读取数据同步。移动的一定长度为写入次数和读取次数的差值与单个数据包长度的乘积。
第二处理单元204,用于在判断单元202判断写入次数小于读取次数时,将从设备的读指针指向0数据缓冲区,并在主设备的写指针向音频数据缓冲区中新写入数据的次数等于读取次数和写入次数的差值后,将从设备的读指针重新指向音频数据缓冲区的原位置。
写入次数小于读取次数,说明主设备写入数据的速度较慢,从设备读取数据的速度太快,导致写入数据与读取数据不同步。此时,处理器将从设备的读指针指向0数据缓冲区,读取0数据缓冲区中的数据0,停止从音频数据缓冲区读取主设备写入的数据。在主设备的写指针向音频数据缓冲区中新写入数据的次数等于读取次数和写入次数的差值后,将从设备的读指针重新指向在音频数据缓冲区的原位置。
在本发明的一个实施例中,该播放同步装置还包括:位置获取单元和数据清空单元(图2中未示出)。
位置获取单元,用于定期获取主设备的写指针在音频数据缓冲区中的写入位置和从设备的读指针在音频数据缓冲区中的读取位置。具体地,利用处理器中的算法单元可以获取写指针的写入位置和读指针的读取位置,并存放在指定的存储单元内。
数据清空单元,用于在写入位置与读取位置的差值小于单个数据包长度,或者写入 位置与读取位置的差值大于音频数据缓冲区长度与单个数据包长度的差值,则将音频数据缓冲区内的数据清空,并将写入次数和读取次数清零。
处理器获取指定存储单元内的写入位置和读取位置,并利用算术逻辑单元进行位置的逻辑减运算,若两者的差值小于单个数据包长度,或者大于音频数据缓冲区的长度与单个数据包长度的差值,说明写入数据与读取数据的相对状态已经超出了极限状态。将音频数据缓冲区内的数据清空重新写入和读取数据,并将累加器一中的写入次数和累加器二中的读取次数清零,重新开始累计。
在本发明的一个实施例中,该播放同步装置还包括次数清零单元(图2中未示出),用于在将从设备的读指针在音频数据缓冲区中向读取方向移动一定长度,或者将从设备的读指针重新指向在音频数据缓冲区的原位置之后,将写入次数和读取次数清零,分别重新累计。具体地,在读指针的移动操作完成后,将累加器一中的写入次数和累加器二中的读取次数全部清零,重新开始累计,等待下一次的获取判断。
本实施例提供的一种播放同步装置可以用于执行上述实施例一中的一种播放同步方法,其原理和技术效果类似,此处不再赘述。
实施例三
图3为本发明实施例提供的一种USB声卡的功能结构示意图,参见图3,该USB声卡包括:音频数据缓冲区301、0数据缓冲区302、次数累计单元201、判断单元202、第一处理单元203和第二处理单元204。
次数累计单元201,用于分别累计主设备的写指针向音频数据缓冲区301中写入数据的写入次数和从设备的读指针从音频数据缓冲区301中读取数据的读取次数。
判断单元202,用于在写入次数累计至预定次数时,判断述写入次数与读取次数的大小关系。
第一处理单元203,用于在判断单元202判断写入次数大于读取次数时,将从设备的读指针在音频数据缓冲区中向读取方向移动一定长度,一定长度为写入次数和读取次数的差值与单个数据包长度的乘积。
第二处理单元204,用于在判断单元202判断写入次数小于读取次数时,将从设备的读指针指向0数据缓冲区302,并在主设备的写指针向音频数据缓冲区301中新写入数据的次数等于读取次数和写入次数的差值后,将从设备的读指针重新指向在音频数据 缓冲区301的原位置。
在本发明的一个实施例中,该USB声卡还包括:位置获取单元和数据清空单元(图3中未示出)。
位置获取单元,用于定期获取主设备的写指针在音频数据缓冲区中的写入位置和从设备的读指针在音频数据缓冲区中的读取位置。
数据清空单元,用于在写入位置与读取位置的差值小于单个数据包长度,或者写入位置与读取位置的差值大于音频数据缓冲区长度与单个数据包长度的差值,则将音频数据缓冲区内的数据清空,并将写入次数和所述读取次数清零。
在本发明的一个实施例中,该USB声卡还包括次数清零单元(图3中未示出),用于在将从设备的读指针在音频数据缓冲区中向读取方向移动一定长度,或者将从设备的读指针重新指向在音频数据缓冲区的原位置之后,将写入次数和读取次数清零,分别重新累计。
由此可知,本实施例三提供的USB声卡不但包括了实施例二提供的播放同步装置,还包括了音频数据缓冲区301和0数据缓冲区302。
实施例四
图4为本发明实施例提供的另一种USB声卡的功能结构示意图,参见图4,该USB声卡,包括音频数据缓冲区402、0数据缓冲区402、存储器41和处理器42,存储器41和处理器42之间通过内部总线43通讯连接,存储器41存储有能够被处理器42执行的计算机程序,计算机程序被处理器执行时能够实现上述实施例一的播放同步方法。
在不同的实施例中,存储器41可以是内存或者非易失性存储器。其中非易失性存储器可以是:存储驱动器(如硬盘驱动器)、固态硬盘、任何类型的存储盘(如光盘、DVD等),或者类似的存储介质,或者它们的组合。内存可以是:RAM(Radom Access Memory,随机存取存储器)、易失存储器、非易失性存储器、闪存。进一步,非易失性存储器和内存作为机器可读存储介质,其上可存储由处理器42执行的计算机程序,实现前述的播放同步方法,该方法在图1给出的实施例中已经作了详细阐述,在此不再赘述。
综上所述,本发明实施的技术方案,获取主设备写指针写入数据的写入次数和从设备读指针读取数据的读取次数,通过判断两者的大小关系确定主从设备的数据传输是否 同步。若是不同步,则调整读指针的位置,使写指针与读指针重新处于同步状态,即写入数据与读取数据再次同步。解决了主从设备时钟相对独立,由于时钟偏差造成数据传输不同步的问题。
本发明的技术方案还给出了当写入数据和读取数据的状态超出极限状态的解决方案。获取写指针的写入位置和读指针的读取位置,通过两者的差值判断读写数据是否超出极限状态。若超出极限状态,则将所有写入和读取的数据清空,重新开始读写数据。解决了读写数据超出极限状态引起的数据溢出和数据丢失等问题。
以上所述,仅为本发明的具体实施方式,在本发明的上述教导下,本领域技术人员可以在上述实施例的基础上进行其他的改进或变形。本领域技术人员应该明白,上述的具体描述只是更好的解释本发明的目的,本发明的保护范围应以权利要求的保护范围为准。

Claims (10)

  1. 一种播放同步方法,其特征在于,该方法包括:
    分别累计主设备的写指针向音频数据缓冲区中写入数据的写入次数和从设备的读指针从所述音频数据缓冲区中读取数据的读取次数,在所述写入次数累计至预定次数时,判断所述写入次数与所述读取次数的大小关系;
    若所述写入次数大于所述读取次数,将所述从设备的读指针在所述音频数据缓冲区中向读取方向移动一定长度,所述一定长度为所述写入次数和所述读取次数的差值与单个数据包长度的乘积;
    若所述写入次数小于所述读取次数,将所述从设备的读指针指向0数据缓冲区,并在主设备的写指针向所述音频数据缓冲区中新写入数据的次数等于所述读取次数和所述写入次数的差值后,将所述从设备的读指针重新指向在所述音频数据缓冲区的原位置。
  2. 根据权利要求1所述的方法,其特征在于,该方法还包括:
    定期获取主设备的写指针在所述音频数据缓冲区中的写入位置和从设备的读指针在所述音频数据缓冲区中的读取位置;
    若所述写入位置与所述读取位置的差值小于单个数据包长度,或者所述写入位置与所述读取位置的差值大于所述音频数据缓冲区长度与单个数据包长度的差值,则将所述音频数据缓冲区内的数据清空,并将所述写入次数和所述读取次数清零。
  3. 根据权利要求1或2所述的方法,其特征在于,在将所述从设备的读指针在所述音频数据缓冲区中向读取方向移动一定长度,或者将所述从设备的读指针重新指向在所述音频数据缓冲区的原位置之后,该方法还包括:
    将所述写入次数和所述读取次数清零,分别重新累计。
  4. 一种播放同步装置,其特征在于,该装置包括:
    次数累计单元,被配置为分别累计主设备的写指针向音频数据缓冲区中写入数据的写入次数和从设备的读指针从所述音频数据缓冲区中读取数据的读取次数;
    判断单元,被配置为在所述写入次数累计至预定次数时,判断所述写入次数 与所述读取次数的大小关系;
    第一处理单元,被配置为在所述判断单元判断所述写入次数大于所述读取次数时,将所述从设备的读指针在所述音频数据缓冲区中向读取方向移动一定长度,所述一定长度为所述写入次数和所述读取次数的差值与单个数据包长度的乘积;
    第二处理单元,被配置为在所述判断单元判断所述写入次数小于所述读取次数时,将所述从设备的读指针指向0数据缓冲区,并在主设备的写指针向所述音频数据缓冲区中新写入数据的次数等于所述读取次数和所述写入次数的差值后,将所述从设备的读指针重新指向在所述音频数据缓冲区的原位置。
  5. 根据权利要求4所述的装置,其特征在于,该装置还包括:
    位置获取单元,被配置为定期获取主设备的写指针在所述音频数据缓冲区中的写入位置和从设备的读指针在所述音频数据缓冲区中的读取位置;
    数据清空单元,被配置为若所述写入位置与所述读取位置的差值小于单个数据包长度,或者所述写入位置与所述读取位置的差值大于所述音频数据缓冲区长度与单个数据包长度的差值,则将所述音频数据缓冲区内的数据清空,并将所述写入次数和所述读取次数清零。
  6. 根据权利要求4或5所述的装置,其特征在于,该装置还包括次数清零单元,
    所述次数清零单元,被配置为在将所述从设备的读指针在所述音频数据缓冲区中向读取方向移动一定长度,或者将所述从设备的读指针重新指向在所述音频数据缓冲区的原位置之后,将所述写入次数和所述读取次数清零,分别重新累计。
  7. 一种USB声卡,其特征在于,包括音频数据缓冲区、0数据缓冲区、次数累计单元、判断单元、第一处理单元和第二处理单元;
    所述次数累计单元,被配置为分别累计主设备的写指针向所述音频数据缓冲区中写入数据的写入次数和从设备的读指针从所述音频数据缓冲区中读取数据的读取次数;
    所述判断单元,被配置为在所述写入次数累计至预定次数时,判断所述写入次数与所述读取次数的大小关系;
    所述第一处理单元,被配置为在所述判断单元判断所述写入次数大于所述读取次数时,将所述从设备的读指针在所述音频数据缓冲区中向读取方向移动一定长度,所述一定长度为所述写入次数和所述读取次数的差值与单个数据包长度的乘积;
    所述第二处理单元,被配置为在所述判断单元判断所述写入次数小于所述读取次数时,将所述从设备的读指针指向所述0数据缓冲区,并在主设备的写指针向所述音频数据缓冲区中新写入数据的次数等于所述读取次数和所述写入次数的差值后,将所述从设备的读指针重新指向在所述音频数据缓冲区的原位置。
  8. 根据权利要求7所述的USB声卡,其特征在于,该USB声卡还包括:
    位置获取单元,被配置为定期获取主设备的写指针在所述音频数据缓冲区中的写入位置和从设备的读指针在所述音频数据缓冲区中的读取位置;
    数据清空单元,被配置为若所述写入位置与所述读取位置的差值小于单个数据包长度,或者所述写入位置与所述读取位置的差值大于所述音频数据缓冲区长度与单个数据包长度的差值,则将所述音频数据缓冲区内的数据清空,并将所述写入次数和所述读取次数清零。
  9. 根据权利要求7或8所述的USB声卡,其特征在于,该USB声卡还包括次数清零单元,
    所述次数清零单元,被配置为在将所述从设备的读指针在所述音频数据缓冲区中向读取方向移动一定长度,或者将所述从设备的读指针重新指向在所述音频数据缓冲区的原位置之后,将所述写入次数和所述读取次数清零,分别重新累计。
  10. 一种USB声卡,其特征在于,包括音频数据缓冲区、0数据缓冲区、存储器和处理器,所述存储器和所述处理器之间通过内部总线通讯连接,所述存储器存储有能够被所述处理器执行的计算机程序,所述计算机程序被所述处理器执行时能够实现权利要求1-3任意一项所述的方法步骤。
PCT/CN2017/118089 2017-11-07 2017-12-22 一种播放同步方法、装置和usb声卡 Ceased WO2019090928A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/651,168 US10963213B2 (en) 2017-11-07 2017-12-22 Playback synchronization method and device and USB sound card

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711083439.5A CN108089834B (zh) 2017-11-07 2017-11-07 一种播放同步方法、装置和usb声卡
CN201711083439.5 2017-11-07

Publications (1)

Publication Number Publication Date
WO2019090928A1 true WO2019090928A1 (zh) 2019-05-16

Family

ID=62171861

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/118089 Ceased WO2019090928A1 (zh) 2017-11-07 2017-12-22 一种播放同步方法、装置和usb声卡

Country Status (3)

Country Link
US (1) US10963213B2 (zh)
CN (1) CN108089834B (zh)
WO (1) WO2019090928A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535629B (zh) * 2020-04-15 2024-03-15 瑞昱半导体股份有限公司 数据传输系统、电路与方法
CN112887773A (zh) * 2021-01-22 2021-06-01 昆腾微电子股份有限公司 一种音频设备的同步方法及装置
CN114442992B (zh) * 2022-01-25 2024-01-02 杭州国芯科技股份有限公司 一种usb声卡音频传输协议的切换方法
US12112091B2 (en) * 2023-03-03 2024-10-08 Qualcomm Incorporated Unifying multiple audio bus interfaces in an audio system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1464685A (zh) * 2002-06-13 2003-12-31 优创科技(深圳)有限公司 一种在网络终端缓冲区中处理音频流回放的方法
US20060230215A1 (en) * 2005-04-06 2006-10-12 Woodral David E Elastic buffer module for PCI express devices
CN101296217A (zh) * 2007-04-24 2008-10-29 中芯国际集成电路制造(上海)有限公司 弹性缓冲装置及补偿时钟差异的方法
CN107293316A (zh) * 2016-04-13 2017-10-24 青岛海信电器股份有限公司 一种音频数据处理方法及装置

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5918073A (en) * 1997-06-27 1999-06-29 Advanced Micro Devices, Inc. System and method for equalizing data buffer storage and fetch rates of peripheral devices
JP3417392B2 (ja) * 2000-09-08 2003-06-16 ヤマハ株式会社 同期制御装置
JP4650112B2 (ja) * 2005-06-09 2011-03-16 株式会社日立製作所 記録出力装置、記録出力方法及び記録装置
TW201319927A (zh) 2011-11-02 2013-05-16 Quanta Comp Inc 音訊處理系統及音訊暫存器之調整方法
CN102591815B (zh) * 2011-12-27 2015-07-29 Tcl集团股份有限公司 一种用环形数据缓冲区读写批量数据的方法及装置
JP2014052552A (ja) 2012-09-07 2014-03-20 Sharp Corp メモリ制御装置、携帯端末、メモリ制御プログラムおよびコンピュータ読み取り可能な記録媒体
US10291671B2 (en) * 2016-09-28 2019-05-14 Arris Enterprises Llc Packet prioritization based on packet time stamp information
CN107277295B (zh) * 2017-06-22 2019-10-18 北京数码视讯科技股份有限公司 视频同步处理装置及方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1464685A (zh) * 2002-06-13 2003-12-31 优创科技(深圳)有限公司 一种在网络终端缓冲区中处理音频流回放的方法
US20060230215A1 (en) * 2005-04-06 2006-10-12 Woodral David E Elastic buffer module for PCI express devices
CN101296217A (zh) * 2007-04-24 2008-10-29 中芯国际集成电路制造(上海)有限公司 弹性缓冲装置及补偿时钟差异的方法
CN107293316A (zh) * 2016-04-13 2017-10-24 青岛海信电器股份有限公司 一种音频数据处理方法及装置

Also Published As

Publication number Publication date
US20200272410A1 (en) 2020-08-27
CN108089834A (zh) 2018-05-29
CN108089834B (zh) 2021-04-30
US10963213B2 (en) 2021-03-30

Similar Documents

Publication Publication Date Title
WO2019090928A1 (zh) 一种播放同步方法、装置和usb声卡
US8935574B2 (en) Correlating traces in a computing system
CN106815275B (zh) 一种通过备用数据库实现主备数据库同步的方法与设备
US8522067B2 (en) Variable latency interface for read/write channels
CN101692346B (zh) 一种存储器数据采样装置及一种采样控制器
CN107293316B (zh) 一种音频数据处理方法及装置
EP2808801B1 (en) Multiple data rate memory with read timing information
TWI602196B (zh) 記憶體元件的控制方法、記憶體元件以及記憶體系統
KR20150129316A (ko) 명령 프로세싱 회로들에서의 리던던트 동기화 베리어들의 제거 및 관련 프로세서 시스템들, 방법들 및 컴퓨터-판독가능 매체
KR102427775B1 (ko) 포인터 오프셋이 있는 비동기식 버퍼
US20130003475A1 (en) Memory Access Alignment In A Double Data Rate ('DDR') System
JP2012230621A (ja) メモリ装置、メモリ制御装置、メモリ制御方法
US10331359B2 (en) Memory subsystem with wrapped-to-continuous read
CN101815983A (zh) 用于防止硬盘驱动文件系统的损坏的方法和系统
US9652158B2 (en) Utilization of disk buffer for background replication processes
CN107491398B (zh) 数据同步方法、装置和电子设备
US20220321975A1 (en) Pre-fetch of data using seek intervals
US9471227B2 (en) Implementing enhanced performance with read before write to phase change memory to avoid write cancellations
CN108459837A (zh) 一种音频数据处理方法和装置
CN116580743B (zh) 一种内存读采样电路及其延时调节方法及读采样装置
JP2011008779A (ja) メモリシステム
US10019404B2 (en) Accessing method for accessing hybrid hard-disk drive
KR20080066463A (ko) 멀티미디어 저장장치 및 그 제어방법
JP7310536B2 (ja) 画像処理装置、画像処理方法及びプログラム
JP5132074B2 (ja) メモリアクセス装置

Legal Events

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

Ref document number: 17931212

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17931212

Country of ref document: EP

Kind code of ref document: A1