Volume adjustment method and device, electronic equipment, system and storage medium

By implementing the volume adjustment method in the USB slave device, the problem of poor volume control compatibility of USB music devices in different host systems is solved, ensuring that users can adjust the device volume normally and improve the user experience.

CN119937972APending Publication Date: 2025-05-06SHENZHEN BLUETRUM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411967606.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

When existing USB music devices are used under different host systems, the volume control compatibility is poor, which makes it impossible for users to adjust the device volume on some hosts, making the user experience inconvenient.

Method used

By implementing the volume adjustment method in the USB slave device, including establishing a connection with the host device, enumerating the characteristic unit descriptors, and performing the volume adjustment strategy based on the enumeration response result. The strategy includes a first adjustment strategy, controlling the local gain of the slave device by communicating with the host device, and a second adjustment strategy.

Benefits of technology

Improves the compatibility of USB slave devices in multiple host systems, ensuring that users can adjust the device volume normally on different hosts, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119937972A_ABST
    Figure CN119937972A_ABST
Patent Text Reader

Abstract

The invention relates to the field of volume control, in particular to a volume adjustment method and device, electronic equipment, a system and a storage medium, the volume adjustment method comprises the following steps: establishing connection with host equipment, and enumerating a characteristic unit descriptor to the host equipment; an enumeration response of the host device about the characteristic unit descriptor is monitored, a volume adjustment strategy is executed according to an enumeration response result, the volume adjustment strategy comprises a first adjustment strategy and a second adjustment strategy, the first adjustment strategy is used for adjusting the volume of the host device according to the enumeration response and downlink audio information, and the second adjustment strategy is used for adjusting the volume of the host device. And communicating with the host device to adjust the volume, wherein the second adjustment strategy is used for controlling the local gain of the slave device. According to the invention, the compatibility of volume adjustment of the USB slave equipment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of volume control, and specifically to a volume adjustment method, device, electronic device, system and storage medium. Background Art

[0002] With the development of USB (Universal Serial Bus) technology, the popularity of mobile devices, and the development of music applications, USB music devices are becoming more and more popular. In the process of using USB music devices, the most commonly used technical points are data stream transmission and the interaction of USB HID control commands.

[0003] The use of USB music devices is inseparable from the USB host, but there are many kinds of hosts and their systems on the market. Different hosts have different processing methods for USB HID commands, which will cause USB compatibility issues, especially in the volume control function. This will cause users to be unable to control the device and adjust the volume of the slave device when using USB music devices on some hosts, which makes the user experience very inconvenient.

[0004] Therefore, when it comes to volume and HID command adjustment between a USB host and a device, a method is needed to improve the compatibility of USB slave devices in various host systems. Summary of the invention

[0005] The object of the present invention is to provide a volume adjustment method, device, electronic device, system and storage medium to improve the compatibility of USB slave devices.

[0006] In a first aspect, the present invention provides a volume adjustment method, which is applied to a USB slave device, comprising: establishing a connection with a host device and enumerating a characteristic unit descriptor to the host device; monitoring the enumeration response of the host device regarding the characteristic unit descriptor, and executing a volume adjustment strategy according to the enumeration response result, the volume adjustment strategy comprising a first adjustment strategy and a second adjustment strategy, the first adjustment strategy being used to communicate with the host device to adjust the volume according to the enumeration response and downstream audio information, and the second adjustment strategy being used to control the local gain of the slave device.

[0007] In a second aspect, the present invention provides a volume adjustment device applied to the audio adjustment method as described above, applied to a slave device in a USB system, wherein the slave device establishes a USB connection with a host device, and the volume adjustment device comprises: a transceiver module, used for communication interaction between the slave device and the host device; a monitoring module, used for monitoring an enumeration response of the host device, the HID response and downstream audio information; and a control module, used for executing the volume adjustment strategy according to the monitoring result of the monitoring module.

