Usb audio playing method and device of vehicle, electronic equipment and storage medium

By adding an audio adapter module to the USB interface, audio data can be directly transmitted to the audio DSP, solving the problem of audio-video synchronization delay in Bluetooth audio transmission and improving the user experience of in-vehicle audio-video synchronization.

CN116319702BActive Publication Date: 2026-08-25CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310187913.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-01
Publication Date
2026-08-25
Estimated Expiration
2043-03-01

AI Technical Summary

Technical Problem

In existing technologies, Bluetooth audio transmission in vehicles suffers from audio-video synchronization delays due to differences in Bluetooth protocol stacks and codecs supported by different mobile phone manufacturers, resulting in a poor user experience, especially when playing videos or games, where audio and video are out of sync.

Method used

By adding an audio adapter module to the USB interface, the DAC module and ADC module are connected, and audio data is directly transmitted to the audio DSP, reducing encoding/decoding and network transmission latency, and enabling real-time acquisition and forwarding of audio data.

Benefits of technology

It reduces audio and video playback latency, improves the user experience of audio and video synchronization, and ensures plug-and-play functionality in in-car entertainment and office scenarios. It is easy to operate and does not affect vehicle functions or driving safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116319702B_ABST
    Figure CN116319702B_ABST
Patent Text Reader

Abstract

The application relates to a USB audio playing method and device of a vehicle, electronic equipment and a storage medium. The vehicle is provided with a USB device, an audio switching module is arranged between the connection lines, the transmission control protocol of the USB device is a USB HID protocol, the method comprises the following steps: judging whether the audio switching module receives audio data to be played output by a mobile terminal, sending a playing control instruction generated by the audio data to be played to an audio control module through the USB HID protocol, so as to control an audio collection module and a forwarding module in the audio DSP to enter a preparation state, and simultaneously applying for an audio focus; after the audio DSP receives the audio data to be played, inputting the audio data to be played to a DSP mixing module through the audio forwarding module, so as to mix the audio data to be played and preset media audio, and then outputting the mixed audio to a media channel of a power amplifier for output. Therefore, the problem of audio and video playing delay is solved, audio and video playing lag is avoided, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle technology, and in particular to a USB (Universal Serial Bus) audio playback method, apparatus, electronic device, and storage medium for vehicles. Background Technology

[0002] As cars become more intelligent, people are spending more and more time in the cabin, leading to greater demand for in-car entertainment and work. For example, scenarios such as playing high-definition videos on mobile phones, playing high-quality games, and video conferencing require in-car amplifiers to play audio, which places very high demands on audio-video synchronization. Humans perceive sound as real-time if it is below 120ms, and the delay becomes increasingly noticeable above 120ms.

[0003] In related technologies, audio is mainly transmitted via Bluetooth. The mobile phone first connects to the vehicle's Bluetooth. After the connection is established, the sound of playing videos or games will be output through Bluetooth headphones by default. Since Bluetooth is a wireless communication, the Bluetooth protocol stack needs to encode the audio. After encoding, it is transmitted to the Bluetooth module receiver in the vehicle through the Bluetooth module transmitter. The vehicle's Bluetooth module receives the audio data, the Bluetooth protocol stack reads the audio data, decodes the audio data, and finally writes the data into the audio system. The audio system writes the audio DSP (Digital Signal Processing) and finally outputs it to the speakers through the power amplifier.

[0004] However, due to the poor determinism of Bluetooth solutions, such as the different Bluetooth protocol stacks supported by different mobile phone manufacturers, different audio codecs supported, and sound latency ranging from 250ms to 700ms, it is difficult for users to achieve the best experience. In scenarios where video playback or games are very sensitive to sound latency, audio and video will be out of sync, resulting in a poor user experience, which urgently needs to be solved. Summary of the Invention

[0005] This application provides a USB audio playback method, device, electronic device, and storage medium for vehicles to solve the problem of audio and video playback delay, avoid audio and video playback stuttering, and thus improve the user experience.

[0006] The first aspect of this application provides a method for playing audio via USB in a vehicle, comprising the following steps:

[0007] Determine whether the audio switching module has received the audio data to be played from the preset mobile terminal;

[0008] If the audio transfer module receives the audio data to be played, it sends a playback control command generated from the audio data to the audio control module via the USB HID (Human Interface Device) protocol. This allows the audio control module to simultaneously control the audio acquisition module and audio forwarding module within the audio DSP to enter a ready state and request audio focus.

