CN109819108B - Method and device for adjusting driving parameters, electronic equipment and storage medium - Google Patents

Method and device for adjusting driving parameters, electronic equipment and storage medium Download PDF

Info

Publication number
CN109819108B
CN109819108B CN201910009428.5A CN201910009428A CN109819108B CN 109819108 B CN109819108 B CN 109819108B CN 201910009428 A CN201910009428 A CN 201910009428A CN 109819108 B CN109819108 B CN 109819108B
Authority
CN
China
Prior art keywords
parameter
driving
external sound
sound card
usb external
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.)
Active
Application number
CN201910009428.5A
Other languages
Chinese (zh)
Other versions
CN109819108A (en
Inventor
裴琨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910009428.5A priority Critical patent/CN109819108B/en
Publication of CN109819108A publication Critical patent/CN109819108A/en
Application granted granted Critical
Publication of CN109819108B publication Critical patent/CN109819108B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Telephone Function (AREA)

Abstract

The application discloses a method and a device for adjusting driving parameters, electronic equipment and a storage medium. The method comprises the following steps: acquiring a rate parameter of a USB external sound card, wherein the rate parameter is related to the transmission rate of data; judging whether the speed parameter is matched with a parameter value of a driving parameter for driving the USB external sound card; if not, acquiring a parameter value of a driving parameter matched with the USB external sound card as a target parameter value; and adjusting the driving parameters to target parameters. Under the condition that the speed parameter of the USB external sound card is not matched with the parameter value of the driving parameter, the parameter value of the driving parameter is adjusted, so that the parameter value of the driving parameter is matched with the speed parameter of the USB external sound card, the phenomenon of sound blocking caused by the fact that the parameter value of the driving parameter is not matched is avoided, and the user experience is improved.

Description

Method and device for adjusting driving parameters, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of electronic devices, and more particularly, to a method and an apparatus for adjusting driving parameters, an electronic device, and a storage medium.
Background
Nowadays, portable mobile terminals such as mobile phones and the like have higher and higher popularity, functions attached to consumer electronics in the mobile terminals widely cover aspects of life, and multimedia functions are applications used by consumer electronics users most, and the effect of improving the multimedia functions in the consumer electronics is a problem that each manufacturer needs to consider.
The USB external sound card is an external power amplifier device which is very commonly used, the used scenes are more, but the USB external sound cards on the market are various, and when some USB external sound cards are connected to the electronic equipment, the phenomenon of sound blockage can occur, so that the user experience is influenced.
Disclosure of Invention
The present application provides a method, an apparatus, an electronic device and a storage medium for adjusting driving parameters to solve the above problems.
In a first aspect, an embodiment of the present application provides a method for adjusting a driving parameter, where the method includes: acquiring a rate parameter of a USB external sound card, wherein the rate parameter is related to the transmission rate of data; judging whether the rate parameter is matched with a parameter value of a driving parameter for driving the USB external sound card; if not, acquiring a parameter value matched with the rate parameter of the USB external sound card as a target parameter value; and adjusting the driving parameter to the target parameter value.
In a second aspect, an embodiment of the present application provides an apparatus for adjusting a driving parameter, where the apparatus includes: the acquisition module is used for acquiring the rate parameter of the USB external sound card, and the rate parameter is related to the transmission rate of data; the judging module is used for judging whether the speed parameters are matched with the parameter values of the driving parameters for driving the USB external sound card; the matching module is used for acquiring a parameter value matched with the rate parameter of the USB external sound card as a target parameter value if the rate parameter is not matched with the parameter value of the driving parameter; and the adjusting module is used for adjusting the driving parameters to the target parameter values.
In a third aspect, an embodiment of the present application provides an electronic device, which includes one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method as applied to an electronic device, as described above.
In a fourth aspect, the present application provides a computer-readable storage medium having a program code stored therein, wherein the program code performs the above method when running.
Compared with the prior art, the method, the device, the electronic equipment and the storage medium for adjusting the driving parameters, provided by the embodiment of the application, are used for acquiring the rate parameters of the USB external sound card, wherein the rate parameters are related to the transmission rate of data; judging whether the speed parameter is matched with a parameter value of a driving parameter for driving the USB external sound card; if not, acquiring a parameter value of a driving parameter matched with the USB external sound card as a target parameter value; and adjusting the driving parameters to target parameters. Under the condition that the speed parameter of the USB external sound card is not matched with the parameter value of the driving parameter, the parameter value of the driving parameter is adjusted, so that the parameter value of the driving parameter is matched with the speed parameter of the USB external sound card, the phenomenon of sound blocking caused by the fact that the parameter value of the driving parameter is not matched is avoided, and the user experience is improved.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows a flowchart of a method for adjusting a driving parameter according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating a method for adjusting a driving parameter according to another embodiment of the present application.
Fig. 3 is a flowchart illustrating a method for adjusting a driving parameter according to another embodiment of the present application.
Fig. 4 is a functional block diagram of an apparatus for adjusting driving parameters according to an embodiment of the present application.
Fig. 5 shows a block diagram of an electronic device for executing the method for adjusting driving parameters according to the embodiment of the present application.
Fig. 6 illustrates a storage medium provided in an embodiment of the present application and used for storing or carrying program code for implementing a method for adjusting a driving parameter according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
Most of The existing mobile terminals have an On-The-Go (OTG) function, and The mobile terminals can perform data transmission with a USB (Universal Serial Bus) external sound card through The OTG function. The USB external sound card is a very common external power amplifier device, and is a hardware capable of implementing analog-to-digital conversion of data related to sound. The USB external sound card can be connected with the electronic equipment through a USB bus, can provide better audio recording and playback quality than an integrated sound card for the electronic equipment, and can also expand a multichannel audio output and input Interface, a MIDI (musical Instrument Digital Interface), an XLR (cross linked radio Interface), an optical fiber Interface and the like for the electronic equipment.
The external sound card of USB uses the scene also is more, but the external sound card of USB on the market is of a great variety, and when electronic equipment need insert the external sound card of USB, can not confirm which kind of the external sound card of USB can insert. When some sound cards are connected to the electronic equipment, the problem of pause of sound playing can occur.
The inventor finds that each USB external sound card has respective parameter configuration and different supported data transmission rates, and therefore when the mobile terminal is connected with the USB external sound card, the drive parameters of the electronic device may not match with the device parameters of the USB external sound card, and the USB external sound card plays music, and the like. For example, the data transmission rate corresponding to the driving parameter is greater than a parameter related to the data transmission rate in the device parameters of the USB external sound card, and the electronic device transmits the audio data at a greater transmission rate than the USB external sound card, but the processing speed of the USB external sound card on the audio data cannot keep up with the transmission speed of the electronic device, so that the audio data processed by the USB external sound card is blocked during playing. For example, after the USB driver of the electronic device encodes PCM (Pulse Code Modulation) data into a data packet with a certain format, the data packet is not matched in the middle of the data packet when being transmitted to the external sound card, which causes the data obtained by the external sound card to be too fast or too slow, and further causes the problem of pause or noise in playing.
If the ADSP (Digital signal processing chip (DSP) scheme produced by American Analog Device Instrument (ADI)) scheme which has strong platform dependence is adopted, the USB audio scheme native to *** used by many platforms does not support the ADSP scheme, the application range is limited, and the compatibility of the electronic equipment to the USB external sound card is limited. Therefore, the inventor proposes a method for adjusting driving parameters in the application, and obtains a rate parameter of the USB external sound card, where the rate parameter is related to a data transmission rate; judging whether the speed parameter is matched with a parameter value of a driving parameter for driving the USB external sound card; if not, acquiring a parameter value of a driving parameter matched with the USB external sound card as a target parameter value; the driving parameters are adjusted to be the target parameters, and the parameter values of the driving parameters are adjusted under the condition that the speed parameters of the USB external sound card are not matched with the parameter values of the driving parameters, so that the parameter values of the driving parameters are matched with the speed parameters of the USB external sound card, the phenomenon of sound blocking caused by the fact that the parameter values of the driving parameters are not matched is avoided, and the user experience is improved.
The following will describe embodiments of the present application in detail.
Referring to fig. 1, an embodiment of the present application provides a method for adjusting driving parameters, and an execution main body of a processing flow described in this embodiment may be an electronic device. The method comprises the following steps:
step S110, obtaining a rate parameter of the USB external sound card, wherein the rate parameter is related to the transmission rate of data.
When the electronic equipment detects the access of the USB external sound card, the electronic equipment can acquire the speed parameter of the accessed USB external sound card so as to determine the appropriate data transmission speed between the electronic equipment and the USB external sound card.
For example, the identity of the USB external sound card may be obtained during enumeration, and the rate parameter of the USB external sound card may be searched according to the identity.
For another example, a device descriptor, an endpoint descriptor, and parameters related to the transmission rate of data of the USB external sound card may be obtained during the enumeration process. The rate parameter of the USB external sound card refers to a parameter related to a transmission rate of data, and the specific parameters are not limited in this embodiment.
For example, when the electronic device performs data transmission with the USB external sound card, audio data is sent to the USB external sound card at preset time intervals, and the audio data is sent to the USB external sound card in the form of data packets. Therefore, the larger the data packet sent by the electronic device to the USB external sound card is, the larger the data transmission rate between the electronic device and the USB external sound card is. Thus, the rate parameter in the embodiments of the present application may be the maximum packet length (wmaxpcacketsize) in the endpoint descriptor.
Of course, the rate parameter may also be other parameters related to the transmission rate of data, such as an access interval (bInterval) for specifying the endpoint data transmission. It is understood that the smaller the access interval, the more data transmission times, and the higher the corresponding data transmission rate.
Specifically, when the USB external sound card is connected to the electronic device, the electronic device does not know what device is connected to the electronic device, so the electronic device can send a request to the connected USB external sound card, and the USB external sound card can feed back the relevant configuration parameters of the electronic device when receiving the request sent by the electronic device. And the electronic equipment acquires the relevant configuration parameters of the accessed USB external sound card, and then can determine the parameter values of the driving parameters for driving the USB external sound card.
And step S120, judging whether the speed parameter is matched with a parameter value of a driving parameter for driving the USB external sound card.
When the rate parameter of the USB external sound card is obtained, the electronic device may select a suitable driving parameter to drive the USB external sound card.
The electronic device may automatically select a default driving parameter for driving the USB external sound card in the electronic device when the rate parameter of the USB external sound card is obtained, or may automatically select the default driving parameter according to the driving parameter obtained when the USB external device is accessed last time, but the selected driving parameter may not be matched with the driving parameter of the currently accessed USB external sound card. At this time, the electronic device may determine whether the rate parameter matches a parameter value of a driving parameter for driving the USB external sound card.
And judging whether the speed parameter is matched with the parameter value of the driving parameter for driving the USB external sound card or not in different modes. In an embodiment, it may be determined whether a parameter value of the driving parameter is consistent with the rate parameter, and if the parameter value of the driving parameter is not consistent with the rate parameter, it may be determined that the rate parameter is not matched with the parameter value of the driving parameter for driving the USB external sound card.
In another embodiment, the electronic device may determine whether a parameter value of the driving parameter is within a range in which the USB external sound card is driven to operate normally, where the normal operating range is a parameter range corresponding to a rate parameter at which the USB external sound card does not generate a stuck state. For different USB external sound cards, the parameter range of the speed parameter which can work normally can be set, so that whether the current driving parameter in the electronic equipment is in the parameter range of the normal work of the currently accessed USB external sound card can be judged. The parameter range of the speed parameter of the USB external sound card in normal operation may be smaller than the parameter value of the speed parameter of the USB external sound card, or may be a difference smaller than the parameter value of the speed parameter of the USB external sound card. In addition, the set parameter range of the speed parameter of the USB external sound card working normally can also be a range interval from one parameter value to another parameter value.
And if the parameter value of the driving parameter is not in the normal working range of the driving USB external sound card, judging that the speed parameter is not matched with the parameter value of the driving parameter for driving the USB external sound card.
And step S130, if the speed parameters are not matched, acquiring a parameter value matched with the speed parameter of the USB external sound card as a target parameter value.
If the rate parameter is judged not to be matched with the parameter value of the driving parameter for driving the USB external sound card, it is indicated that if the parameter value of the driving parameter is continuously used for driving the USB external sound card, driving failure may occur, or after the USB external sound card is successfully driven, the situation that normal playing is influenced by pause, noise and the like may occur in the process of playing sound when the USB external sound card is normally used.
Then, if it is determined that the rate parameter does not match the parameter of the driving parameter for driving the USB external sound card, a parameter value matching the driving parameter of the USB external sound card may be obtained as a target parameter value.
Step S140, adjusting the driving parameter to the target parameter value.
And if the target parameter value is a parameter value which can be matched with the driving parameter of the USB external sound card, adjusting the driving parameter to the target parameter value to drive the USB external sound card.
In the embodiment of the application, the electronic device can acquire the speed parameter of the USB external sound card through the USB driver in the electronic device. After the USB drive acquires the speed parameters of the USB external sound card, the speed parameters can be transmitted to a matching unit of the electronic equipment, and the matching unit acquires the driving parameters of the electronic equipment from the audio drive of the electronic equipment to perform matching judgment. After the driving parameters are obtained, the audio driver can send a data packet to the USB driver, and then the USB driver sends the data packet to the USB external sound card. And the data packet sent to the USB external sound card is encoded and sent by taking the adjusted driving parameters as a standard.
In addition, in the embodiment of the present application, if the rate parameter matches a parameter value of a driving parameter for driving the USB external sound card, the current driving parameter may be directly used for driving, and data interaction, such as data encoding and sending, or data receiving, may be performed with the USB external sound card using the driving parameter as a standard.
The method for adjusting the driving parameters obtains the speed parameters of the USB external sound card, wherein the speed parameters are related to the transmission speed of data; judging whether the speed parameter is matched with a parameter value of a driving parameter for driving the USB external sound card; if not, acquiring a parameter value of a driving parameter matched with the USB external sound card as a target parameter value; and adjusting the driving parameters to target parameters. Under the condition that the speed parameter of the USB external sound card is not matched with the parameter value of the driving parameter, the parameter value of the driving parameter is adjusted, so that the parameter value of the driving parameter is matched with the speed parameter of the USB external sound card, the phenomenon of sound blocking caused by the fact that the parameter value of the driving parameter is not matched is avoided, and the user experience is improved.
Referring to fig. 2, another embodiment of the present application provides a method for adjusting driving parameters, where the embodiment focuses on a process of obtaining a rate parameter of a USB external sound card on the basis of the foregoing embodiment, and the method may include:
step S210, receiving the identity sent by the USB external sound card.
When the USB external sound card is accessed into the electronic equipment through the interface, a USB enumeration process is carried out, namely, some information is read from the USB external sound card, so that the user can know what equipment is accessed into the electronic equipment and how to carry out communication, and a proper driving program is loaded according to the information, so that the USB external sound card is driven. The obtained information comprises the identity of the USB external sound card, and different identity characters represent the USB external sound cards with different parameter characteristics.
Specifically, in the enumeration process, the electronic device may send a request to the USB external sound card, and the USB external sound card may send its own information to the electronic device one by one after receiving the request. Therefore, the electronic equipment can acquire the identity sent by the USB external sound card, and the identity can be a product ID in the equipment descriptor.
And S220, searching the speed parameter of the USB external sound card according to the identity.
When the electronic equipment receives the identity mark sent by the USB external sound card, the speed parameter of the USB external sound card can be searched according to the identity mark.
In an embodiment, a first device information table is stored in the electronic device, where the first device information table includes identification identifiers of different USB external sound cards and a rate parameter of the USB external sound card corresponding to the identification identifiers, for example, the first device information table may be as shown in table 1.
TABLE 1
Identity label A B C
Rate parameter a b c
The identification marks in the first device information table are identification marks of different USB external sound cards, for example, the identification mark of one USB external sound card is "a", and the identification mark of the other USB external sound card is "B". The rate parameter is a rate parameter of a different USB external sound card, for example, a USB external sound card with an identity "a", and the corresponding rate parameter is "a"; and the corresponding speed parameter of the USB external sound card with the identity label of B is B. Then, the electronic device may query the device information table according to the received identity of the USB external sound card, so as to obtain the rate parameter of the USB external sound card corresponding to the identity. For example, if the identification "C" sent by the USB external sound card received by the electronic device is found, the device information table, i.e., table 1, is queried according to the identification "C", and the rate parameter of the USB external sound card corresponding to the identification "C" is found to be "C".
Step S230, determining whether the rate parameter matches a parameter value of a driving parameter for driving the USB external sound card.
After the rate parameter of the USB external sound card is obtained, the electronic device may load an appropriate driver according to the rate parameter of the USB external sound card. However, a parameter value of a driving parameter of a driver in the electronic device may not match the acquired rate parameter of the USB external sound card, and if the driving program with the unmatched parameter is selected to drive the USB external sound card, a situation that a sound card is stuck in normal use of the USB external sound card may occur due to a driving failure or a successful driving.
Step S240, if not, obtaining the parameter value matched with the speed parameter of the USB external sound card as the target parameter value,
step S250, adjusting the driving parameter to the target parameter value.
The steps S240 to S250 refer to corresponding parts of the foregoing embodiments, and are not described herein again.
According to the method for adjusting the driving parameters, the electronic equipment can acquire the speed parameters of the USB external sound card by receiving the identity sent by the accessed USB external sound card and inquiring the first equipment information table through the identity. Judging whether the rate parameter is matched with a parameter value of a driving parameter for driving the USB external sound card; if not, acquiring a parameter value of a driving parameter matched with the USB external sound card as a target parameter value; and adjusting the driving parameters to target parameters. The speed parameters of the accessed USB external sound card are acquired in different modes, so that the condition that the speed parameters of the USB external sound card cannot be acquired is avoided, and a foundation is provided for subsequent steps.
Referring to fig. 3, another embodiment of the present application provides a method for adjusting driving parameters, where the present embodiment focuses on a process of determining whether the rate parameter matches a parameter value of a driving parameter on the basis of the foregoing embodiment, and the method may include:
step S310, obtaining a rate parameter of the USB external sound card, wherein the rate parameter is related to the transmission rate of data.
Step S320, querying the rate parameter in a second device information table, and determining whether the rate parameter matches the parameter value of the driving parameter according to the query result.
In one embodiment, when accessing the USB external sound card, the electronic device first selects default driving parameters. In this embodiment, the electronic device pre-stores a second device information table, where the second device information table includes a parameter value of a default driving parameter and a rate parameter of a corresponding matched USB external sound card. When the speed parameter of the USB external sound card is obtained and it is determined whether the speed parameter matches a parameter value of a driving parameter for driving the USB external sound card, the speed parameter may be searched in the second information table, and the searched parameter value is specifically the parameter value of the speed parameter of the USB external sound card. If the current driving parameters are found, the USB external sound card can be driven by the current driving parameters of the electronic equipment, so that the USB external sound card can work normally, otherwise, the USB external sound card cannot work normally under the current driving parameters.
In another embodiment, the current driving parameters that the electronic device first selects are not determined, and may be, for example, random or selected based on a previous insertion of the USB external device. In this embodiment, the electronic device may pre-store a second device information table, where the second device information table includes different parameter values of the driving parameter and a rate parameter corresponding to the matched USB external sound card. When the rate parameter of the USB external sound card is obtained, a second device information table may be queried according to the rate parameter of the USB external sound card. Specifically, it may be determined whether a parameter value of the USB external sound card rate parameter is found in the rate parameter corresponding to the current driving parameter of the electronic device in the second device information table. The second device information table includes parameter values of the driving parameters and matched rate parameters. Specifically, the second device information table may refer to table 2.
TABLE 2
Rate parameter d e f g
Parameter value of driving parameter D E F G
The second device information table in table 2 indicates the parameter value of the driving parameter corresponding to the rate parameter, which is a parameter value of the driving parameter that can be supported by the electronic device. The electronic device may determine a parameter value of the currently selected driving parameter, and when the rate parameter of the USB external sound card is obtained, the electronic device may query the second information device table according to the rate parameter of the USB external sound card. If the speed parameter of the USB external sound card is found in the speed parameter corresponding to the current driving parameter in the second device information table, the electronic device may normally drive the USB external sound card, so that it may be determined that the speed parameter matches the driving parameter.
In another embodiment, the electronic device may include a second device information table prestored in advance, where the second device information table may include ranges of parameter values of driving parameters corresponding to different rate parameters of the USB external sound card, and the parameter ranges are parameter ranges within which the USB external sound card can be driven to normally operate. Namely, the parameter value of the driving parameter is within the preset range, the USB external sound card can be successfully driven to normally work. In this embodiment, specifically, the second device information table may refer to table 3.
TABLE 3
Rate parameter d e f g
Parameter value range of driving parameter H~K L~O P~S T~W
In this embodiment, the different rate parameters in table 3 represent rate parameters of the USB external sound card, and the parameter value range of the driving parameter is a range that the parameter value of the driving parameter of the electronic device can be selected under the corresponding rate parameter. Then, when the rate parameter of the USB external sound card is obtained, the second device information table may be queried according to the obtained rate parameter of the USB external sound card, specifically, whether a parameter value of the currently selected driving parameter of the electronic device is queried within a parameter range of the driving parameter corresponding to the rate parameter of the currently accessed USB external sound card. And when the parameter value of the driving parameter is in the parameter value range of the driving parameter corresponding to the rate parameter, determining that the rate parameter is matched with the driving parameter, and if the parameter value of the driving parameter is not in the parameter value range of the driving parameter corresponding to the rate parameter, determining that the rate parameter is not matched with the driving parameter.
For example, if the acquired rate parameter is e and the parameter value of the driving parameter is S, the parameter value range of the corresponding driving parameter is queried to be L to O according to the acquired rate parameter e, and if S is not between L and O, it can be determined that the rate parameter is not matched with the driving parameter.
And step S330, if the rate parameter is not matched with the parameter value of the driving parameter, acquiring the parameter value matched with the rate parameter of the USB external sound card as a target parameter value.
And if the rate parameter is judged not to be matched with the parameter value of the driving parameter, acquiring the parameter value matched with the rate parameter of the USB external sound card as a target parameter value. In an embodiment, the acquired rate parameter of the USB external sound card may be directly used as a target parameter value, for example, the acquired rate parameter of the USB external sound card is f, and when it is determined that the rate parameter does not match the parameter value of the driving parameter, f is used as the target parameter value.
In another embodiment, the parameter value within the range of the parameter value of the driving parameter corresponding to the speed parameter may be used as the target parameter value. For example, the obtained rate parameter of the USB external sound card is d, and when it is determined that the rate parameter does not match the parameter of the driving parameter, any value in the parameter value range H to K of the driving parameter corresponding to the rate parameter d is used as the target parameter value, or H or K is used as the target parameter value.
In one embodiment, a value within a preset range of the rate parameter may be used as the target parameter. For example, taking a parameter value smaller than the rate parameter of the currently accessed USB external sound card as a target parameter value; or taking the parameter value within the range smaller than the speed parameter of the USB external sound card by a preset value as the target parameter value.
Step S340, adjusting the driving parameter to the target parameter value.
Step S340 may refer to steps corresponding to the foregoing embodiments, and will not be described herein again.
The method for adjusting the driving parameters obtains the speed parameters of the USB external sound card, wherein the speed parameters are related to the transmission speed of data; judging whether the speed parameter is matched with a parameter value of a driving parameter for driving the USB external sound card; if not, acquiring a parameter value of a driving parameter matched with the USB external sound card as a target parameter value; and adjusting the driving parameters to target parameters. Under the condition that the speed parameter of the USB external sound card is not matched with the parameter value of the driving parameter, the parameter value of the driving parameter is adjusted, so that the parameter value of the driving parameter is matched with the speed parameter of the USB external sound card, and the phenomenon of sound blocking caused by the fact that the parameter value of the driving parameter is not matched is avoided.
It can be understood that the method for adjusting driving parameters provided by the present application is not only applicable to a USB external sound card, but also applicable to various USB external devices.
Referring to fig. 4, a device 500 for adjusting driving parameters according to an embodiment of the present disclosure is shown, where the device 400 includes an obtaining module 410, a determining module 420, a matching module 430, and an adjusting module 440.
An obtaining module 410, configured to obtain a rate parameter of the USB external sound card, where the rate parameter is related to a transmission rate of data; a judging module 420, configured to judge whether the rate parameter matches a parameter value of a driving parameter for driving the USB external sound card; the matching module 430 is configured to, if the rate parameter does not match the parameter value of the driving parameter, obtain a parameter value matching the rate parameter of the USB external sound card as a target parameter value; an adjusting module 440, configured to adjust the driving parameter to the target parameter value.
Further, a first device information table is prestored, and the first device information table includes the identification of different USB external sound cards and the speed parameter of the USB external sound card corresponding to the identification. The obtaining module 410 is further configured to receive an identity identifier sent by the USB external sound card, and search a rate parameter of the USB external sound card according to the identity identifier.
Further, a second device information table is prestored, where the second device information table includes a rate parameter matched with the parameter value of the driving parameter, and the determining module 420 is further configured to query the rate parameter in the second device information table; if the speed parameter is not inquired, judging that the speed parameter is not matched with the parameter value of the driving parameter; and if the speed parameter is inquired, judging that the speed parameter is matched with the parameter value of the driving parameter.
Further, the determining module 420 is further configured to determine whether the parameter value is within a preset range of the rate parameter; if yes, judging that the speed parameter is matched with the parameter value of the driving parameter; and if not, judging that the speed parameter is not matched with the parameter value of the driving parameter.
Further, the matching module 430 is further configured to obtain a parameter value within a preset range of the rate parameter as the target parameter value.
Further, the matching module 430 is further configured to use the rate parameter as the target parameter value.
Further, the rate parameter includes a maximum packet length in the endpoint descriptor.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In summary, the method for adjusting driving parameters provided by the present application obtains a rate parameter of the USB external sound card, where the rate parameter is related to a data transmission rate; judging whether the speed parameter is matched with a parameter value of a driving parameter for driving the USB external sound card; if not, acquiring a parameter value of a driving parameter matched with the USB external sound card as a target parameter value; and adjusting the driving parameters to target parameters. Under the condition that the speed parameter of the USB external sound card is not matched with the parameter value of the driving parameter, the parameter value of the driving parameter is adjusted, so that the parameter value of the driving parameter is matched with the speed parameter of the USB external sound card, and the phenomenon of sound blocking caused by the fact that the parameter value of the driving parameter is not matched is avoided.
In the several embodiments provided in the present application, the coupling or direct coupling or communication connection between the modules shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or modules may be in an electrical, mechanical or other form.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Referring to fig. 5, a block diagram of an electronic device according to an embodiment of the present application is shown. The electronic device 500 may be a smart phone, a tablet computer, an electronic book, a laptop computer, a handheld computer, etc. capable of running an application. The electronic device 500 in the present application may include one or more of the following components: a processor 510, a memory 520, and one or more applications, wherein the one or more applications may be stored in the memory 520 and configured to be executed by the one or more processors 510, the one or more programs configured to perform a method as described in the aforementioned method embodiments.
Processor 510 may include one or more processing cores. The processor 510 interfaces with various components throughout the electronic device 500 using various interfaces and circuitry to perform various functions of the electronic device 500 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 520 and invoking data stored in the memory 520. Alternatively, the processor 510 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 510 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 510, but may be implemented by a communication chip.
The Memory 520 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 520 may be used to store instructions, programs, code sets, or instruction sets. The memory 520 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The data storage area may also store data created during use by the electronic device 500 (e.g., phone books, audio-visual data, chat log data), and so forth.
In this embodiment, the electronic device further includes a USB interface, which is connected to a USB external device, such as a USB external sound card.
Referring to fig. 6, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable storage medium 600 has stored therein program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 600 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 600 includes a non-transitory computer-readable storage medium. The computer readable storage medium 600 has storage space for program code 610 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 610 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (8)

1. A method of driving parameter adjustment, the method comprising:
acquiring a rate parameter of a USB external sound card, wherein the rate parameter is related to the transmission rate of data;
judging whether the speed parameter is matched with a parameter value of a driving parameter for driving the USB external sound card, wherein the judging step comprises the following steps:
judging whether the parameter value of the driving parameter is within the preset range of the speed parameter or not;
if yes, judging that the speed parameter is matched with the parameter value of the driving parameter;
if not, judging that the speed parameter is not matched with the parameter value of the driving parameter;
or,
a second equipment information table is prestored, and the second equipment information table comprises a rate parameter matched with the parameter value of the driving parameter;
the judging whether the rate parameter is matched with a parameter value of a driving parameter for driving the USB external sound card comprises the following steps:
querying the rate parameter in the second device information table;
if the speed parameter is not inquired, judging that the speed parameter is not matched with the parameter value of the driving parameter;
if the speed parameter is inquired, judging that the speed parameter is matched with the parameter value of the driving parameter;
if not, acquiring a parameter value matched with the rate parameter of the USB external sound card as a target parameter value;
and adjusting the driving parameter to the target parameter value.
2. The method as claimed in claim 1, wherein a first device information table is prestored, the first device information table includes identifiers of different USB external sound cards and speed parameters of the USB external sound cards corresponding to the identifiers, and the obtaining the speed parameters of the USB external sound cards includes:
receiving an identity mark sent by a USB external sound card;
and searching the speed parameter of the USB external sound card according to the identity.
3. The method as claimed in claim 1, wherein said obtaining a parameter value matching a rate parameter of said USB external sound card as a target parameter value comprises:
and acquiring a parameter value in a preset range of the speed parameter as the target parameter value.
4. The method as claimed in claim 1, wherein said obtaining a parameter value matching a rate parameter of said USB external sound card as a target parameter value comprises:
taking the rate parameter as the target parameter value.
5. The method of claim 1, wherein the rate parameter comprises a maximum packet length in an endpoint descriptor.
6. A drive parameter adjustment apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring the rate parameter of the USB external sound card, and the rate parameter is related to the transmission rate of data;
the judging module is used for judging whether the speed parameter is matched with a parameter value of a driving parameter for driving the USB external sound card, and comprises: the device is used for judging whether the parameter value of the driving parameter is within the preset range of the rate parameter or not, and if so, judging that the rate parameter is matched with the parameter value of the driving parameter; if not, judging that the speed parameter is not matched with the parameter value of the driving parameter;
or,
the device is prestored with a second equipment information table, and the second equipment information table comprises a rate parameter matched with the parameter value of the driving parameter; the judging module is used for: querying the rate parameter in the second device information table; if the speed parameter is not inquired, judging that the speed parameter is not matched with the parameter value of the driving parameter; if the speed parameter is inquired, judging that the speed parameter is matched with the parameter value of the driving parameter;
the matching module is used for acquiring a parameter value matched with the rate parameter of the USB external sound card as a target parameter value if the rate parameter is not matched with the parameter value of the driving parameter;
and the adjusting module is used for adjusting the driving parameters to the target parameter values.
7. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of any of claims 1-5.
8. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 5.
CN201910009428.5A 2019-01-04 2019-01-04 Method and device for adjusting driving parameters, electronic equipment and storage medium Active CN109819108B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910009428.5A CN109819108B (en) 2019-01-04 2019-01-04 Method and device for adjusting driving parameters, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910009428.5A CN109819108B (en) 2019-01-04 2019-01-04 Method and device for adjusting driving parameters, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109819108A CN109819108A (en) 2019-05-28
CN109819108B true CN109819108B (en) 2021-03-02

Family

ID=66603995

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910009428.5A Active CN109819108B (en) 2019-01-04 2019-01-04 Method and device for adjusting driving parameters, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109819108B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110798458B (en) * 2019-10-22 2022-05-06 潍坊歌尔微电子有限公司 Data synchronization method, device, equipment and computer readable storage medium
CN114020343B (en) * 2021-12-27 2022-04-22 苏州浪潮智能科技有限公司 Driving capability adjusting method, device and equipment and readable storage medium
CN115033201A (en) * 2022-05-23 2022-09-09 北京字节跳动网络技术有限公司 Audio recording method, device, system, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763238A (en) * 2008-12-25 2010-06-30 北京联想软件有限公司 Method for improving audio playing quality, audio data acquisition method and audio data acquisition system
US7961014B2 (en) * 2009-10-26 2011-06-14 Analog Devices, Inc. Apparatus and method for providing multi-mode clock signals
CN102265237A (en) * 2008-08-21 2011-11-30 克罗诺洛吉克有限公司 Synchronisation and timing method and apparatus
CN103513954A (en) * 2012-08-08 2014-01-15 Tcl集团股份有限公司 Method and system for realizing support of USB wireless audio equipment
US9189434B2 (en) * 2013-05-29 2015-11-17 Samsung Electronics Co., Ltd. Universal serial bus device and method for controlling an idle-delay time thereof
CN106648531A (en) * 2016-12-21 2017-05-10 惠州Tcl移动通信有限公司 Method and system for automatically matching different audio parameters based on mobile terminal
CN106998515A (en) * 2016-01-25 2017-08-01 徐文波 External sound card control method and device

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7631119B2 (en) * 2004-06-25 2009-12-08 Apple Inc. Techniques for providing audio for synchronized playback by multiple devices
JP4920522B2 (en) * 2007-08-06 2012-04-18 株式会社東芝 Information processing apparatus and output interlocking control method
TWI423119B (en) * 2008-10-15 2014-01-11 C Media Electronics Inc Externally-connected audio apparatus and method for processing audio signal thereof
CN103702253B (en) * 2013-12-16 2017-09-29 联想(北京)有限公司 A kind of information processing method and electronic equipment
US10684906B2 (en) * 2016-06-15 2020-06-16 Microsoft Technology Licensing, Llc Monitoring peripheral transactions
US10628172B2 (en) * 2016-06-27 2020-04-21 Qualcomm Incorporated Systems and methods for using distributed universal serial bus (USB) host drivers
CN106775560A (en) * 2016-11-30 2017-05-31 四川长虹电子部品有限公司 Usb audio output device and its processing method
CN107484081A (en) * 2017-07-27 2017-12-15 努比亚技术有限公司 A kind of method of adjustment of audio signal, device, terminal and computer-readable recording medium
CN108738000A (en) * 2018-03-30 2018-11-02 晨星半导体股份有限公司 Based on Android(Android)The bluetooth adaptation method and terminal device of system
CN109101213B (en) * 2018-08-23 2021-07-06 广州酷狗计算机科技有限公司 Method, device and storage medium for controlling sound card to transmit audio

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102265237A (en) * 2008-08-21 2011-11-30 克罗诺洛吉克有限公司 Synchronisation and timing method and apparatus
CN101763238A (en) * 2008-12-25 2010-06-30 北京联想软件有限公司 Method for improving audio playing quality, audio data acquisition method and audio data acquisition system
US7961014B2 (en) * 2009-10-26 2011-06-14 Analog Devices, Inc. Apparatus and method for providing multi-mode clock signals
CN103513954A (en) * 2012-08-08 2014-01-15 Tcl集团股份有限公司 Method and system for realizing support of USB wireless audio equipment
US9189434B2 (en) * 2013-05-29 2015-11-17 Samsung Electronics Co., Ltd. Universal serial bus device and method for controlling an idle-delay time thereof
CN106998515A (en) * 2016-01-25 2017-08-01 徐文波 External sound card control method and device
CN106648531A (en) * 2016-12-21 2017-05-10 惠州Tcl移动通信有限公司 Method and system for automatically matching different audio parameters based on mobile terminal

Also Published As

Publication number Publication date
CN109819108A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN109819108B (en) Method and device for adjusting driving parameters, electronic equipment and storage medium
US10482903B2 (en) Method, device and apparatus for selectively interacting with multi-devices, and computer-readable medium
CN109273017B (en) Encoding control method and device and electronic equipment
US20150088518A1 (en) Apparatus and method for multiple device voice control
CN110784858B (en) Bluetooth device control method and device, electronic device and storage medium
CN108540842B (en) Audio playing device, audio playing method, audio playing device and storage medium
EP1901175B1 (en) Audio system, and USB/UART common communication system for the same
US11210056B2 (en) Electronic device and method of controlling thereof
CN109725543B (en) Equipment control code configuration method and device, cloud server and network system
WO2016072160A1 (en) Audio reproduction apparatus and audio reproduction system
US20140188483A1 (en) Audio device and storage medium
CN105955695B (en) A kind of method and intelligent terminal that intelligent terminal volume is set
CN106604204B (en) Method and system for remotely controlling terminal application through Bluetooth
CN202289477U (en) Voice toy terminal equipment playing voices through wireless network
CN111913666B (en) Method and device compatible with Nand particles with different protocols, computer equipment and storage medium
CN110726924A (en) Chip operation method and device
CN104866186A (en) Character playing method and electronic equipment
CN109600622B (en) Audio and video information processing method and device and electronic equipment
CN107767857B (en) Information playing method, first electronic equipment and computer storage medium
US20220317967A1 (en) Audio control circuit, host device and associated control method
CN111145741A (en) Method and device for providing multimedia content, electronic equipment and storage medium
CN111045632B (en) Audio playing device and operation method thereof
CN105611339A (en) Advertisement insertion method and device and electronic equipment
CN113973226B (en) Screen recording method, device, equipment and storage medium
KR101503057B1 (en) Computer, Mobile device and Method for playing media files

Legal Events

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