[0008] In a third aspect, the present invention provides an electronic device, comprising a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory, and when the processor executes the one or more computer programs, the electronic device implements the volume adjustment method as described above.

[0009] In a fourth aspect, the present invention provides a volume adjustment system, the system comprising a first electronic device and a second electronic device, the first electronic device being the above-mentioned electronic device, the first electronic device serving as a slave in the system for executing the above-mentioned volume adjustment method.

[0010] In a fifth aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program includes program instructions, which, when executed by a processor, cause the processor to perform the method as described above.

[0011] In the volume adjustment method provided by the present invention, by enumerating characteristic unit descriptors to the host device and detecting the enumeration response to execute the volume adjustment strategy, different volume adjustment strategies are applied to different enumeration responses and downstream audio information, so that the USB slave device is compatible with the differences in volume control adjustment of various USB host systems, and the compatibility of the USB slave device in adjusting the amplitude of its own sound output is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0013] Figure 1 A schematic diagram of the structure of the master-slave device communication provided by an embodiment of the present invention; Figure 2 A schematic diagram of the steps of a volume adjustment method provided by an embodiment of the present invention; Figure 3 A specific flow chart of the volume adjustment method provided by an embodiment of the present invention; Figure 4 A schematic diagram of the structure of a volume adjustment device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0014] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0015] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in this application do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.

[0016] Reference Figure 1 As shown, the USB host device 101 is connected and communicated with the USB slave device 102. When the connection is just made, the slave device 102 needs to enumerate its own related information to the host device 101. This information is mainly realized through various descriptors. The host device 101 determines what type of device the slave device 102 is based on the descriptor, and performs operations such as address allocation and configuration selection on the slave device 102.

[0017] The relevant information enumerated by the slave device 102 to the host device 101 includes various descriptors. The application of these descriptors needs to comply with the USB official protocol and its various sub-protocols. The USB audio device mainly complies with the UAC (USB Audio Class) protocol in USB.

[0018] The UAC protocol defines the implementation and control functions of audio devices under the USB specification. The prominent descriptors of this protocol include: standard / class-specific audio control interface descriptors, input / output terminal descriptors, feature unit descriptors, standard / class-specific audio stream interface descriptors, etc. After completing operations such as enumeration of the slave device 102 and configuration of the host, the host device 101 and the slave device 102 perform data stream transmission and command interaction under the descriptor specification.

[0019] Among them, the feature unit descriptor is used to describe the control characteristics of the audio, including audio format, sampling rate, channel, audio processing capabilities (mixing, sound effect processing, volume adjustment, etc.) and other characteristics. The volume adjustment control can be completed through the volume adjustment characteristics in the feature unit descriptor.

[0020] The characteristic unit descriptor is enumerated by the slave to the host device 101. The host device 101 knows that the slave device 102 supports the characteristic unit descriptor. After the descriptor information exchange is completed, the host device 101 will send Get_Max, Get_Min, Get_Res and other request instructions to the slave device 102 to obtain the basic attributes of the Volume characteristic of the slave device 102. At the same time, the volume control function is enabled by default in the host device 101. At this time, the host device 101 will send the Set_Cur instruction to the slave device 102 to inform the slave device 102 of the current host volume value. After receiving it, the slave device 102 will make corresponding processing.

[0021] When the host device 101 subsequently adjusts the host volume bar to update the host volume, the host device 101 will also send a corresponding Volume control instruction Set_Cur to the slave device 102 under the specification of the characteristic unit descriptor to inform the slave device 102 of the adjusted host volume value.

[0022] In addition, the host device 101 and the slave device 102 can also complete the interaction of instructions while following the HID (Human Interface Device) protocol. If the slave device 102 supports enabling the HID function, the information enumerated by the slave device 102 needs to include the relevant HID descriptor. After the host device 101 obtains the HID descriptor of the slave device 102, it will actively send instructions to the slave device 102 to obtain the HID report of the slave device 102. The HID report can include many functions. Subsequently, the slave device 102 will send the corresponding data to the host device 101 according to this report, and the host device 101 will also parse the data sent from the slave through this report.