[0009] The audio data to be played is sent to the audio DSP through the audio conversion module. After the audio DSP receives the audio data to be played, it inputs the audio data to be played to the DSP mixing module through the audio forwarding module. The DSP mixing module then mixes the audio data to be played with the preset media audio and outputs it to the media channel of the power amplifier.

[0010] Based on the aforementioned technical means, this application connects the mobile phone and the vehicle via a USB connector by adding an audio adapter module between the USB connection cables. The audio adapter module connects the DAC module and the ADC module, thereby reducing latency in audio encoding / decoding and network transmission. At the same time, by designing the USB interface on the audio DSP, it can acquire and forward data in real time without being affected by system load, greatly improving the user experience in scenarios where audio and video synchronization is particularly sensitive, such as playing videos and games in the car.

[0011] Furthermore, after the audio data to be played and the preset media audio are mixed by the DSP mixing module and output to the media channel of the power amplifier, the method further includes:

[0012] Detect whether the preset mobile terminal has not sent the audio data to be played and / or is not in a connected state;

[0013] If the preset mobile terminal does not send the audio data to be played and / or is not in the connected state, a stop playback command is sent to the audio control module, so that the audio control module sends the stop playback command to the audio acquisition module and the audio distribution module, so that the audio acquisition module and the audio distribution module are in a preset idle state.

[0014] Based on the aforementioned technical means, this application detects that the mobile terminal is not sending audio data or is not in a connected state, and then controls the audio acquisition module and the distribution module to be in an idle state through the audio control module, thereby reducing power consumption and protecting vehicle performance.

[0015] Furthermore, before determining whether the audio switching module has received the audio data to be played from the preset mobile terminal, the method further includes:

[0016] Detect whether the USB device is plugged into the vehicle;

[0017] If the vehicle is plugged into the USB device, then the USB device is initialized;

[0018] After the USB device is initialized, the audio adapter module sends the playback control command to the audio control module and the audio DSP via the USB HID protocol to initialize the audio acquisition module and the audio forwarding module.

[0019] Based on the above technical means, this application initializes the USB device inserted into the vehicle and then directly connects the USB device to the audio DSP, so that the audio DSP is not affected by the system load.

[0020] Furthermore, the aforementioned method for playing audio via USB in a vehicle also includes:

[0021] If the USB device is not plugged into the vehicle, a "not plugged in" message is sent to the audio control module. When the audio control module detects that the audio acquisition module is in a preset working state, it sends a stop playback command to the audio acquisition module and the audio distribution module, so that the audio acquisition module and the audio distribution module are in a preset idle state.

[0022] Based on the aforementioned technical means, this application reduces power consumption and protects vehicle performance by setting the audio acquisition and distribution module of a vehicle without a USB device plugged in to be in an idle state.

[0023] Further, the step of sending the audio data to be played to the audio DSP via the audio conversion module includes:

[0024] The audio data to be played is converted into an analog audio signal through the DAC (Digital to Analog Converter) module of the audio adapter module;

[0025] The audio analog signal is converted into the audio digital signal by the ADC (Analog-to-digital converter) module of the audio conversion module, and the audio digital signal is sent to the audio DSP.

[0026] Based on the above technical means, this application connects the DAC module and the ADC module through an audio adapter module, thereby reducing latency in audio encoding / decoding and network transmission, and enhancing the user experience.

[0027] A second aspect of this application provides a USB audio playback device for a vehicle, comprising:

[0028] The judgment module is used to determine whether the audio conversion module has received the audio data to be played from the preset mobile terminal;

[0029] The processing module is configured to, if the audio transfer module receives the audio data to be played, send a playback control command generated from the audio data to the audio control module via the USBHID protocol, so that the audio control module can simultaneously control the audio acquisition module and audio forwarding module within the audio DSP to enter a ready state and request audio focus; and

[0030] The output module is used to send the audio data to be played to the audio DSP through the audio conversion module, and after the audio DSP receives the audio data to be played, it inputs the audio data to be played to the DSP mixing module through the audio forwarding module, so that the audio data to be played and the preset media audio are mixed by the DSP mixing module and output to the media channel of the power amplifier for output.

[0031] Furthermore, after the audio data to be played and the preset media audio are mixed by the DSP mixing module and output to the media channel of the power amplifier, the output module is further configured to:

[0032] Detect whether the preset mobile terminal has not sent the audio data to be played and / or is not in a connected state;

[0033] If the preset mobile terminal does not send the audio data to be played and / or is not in the connected state, a stop playback command is sent to the audio control module, so that the audio control module sends the stop playback command to the audio acquisition module and the audio distribution module, so that the audio acquisition module and the audio distribution module are in a preset idle state.

[0034] Furthermore, before determining whether the audio switching module has received the audio data to be played from the preset mobile terminal, the determining module is further configured to:

[0035] Detect whether the USB device is plugged into the vehicle;

[0036] If the vehicle is plugged into the USB device, then the USB device is initialized;

[0037] After the USB device is initialized, the audio adapter module sends the playback control command to the audio control module and the audio DSP via the USB HID protocol to initialize the audio acquisition module and the audio forwarding module.

[0038] Furthermore, the aforementioned vehicle's USB audio playback device is also used for:

[0039] If the USB device is not plugged into the vehicle, a "not plugged in" message is sent to the audio control module. When the audio control module detects that the audio acquisition module is in a preset working state, it sends a stop playback command to the audio acquisition module and the audio distribution module, so that the audio acquisition module and the audio distribution module are in a preset idle state.

[0040] Furthermore, the output module is specifically used for:

[0041] The audio data to be played is converted into an analog audio signal by the DAC module of the audio converter module;

[0042] The analog audio signal is converted into a digital audio signal by the ADC module of the audio converter module, and the digital audio signal is sent to the audio DSP.

[0043] A third aspect of this application provides a vehicle, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the USB audio playback method of the vehicle as described in the above embodiments.

[0044] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the USB audio playback method for a vehicle as described in the above embodiments.

[0045] Therefore, this application has the following beneficial effects: it can adapt to the needs of in-cabin entertainment and office work (playing high-definition videos, high-quality games and video conferencing on mobile phones, etc.) brought about by the intelligence of automobiles, and use the car audio system to achieve audio and video synchronization. At the same time, it ensures that users can use it plug and play, and the operation is simple and clear. It does not require the assistance of Bluetooth, WIFI and other functions, nor does it limit the vehicle's own functions. It has no significant impact on driving safety, thereby improving the user experience.

[0046] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0047] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0048] Figure 1 This is a block diagram illustrating a Bluetooth implementation scheme according to an embodiment of this application;

[0049] Figure 2 This is a block diagram illustrating the internal implementation of an audio switching module according to an embodiment of this application;

[0050] Figure 3 This is a block diagram illustrating an audio adapter module according to an embodiment of the present application, as identified by a mobile phone as a USB headphone output device.

[0051] Figure 4 This is a block diagram illustrating an audio adapter module according to an embodiment of the present application that is identified as a USB headphone input device relative to a vehicle.

[0052] Figure 5 This is a flowchart illustrating a USB audio playback method for a vehicle according to an embodiment of this application;

[0053] Figure 6 This is a flowchart illustrating the initialization process of a vehicle system USB device according to an embodiment of this application.

[0054] Figure 7 This is a block diagram illustrating an implementation scheme of USB according to an embodiment of this application;

[0055] Figure 8 This is a block diagram illustrating the process of disconnecting the USB on the vehicle side according to an embodiment of this application.

[0056] Figure 9 A block diagram illustrating the selection of a mobile phone-side USB output device according to an embodiment of this application;

[0057] Figure 10 This is a block diagram illustrating the control flow of the main modules of a playback system according to an embodiment of this application;

[0058] Figure 11 This is a block diagram illustrating the process of disconnecting USB or stopping playback on the mobile phone side according to an embodiment of this application;

[0059] Figure 12 This is a block diagram of a USB audio playback method according to an embodiment of this application;

[0060] Figure 13 This is a block diagram of a USB audio playback device for a vehicle according to an embodiment of this application;

[0061] Figure 14 This is a structural schematic diagram of a vehicle according to an embodiment of this application.

[0062] Explanation of reference numerals in the attached drawings: 10-Vehicle USB audio playback device, 100-Judgment module, 200-Processing module, 300-Output module, 1401-Memory, 1402-Processor, 1403-Communication interface. Detailed Implementation

[0063] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0064] The following description, with reference to the accompanying drawings, describes a method, apparatus, electronic device, and storage medium for playing USB audio in a vehicle according to embodiments of this application.

[0065] Before introducing the vehicle USB audio playback method proposed in the embodiments of this application, let's briefly introduce the vehicle USB audio playback method in related technologies.