[0023] Regarding HID reports, the standards for reports are unified and need to be written in reference to the standard HID protocol. In the HID protocol, the classification of functions is usually distinguished by Usage Page and Usage. The HID protocol defines a usage page named Consumer, which contains two uses, Volume Increment and Volume Decrement. These two uses are used to control the increase and decrease of the host volume. They are usually used by the slave device 102 to report command information to control the increase and decrease of the host volume. After the host device 101 receives these two control instructions, there are two situations: responding to the instructions and not responding to the instructions. This depends on the operation mode of different host systems, which also brings about the above-mentioned technical problems. When the host does not respond to the instructions, the user cannot control the device and complete the volume adjustment.

[0024] In view of this, the present application embodiment provides a volume adjustment method, which is applied to the slave device 102, see Figure 2 The volume adjustment method includes: establishing a connection with a host device and enumerating a characteristic unit descriptor to the host device; monitoring the enumeration response of the host device regarding the characteristic unit descriptor, and executing a volume adjustment strategy according to the enumeration response result, wherein the volume adjustment strategy includes a first adjustment strategy and a second adjustment strategy, wherein the first adjustment strategy is used to communicate with the host device to adjust the volume according to the enumeration response and downlink audio information, and the second adjustment strategy is used to control the local gain of the slave device.

[0025] The above enumeration response results include no response and response, and the slave device determines whether the host device supports the UAC function based on this. In the case of no response, it means that the host device does not support UAC, the volume adjustment strategy implements the second adjustment strategy, and the slave device only performs local volume gain adjustment. In the case of a response, it means that the host device supports UAC, the volume adjustment strategy implements the first adjustment strategy, and communicates with the host device to adjust the volume.

[0026] Some host systems may support UAC but not HID. Therefore, the above method further continues to enumerate volume-related HID descriptors to the host device after receiving the enumeration response, and executes the first adjustment strategy according to the HID response and the downlink audio information.

[0027] When the host device supports HID, it will send a corresponding HID response for the above HID descriptor. The slave device can judge that the host device supports HID based on this HID response, and then complete the HID volume adjustment command interaction with the host normally. The slave device synchronizes the local gain according to the volume adjustment command to adjust the output volume of the slave device.

[0028] However, it is possible that some host devices support HID but do not issue corresponding instructions, and only process the amplitude of the downstream audio data to change the amplitude of the downstream audio data, and indirectly adjust the volume of the audio data. Therefore, when the existing slave device does not receive the HID response, it abandons the volume adjustment communication with the host device. Even if the user subsequently performs a volume adjustment operation on the slave device, the slave device will not request the host device to update the volume, and only perform local gain adjustment.

[0029] Therefore, in some specific embodiments of the present application, the above-mentioned first adjustment strategy includes a first adjustment sub-strategy and a second adjustment sub-strategy; the first adjustment sub-strategy is used to communicate with the host device to adjust the volume according to the enumeration response and the HID response; the second adjustment sub-strategy is used to send a volume adjustment instruction to the host device according to the downlink audio information.

[0030] The first adjustment sub-strategy is the strategy executed after receiving the enumeration response and the HID response.

[0031] When the slave device does not receive a HID response, it parses the received audio data in the following time and periodically detects whether its audio energy has changed. If the energy of the audio data in different periods changes, the slave device may believe that the host device has adjusted the amplitude of the downlink audio data. Therefore, even if the HID response is not received, it can still be determined whether the host device supports HID based on the energy detection of the downlink audio data. If the host device supports HID, the second adjustment sub-strategy mentioned above is executed, and the subsequent volume adjustment operation for the user can communicate with the host device normally for volume update.

[0032] For other host systems that do not support HID and do not perform amplitude processing on the downstream audio data, when the slave device detects that there is no HID response and the energy of the received downstream audio data does not change much, it will execute the second adjustment strategy and only perform local volume gain adjustment.