[0066] The principle behind the USB audio playback method for vehicles using related technologies is as follows: Figure 1 As shown, the mobile phone first connects to the vehicle's Bluetooth. After the connection is established, the sound of playing videos or games will be output through the Bluetooth headset by default. Since Bluetooth is a wireless communication, the Bluetooth protocol stack needs to encode the audio. After encoding, it is transmitted to the Bluetooth module receiver in the vehicle through the Bluetooth module transmitter. The vehicle's Bluetooth module will receive the audio data. The Bluetooth protocol stack reads the audio data, decodes the audio data, and finally writes the data into the audio system. The audio system writes the data into the audio DSP, and finally outputs it to the speaker through the power amplifier.

[0067] However, the Bluetooth audio data link used by this method is too long, and therefore has the following drawbacks:

[0068] (1) The mobile phone needs to encode the audio data, and the vehicle needs to decode it. Depending on the encoding and decoding format (aptx LL (aptx Low Latency) encoding time is as low as 40ms, and SBC (Sensotronic Brake Control) encoding time is as high as 220ms), plus the decoding time, the expected latency range of audio data encoding and decoding is 80ms to 440ms.

[0069] (2) Audio data is transmitted invalidally via Bluetooth protocol, resulting in a delay of 10ms to 20ms.

[0070] (3) The Bluetooth module and the vehicle system are two separate hardware components. Audio data needs to be transferred across systems to receive audio data from the Bluetooth module and the Bluetooth protocol stack, which will result in a delay of 10ms to 20ms.

[0071] (4) The audio system is then written to the audio DSP, which involves cross-system data transfer and will generate a delay of 20ms to 40ms.

[0072] (5) High software system load and untimely data distribution will increase the risk of audio playback stuttering.

[0073] Related technologies also provide a Bluetooth audio playback processing method, including step S100: calculating the overall delay t of audio data from entering the Bluetooth buffer to outputting from the audio buffer; step S200: calculating the average value of the overall delay t within a preset duration T; step S300: comparing the average value of the overall delay t with the target delay value d to obtain a difference Δt, and adaptively adjusting the target delay value d according to the frame interval time t0 of the Bluetooth buffer receiving audio data and the underload situation of the audio buffer; step S400: comparing the difference Δt with a preset delay difference tp, and determining whether to adjust the number of sampling points for resampling based on the comparison result; and step S500: resampling the audio data in the audio buffer according to the number of sampling points to control the playback speed of the audio data in the audio buffer. This method optimizes the delay of the Bluetooth buffer and the audio buffer to a certain extent by controlling the buffer and time delay on the Bluetooth audio playback path, dynamically adjusting the number of sampling points of the audio data, and dynamically adjusting the playback speed.

[0074] However, this method cannot solve the shortcomings of Bluetooth solutions, especially the time consumption introduced by audio encoding and decoding, and adjusting the number of sampling points will also have a certain impact on audio quality.

[0075] To address the aforementioned issues, this application provides a USB audio playback method for vehicles, wherein the vehicle is equipped with a USB device, an audio adapter module is provided between the connection cables of the USB device, and the transmission control protocol of the USB device is the USBHID protocol.

[0076] Specifically, such as Figures 2 to 4 As shown, Figure 2 This is a block diagram illustrating the internal implementation of an audio switching module according to an embodiment of this application. Figure 3 This is a block diagram illustrating an audio adapter module according to one embodiment of the present application, as recognized by a mobile phone as a USB headphone output device. Figure 4This is a block diagram illustrating an audio adapter module according to an embodiment of the present application, which is identified as a USB headphone input device by a vehicle. The embodiment of the present application adds an audio adapter module between the USB connection cable. The audio adapter module directly connects the DAC module and the ADC module. The audio adapter module converts the audio digital signal into an audio analog signal through the DAC module. The analog signal is then transmitted to the ADC module via a direct connection. The ADC module converts the audio analog signal back into an audio digital signal and then sends it to the DSPUSB interface, thereby reducing latency in audio encoding / decoding and network transmission.

[0077] Furthermore, such as Figure 5 As shown, Figure 5 The flowchart illustrates a USB audio playback method for a vehicle provided in this application embodiment. The vehicle's USB audio playback method includes the following steps:

[0078] In step S501, it is determined whether the audio switching module has received the audio data to be played from the preset mobile terminal.

[0079] The preset mobile terminal can be a mobile phone, speaker, or other media player, and no specific restrictions are made here.