[0033] In order to avoid the influence of occasional energy jitters during the communication between the master and slave devices on the selection of the audio adjustment strategy, the above-mentioned downlink audio energy value includes an instantaneous energy value and / or a short-time energy value. The instantaneous energy value is the average value of the downlink audio energy within the period, and the short-time energy value is the average value of the downlink audio energy within the period. The period of the instantaneous energy value is different from the period of the short-time energy value, and the instantaneous energy value or the adjacent periods of the short-time energy value partially overlap. For example, the period of the instantaneous energy value is 400ms, the overlap rate of adjacent periods is 75%, and the calculation period of the instantaneous energy value is 0-400ms, 100-500ms, 200-600ms, etc.; the period of the short-time energy value is 1s, the overlap rate of adjacent periods is 75%, and the calculation period of the short-time energy value is 0-1s, 0.25-1.25s, 0.5-1.5s, etc.

[0034] The instantaneous energy value and short-time energy value are calculated in real time and weighted, which can accurately determine whether the energy value changes, and play a role in de-jittering filtering. When the slave device sends a HID volume adjustment command to the host device and the host device does not send a request to update the host volume, the slave device makes a judgment based on the actual energy value. If the actual energy value changes, it is considered that the audio data amplitude has changed, and it is judged that the host will respond to the HID volume control command but will not send a request to update the host volume. At this time, the slave device can report the HID volume adjustment command normally to complete the control adjustment of the output sound amplitude of the slave device.

[0035] Reference Figure 3 , which shows the specific process of the above volume adjustment method, the slave device establishes a connection with the host device, and enumerates the characteristic unit descriptor to the host device, monitors whether the enumeration response of the corresponding descriptor is received, if not, it means that the host device does not support UAC volume adjustment, the slave device executes the second adjustment strategy, and only performs local gain adjustment, if so, further sends a HID volume adjustment instruction, and monitors whether a HID response to the corresponding instruction is received, if the HID response is received, it means that the host device supports HID volume adjustment and will communicate with the slave device to update the volume, the slave device executes the first adjustment sub-strategy, communicates with the host device to adjust the volume, if not Upon receiving the HID response, the host device further detects whether there is any energy change in the downstream volume data sent by the host device. If the energy of the downstream audio data does not change, it means that the host device does not communicate with the slave device to update the volume and does not adjust the amplitude of the audio data. It does not support HID volume adjustment, and executes the second adjustment strategy, and only performs local gain adjustment. If the energy of the downstream audio data changes, it means that although the host device does not communicate with the slave device to update the volume, it adjusts the amplitude of the audio data. It supports HID volume adjustment, and the slave device executes the second adjustment sub-strategy. When the user performs a volume adjustment operation, the HID adjustment instruction is normally sent to instruct the host device to adjust the volume.

[0036] Correspondingly, as another aspect of the embodiment of the present application, the embodiment of the present application provides a volume adjustment device applying the above volume adjustment method, the volume adjustment device is applied to a slave device in a USB system, the slave device establishes a USB connection with the host device, and refers to Figure 4 The volume adjustment device includes: a transceiver module 201, used for communication interaction between the slave device and the host device; a monitoring module 202, used to monitor the enumeration response, the HID response and downlink audio information of the host device; a control module 203, used to execute the above-mentioned volume adjustment strategy according to the monitoring result of the monitoring module.

[0037] As another aspect of the embodiments of the present application, the embodiments of the present application provide an electronic device and a data receiving device. The electronic device and the data receiving device may be software modules, the software modules include several instructions, which are stored in a memory, and the processor may access the memory and call the instructions for execution to complete the volume adjustment method described in the above-mentioned various embodiments.