[0080] Furthermore, in some embodiments, before determining whether the audio transfer module has received the audio data to be played from the preset mobile terminal, the method further includes: detecting whether a USB device is inserted into the vehicle; if a USB device is inserted into the vehicle, initializing the USB device; after the USB device is initialized, using the audio transfer module to send playback control commands to the audio control module and the audio DSP via the USB HID protocol to initialize the audio acquisition module and the audio forwarding module.

[0081] Specifically, such as Figure 6 As shown, when the vehicle is powered on and started, this embodiment of the application will detect whether a USB device is inserted into the vehicle. If it is not inserted, the vehicle system will continuously monitor the insertion status of the USB device. If it is inserted, it will determine whether a USB sound card has been created. If it has not been created, the vehicle system will initialize the USB device. It should be noted that if there is a USB device after the vehicle has started, the vehicle system will also initialize the USB device.

[0082] Furthermore, such as Figure 7 As shown, after the USB device is initialized, the audio adapter module sends control commands to the audio control module on the vehicle system SOC (System On Chip) side via the USB HID protocol to register that the USB device has been inserted. At the same time, it sends control commands to the audio DSP to initialize the audio acquisition module and the audio forwarding module.

[0083] It should be noted that if a regular USB input device is plugged into the vehicle, and there is no USB HID protocol notification to the audio control module, the audio control module will default to IDLE state and will not start the initialization work of the internal modules of the audio DSP.

[0084] Furthermore, in some embodiments, the above-described vehicle USB audio playback method further includes: if the vehicle does not have a USB device plugged in, sending a no-plug information to the audio control module, so that when the audio control module detects that the audio acquisition module is in a preset working state, it sends a stop playback command to the audio acquisition module and the audio distribution module, so that the audio acquisition module and the audio distribution module are in a preset idle state.

[0085] Specifically, such as Figure 8 As shown, if the vehicle does not have a USB device plugged in, the vehicle system will remove the USB device and notify the audio control module that the vehicle does not have a USB device plugged in. At this time, if the audio control module detects that the audio acquisition module is in working state, the audio control module will send a stop playback command to notify the audio DSP's audio acquisition module and audio distribution module to be in IDLE state.

[0086] In addition, such as Figure 9 As shown, when a mobile phone connects to an audio adapter module via USB, the audio adapter module will be recognized by the mobile phone as a USB output device. Taking a USB headset as an example, when the mobile phone plays audio, the sound will be output directly from the USB channel and forwarded to the audio adapter module. The mobile phone has the right to choose whether to use the USB output device. If the output is selected from the mobile phone, the entire USB link is in an IDLE state.

[0087] In step S502, if the audio transfer module receives the audio data to be played, it sends a playback control command generated from the audio data to the audio control module via the USB HID protocol. This allows the audio control module to control the audio acquisition module and audio forwarding module in the audio DSP to enter the preparation state while simultaneously requesting audio focus.

[0088] Specifically, such as Figure 10 As shown in this embodiment, after the audio transfer module receives the audio data to be played, it first sends a data start playback command to the vehicle via the USB HID protocol. After receiving the command, the audio control module controls the audio acquisition module and audio forwarding module in the audio DSP to be in the Ready state and synchronously requests audio focus to notify the vehicle system that the audio device is being used.

[0089] It should be noted that the audio focus is the decision-maker for synchronizing audio resources across various scenarios within the vehicle system. To use the vehicle system's audio resources, an audio focus application must be submitted and approved before use is permitted.

[0090] In step S503, the audio data to be played is sent to the audio DSP through the audio conversion module. After the audio DSP receives the audio data to be played, it inputs the audio data to be played to the DSP mixing module through the audio forwarding module. The DSP mixing module then mixes the audio data to be played with the preset media audio and outputs it to the media channel of the power amplifier.

[0091] In some embodiments, the audio data to be played is sent to the audio DSP via the audio conversion module, including: converting the audio data to be played into an analog audio signal via the DAC module of the audio conversion module; converting the analog audio signal into a digital audio signal via the ADC module of the audio conversion module, and sending the digital audio signal to the audio DSP.

[0092] Specifically, such as Figure 2 As shown in the embodiment of this application, the audio conversion module converts the audio digital signal into an audio analog signal through the DAC module. The analog signal is then transmitted to the ADC module through a direct connection. The ADC module converts the audio analog signal into an audio digital signal, which is then sent to the DSP USB interface.

[0093] Furthermore, such as Figure 7 As shown in this embodiment, after the audio acquisition module inside the audio DSP receives the audio data to be played from the USB interface, it sends it to the audio forwarding module. The audio forwarding module inputs the audio data to be played into the DSP mixing module. The DSP mixing module mixes the audio data to be played with the preset media audio and outputs it to the media channel of the power amplifier for output.