[0038] In some embodiments, the electronic device and the data receiving device may be constructed by hardware devices, for example, the electronic device and the data receiving device may be constructed by one or more chips, and the chips may work in coordination with each other to complete the volume adjustment method and the data receiving method described in the above embodiments. For another example, the electronic device and the data receiving device may also be constructed by a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine), a programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components.

[0039] It should be noted that the above-mentioned electronic device and data receiving device can execute the volume adjustment method and data receiving method provided in the implementation mode of the present application, and have the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the electronic device implementation mode, please refer to the volume adjustment method and data receiving method provided in the implementation mode of the present application.

[0040] An embodiment of the present application further provides a volume adjustment system, which includes the above-mentioned electronic device and the above-mentioned data receiving device, the electronic device is used to execute the above-mentioned volume adjustment method, and the data receiving device is used to execute the method as described in the above-mentioned embodiment.

[0041] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method described in the above embodiment.

[0042] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0043] Finally, it should be noted that the present application can be implemented in many different forms and is not limited to the embodiments described in this specification. These embodiments are not intended to be additional limitations on the content of the present application. The purpose of providing these implementation methods is to make the understanding of the disclosure of the present application more thorough and comprehensive. And under the thinking of the present application, the above-mentioned technical features continue to be combined with each other, and there are many other changes in different aspects of the present application as described above, which are all deemed to be within the scope of the present application specification. Further, for those of ordinary skill in the art, improvements or changes can be made according to the above description, and all these improvements and changes should fall within the scope of protection of the claims attached to the present application.

Claims

1. A volume adjustment method, applied to a USB slave device, characterized in that: include: Establishing a connection with a host device and enumerating characteristic unit descriptors to the host device; Monitor the enumeration response of the host device regarding the characteristic unit descriptor, and execute a volume adjustment strategy according to the enumeration response result, wherein the volume adjustment strategy includes a first adjustment strategy and a second adjustment strategy, wherein the first adjustment strategy is used to communicate with the host device to adjust the volume according to the enumeration response and downlink audio information, and the second adjustment strategy is used to control the local gain of the slave device.

2. The volume adjustment method according to claim 1, characterized in that: The method further includes, after receiving the enumeration response, continuing to enumerate volume-related HID descriptors to the host device, and executing the first adjustment strategy according to the HID response and the downlink audio information.

3. The volume adjustment method according to claim 2, characterized in that: The first adjustment strategy includes a first adjustment sub-strategy and a second adjustment sub-strategy; The first adjustment sub-strategy is used to communicate with the host device to adjust the volume according to the enumeration response and the HID response; the second adjustment sub-strategy is used to send a volume adjustment instruction to the host device according to the downlink audio information.

4. The volume adjustment method according to any one of claims 1 to 3, characterized in that: The downlink audio information includes a downlink audio energy value. By comparing the downlink audio energy values ​​in different periods, it is detected whether the downlink audio energy values ​​in different time periods change.

5. The volume adjustment method according to claim 4, characterized in that: The downlink audio energy value includes an instantaneous energy value and / or a short-time energy value, and a period of the instantaneous energy value is different from a period of the short-time energy value.

6. The volume adjustment method according to claim 4, characterized in that: Adjacent cycles of the downstream audio energy partially overlap.

7. A volume adjustment device applied to the method according to any one of claims 1 to 6, characterized in that: The volume adjustment device is applied to a slave device in a USB system, the slave device establishes a USB connection with a host device, and the volume adjustment device comprises: A transceiver module, used for communication interaction between the slave device and the host device; A monitoring module, used for monitoring the enumeration response of the host device, the HID response and the downlink audio information; The control module is used to execute the volume adjustment strategy according to the monitoring result of the monitoring module.

8. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory. When the processor executes the one or more computer programs, the electronic device implements the volume adjustment method according to any one of claims 1 to 6.

9. A volume adjustment system, comprising a first electronic device and a second electronic device, wherein the first electronic device is the electronic device according to claim 8, and the first electronic device serves as a slave device in the system, and is used to execute the volume adjustment method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 6.