[0094] Furthermore, in some embodiments, after the audio data to be played and the preset media audio are mixed by the DSP mixing module and output to the media channel of the power amplifier, the method further includes: detecting whether the preset mobile terminal has not sent the audio data to be played and / or is not in a connected state; if the preset mobile terminal has not sent the audio data to be played and / or is not in a connected state, a stop playback command is sent to the audio control module, so that the audio control module sends the stop playback command to the audio acquisition module and the audio distribution module, so that the audio acquisition module and the audio distribution module are in a preset idle state.

[0095] For example, such as Figure 11 As shown in this embodiment, when the audio conversion module detects that the mobile phone has not sent the audio data to be played or the mobile phone has been removed from the connection state, the USB control module will send a stop command to the audio control module through the USB HID protocol. The audio control module then notifies the audio acquisition module and audio distribution module of the audio DSP that they are in the IDLE state.

[0096] Furthermore, such as Figure 12 As shown, Figure 12 This is a block diagram illustrating a USB audio playback method according to an embodiment of this application. This embodiment connects a mobile phone and a vehicle via a USB connector by adding an audio adapter module between the USB connection cables. The audio adapter module connects the DAC module and the ADC module, and the USB interface is designed on the audio DSP, enabling real-time data acquisition and forwarding unaffected by system load. Furthermore, the latency of the entire path is less than 40ms, solving the low-latency playback problem and greatly improving the user experience in scenarios where audio and video synchronization is particularly sensitive, such as playing videos and games in the car.

[0097] According to the embodiments of this application, if the audio transfer module receives audio data to be played from a preset mobile terminal, it sends a playback control command generated from the audio data to the audio control module via the USB HID protocol. This controls the audio acquisition module and the forwarding module within the audio DSP to enter a ready state and simultaneously request audio focus. After the audio DSP receives the audio data to be played sent through the audio transfer module, it inputs the audio data to be played into the DSP mixing module via the audio forwarding module. The audio data to be played is then mixed with preset media audio and output to the media channel of the power amplifier. This solves the problem of audio and video playback latency, avoids audio and video playback stuttering, and thus improves the user experience.

[0098] Next, a USB audio playback device for a vehicle according to an embodiment of this application is described with reference to the accompanying drawings.

[0099] Figure 13 This is a block diagram of a vehicle's USB audio playback device according to an embodiment of this application. In this embodiment, the vehicle is equipped with a USB device, an audio adapter module is provided between the connection cables of the USB device, and the transmission control protocol of the USB device is the USB HID protocol.

[0100] like Figure 13 As shown, the vehicle's USB audio playback device 10 includes: a judgment module 100, a processing module 200, and an output module 300.

[0101] The judgment module 100 is used to determine whether the audio transfer module has received the audio data to be played from the preset mobile terminal.

[0102] Processing module 200 is used to send playback control commands generated from the audio data to be played to the audio control module via the USB HID protocol if the audio transfer module receives the audio data to be played. This allows the audio control module to simultaneously control the audio acquisition module and audio forwarding module within the audio DSP to enter a ready state while requesting audio focus.

[0103] The output module 300 is used to send the audio data to be played to the audio DSP through the audio conversion module, and after the audio DSP receives the audio data to be played, it inputs the audio data to be played to the DSP mixing module through the audio forwarding module, so that the audio data to be played and the preset media audio are mixed by the DSP mixing module and output to the media channel of the power amplifier for output.

[0104] Furthermore, in some embodiments, after the audio data to be played and the preset media audio are mixed by the DSP mixing module and output to the media channel of the power amplifier, the output module 300 is further configured to:

[0105] Detect whether the preset mobile terminal has not sent the audio data to be played and / or is not in a connected state;

[0106] If the preset mobile terminal does not send audio data to be played and / or is not in a connected state, a stop playback command is sent to the audio control module, which in turn sends the stop playback command to the audio acquisition module and the audio distribution module, so that the audio acquisition module and the audio distribution module are in a preset idle state.

[0107] Furthermore, in some embodiments, before determining whether the audio switching module has received the audio data to be played from the preset mobile terminal, the determining module 100 is further configured to:

[0108] Check if a USB device is plugged into the vehicle;

[0109] If a USB device is plugged into the vehicle, initialize the USB device;

[0110] After the USB device is initialized, the audio adapter module sends playback control commands to the audio control module and audio DSP via the USB HID protocol to initialize the audio acquisition module and audio forwarding module.

[0111] Furthermore, in some embodiments, the aforementioned vehicle USB audio playback device 10 is also used for:

[0112] If no USB device is plugged into the vehicle, a "not plugged in" message is sent to the audio control module. When the audio control module detects that the audio acquisition module is in a preset working state, it sends a stop playback command to the audio acquisition module and the audio distribution module, so that the audio acquisition module and the audio distribution module are in a preset idle state.

[0113] Furthermore, in some embodiments, the output module 300 is specifically used for:

[0114] The DAC module of the audio converter module converts the audio data to be played into an analog audio signal;

[0115] The ADC module of the audio converter module converts the analog audio signal into a digital audio signal, and then sends the digital audio signal to the audio DSP.

[0116] It should be noted that the foregoing explanation of the embodiment of the USB audio playback method for vehicles also applies to the USB audio playback device of the vehicle in this embodiment, and will not be repeated here.

[0117] According to the vehicle USB audio playback device proposed in this application embodiment, upon determining that the audio transfer module has received audio data to be played from a preset mobile terminal, a playback control command generated from the audio data to be played is sent to the audio control module via the USB HID protocol. This controls the audio acquisition module and forwarding module within the audio DSP to enter a ready state and simultaneously request audio focus. After the audio DSP receives the audio data to be played sent through the audio transfer module, the audio forwarding module inputs the audio data to be played into the DSP mixing module, mixing the audio data to be played with preset media audio before outputting it to the media channel of the power amplifier. This solves the problem of audio and video playback latency, avoids audio and video playback stuttering, and thus improves the user experience.

[0118] Figure 14 A schematic diagram of the structure of a vehicle provided in an embodiment of this application. The vehicle may include:

[0119] The memory 1401, the processor 1402, and the computer program stored on the memory 1401 and executable on the processor 1402.

[0120] When the processor 1402 executes the program, it implements the USB audio playback method for vehicles provided in the above embodiments.

[0121] Furthermore, the vehicle also includes:

[0122] Communication interface 1403 is used for communication between memory 1401 and processor 1402.

[0123] The memory 1401 is used to store computer programs that can run on the processor 1402.

[0124] The memory 1401 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.

[0125] If the memory 1401, processor 1402, and communication interface 1403 are implemented independently, then the communication interface 1403, memory 1401, and processor 1402 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 14 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0126] Optionally, in a specific implementation, if the memory 1401, processor 1402, and communication interface 1403 are integrated on a single chip, then the memory 1401, processor 1402, and communication interface 1403 can communicate with each other through an internal interface.

[0127] The processor 1402 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of this application.

[0128] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described vehicle USB audio playback method.

[0129] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0130] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0131] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0132] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.

[0133] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware, and the program can be stored in a computer-readable storage medium. When executed, the program includes one or a combination of the steps of the method embodiments.

[0134] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A method for playing audio via USB in a vehicle, characterized in that, The vehicle is equipped with a USB device, and an audio adapter module is provided between the connection cables of the USB device. The transmission control protocol of the USB device is the USB HID protocol. The method includes the following steps: Before determining whether the audio adapter module has received the audio data to be played from the preset mobile terminal, it checks whether the USB device is plugged into the vehicle. If the USB device is plugged into the vehicle, the USB device is initialized. After the USB device is initialized, the audio adapter module sends a control command to the audio control module on the vehicle system SOC side via the USB HID protocol to register that the USB device has been plugged in. At the same time, it sends a control command to the audio DSP to initialize the audio acquisition module and the audio forwarding module. If a regular USB input device is plugged into the vehicle, there is no USB HID protocol notification to the audio control module. The audio control module defaults to IDLE state and does not start the initialization work of the internal modules of the audio DSP. The preset mobile terminal is a mobile phone. When the mobile phone is connected to the audio adapter module via USB, the audio adapter module is recognized by the mobile phone as a USB output device. When the mobile phone plays audio, the sound is directly output from the USB channel and forwarded to the audio adapter module. If the mobile phone chooses to output from the mobile phone, the entire USB link is in an IDLE state. Determine whether the audio switching module has received the audio data to be played from the preset mobile terminal; If the audio transfer module receives the audio data to be played, it sends a playback control command generated from the audio data to the audio control module via the USB HID protocol. This allows the audio control module to simultaneously control the audio acquisition module and audio forwarding module within the audio DSP to enter a ready state and request audio focus. The audio data to be played is sent to the audio DSP through the audio transfer module. After the audio DSP receives the audio data to be played, it inputs the audio data to be played to the DSP mixing module through the audio forwarding module. The DSP mixing module then mixes the audio data to be played with the preset media audio and outputs it to the media channel of the power amplifier. The USB interface is designed on the audio DSP, enabling real-time data acquisition and forwarding, unaffected by system load. The step of sending the audio data to be played to the audio DSP through the audio conversion module includes: converting the audio data to be played into an analog audio signal through the DAC module of the audio conversion module; converting the analog audio signal into a digital audio signal through the ADC module of the audio conversion module; and sending the digital audio signal to the audio DSP. The analog audio signal is transmitted to the ADC module via a direct connection. The ADC module converts the analog audio signal into a digital audio signal and then sends it to the DSP USB interface. The audio acquisition module inside the audio DSP receives the audio data to be played from the USB interface and then sends it to the audio forwarding module.

2. The method according to claim 1, characterized in that, After the audio data to be played and the preset media audio are mixed by the DSP mixing module and output to the media channel of the power amplifier, the following steps are also included: Detect whether the preset mobile terminal has not sent the audio data to be played and / or is not in a connected state; If the preset mobile terminal does not send the audio data to be played and / or is not in the connected state, a stop playback command is sent to the audio control module, so that the audio control module sends the stop playback command to the audio acquisition module and the audio forwarding module, so that the audio acquisition module and the audio forwarding module are in a preset idle state.

3. The method according to claim 1, characterized in that, Also includes: If the USB device is not plugged into the vehicle, a "not plugged in" message is sent to the audio control module. When the audio control module detects that the audio acquisition module is in a preset working state, it sends a stop playback command to the audio acquisition module and the audio forwarding module, so that the audio acquisition module and the audio forwarding module are in a preset idle state.

4. A USB audio playback device for a vehicle, characterized in that, The vehicle is equipped with a USB device, an audio adapter module is provided between the connection cables of the USB device, and the transmission control protocol of the USB device is the USB HID protocol, used to implement the method as described in any one of claims 1-3, wherein the device includes: The judgment module is used to determine whether the audio conversion module has received the audio data to be played from the preset mobile terminal; The processing module is configured to, if the audio transfer module receives the audio data to be played, send a playback control command generated from the audio data to the audio control module via the USB HID protocol, so that the audio control module can simultaneously control the audio acquisition module and audio forwarding module within the audio DSP to enter a ready state and request audio focus; and The output module is used to send the audio data to be played to the audio DSP through the audio conversion module, and after the audio DSP receives the audio data to be played, it inputs the audio data to be played to the DSP mixing module through the audio forwarding module, so that the audio data to be played and the preset media audio are mixed by the DSP mixing module and output to the media channel of the power amplifier for output.

5. The apparatus according to claim 4, characterized in that, After the audio data to be played and the preset media audio are mixed by the DSP mixing module and output to the media channel of the power amplifier, the output module is further configured to: Detect whether the preset mobile terminal has not sent the audio data to be played and / or is not in a connected state; If the preset mobile terminal does not send the audio data to be played and / or is not in the connected state, a stop playback command is sent to the audio control module, so that the audio control module sends the stop playback command to the audio acquisition module and the audio forwarding module, so that the audio acquisition module and the audio forwarding module are in a preset idle state.

6. The apparatus according to claim 5, characterized in that, The aforementioned vehicle's USB audio playback device is also used for: If the USB device is not plugged into the vehicle, a "not plugged in" message is sent to the audio control module. When the audio control module detects that the audio acquisition module is in a preset working state, it sends a stop playback command to the audio acquisition module and the audio forwarding module, so that the audio acquisition module and the audio forwarding module are in a preset idle state.

7. The apparatus according to claim 4, characterized in that, The output module is specifically used for: The audio data to be played is converted into an analog audio signal by the DAC module of the audio converter module; The analog audio signal is converted into a digital audio signal by the ADC module of the audio converter module, and the digital audio signal is sent to the audio DSP.

8. A vehicle, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the USB audio playback method for a vehicle as described in any one of claims 1-3.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the USB audio playback method for the vehicle as described in any one of claims 1-3.

Citation Information

Patent Citations

  • USB audio and power transmission

    CN104813296A

  • In-vehicle audio processing method and system, electronic equipment and storage medium

    CN115278462A

  • Control method and device, electronic equipment and readable storage medium

    CN115396520A