CN111679805A - Audio hardware parameter setting method and related equipment - Google Patents

Audio hardware parameter setting method and related equipment Download PDF

Info

Publication number
CN111679805A
CN111679805A CN202010394974.8A CN202010394974A CN111679805A CN 111679805 A CN111679805 A CN 111679805A CN 202010394974 A CN202010394974 A CN 202010394974A CN 111679805 A CN111679805 A CN 111679805A
Authority
CN
China
Prior art keywords
audio
hardware parameter
audio hardware
parameter
configurable
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.)
Granted
Application number
CN202010394974.8A
Other languages
Chinese (zh)
Other versions
CN111679805B (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.)
Shenzhen Neoway Technology Co Ltd
Original Assignee
Shenzhen Neoway Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Neoway Technology Co Ltd filed Critical Shenzhen Neoway Technology Co Ltd
Priority to CN202010394974.8A priority Critical patent/CN111679805B/en
Priority claimed from CN202010394974.8A external-priority patent/CN111679805B/en
Publication of CN111679805A publication Critical patent/CN111679805A/en
Application granted granted Critical
Publication of CN111679805B publication Critical patent/CN111679805B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/162Interface to dedicated audio devices, e.g. audio drivers, interface to CODECs

Abstract

The embodiment of the invention discloses an audio hardware parameter setting method and related equipment, wherein audio hardware parameters set by a user aiming at target audio equipment are obtained, and the audio hardware parameters are setting parameters of an audio bus; calling a first callback function, and updating the variable quantity value in the configurable structure body according to the set audio hardware parameter, wherein the configurable structure body is used for storing the audio hardware parameter of the audio equipment; the first callback function is used for realizing parameter setting of the configurable structure body through the name of the audio hardware parameter; responding to an audio operation instruction of the target audio equipment, refreshing the current audio hardware parameter of the target audio equipment according to the updated configurable structural body, and executing the operation corresponding to the audio operation instruction; therefore, the method of the embodiment of the invention can dynamically modify the audio hardware coefficient of the target audio equipment, is simple and convenient to modify and operate, and effectively improves the user experience.

Description

Audio hardware parameter setting method and related equipment
Technical Field
The invention relates to the technical field of audio, in particular to an audio hardware parameter setting method and related equipment.
Background
Terminals, especially wireless terminals, are increasingly demanding audio devices. Audio data transmission relies primarily on an audio bus, such as a PCM bus or an I2S bus, and different audio devices have various differences in their hardware parameter requirements for the audio bus. In the prior art, one version of audio driver software can only be suitable for audio equipment with one hardware parameter requirement, and cannot be compatible with hardware configuration requirements of different audio equipment. Therefore, when the terminal is connected with different audio devices each time (each audio device has different requirements on hardware parameters of an audio bus), the relevant configuration of the audio driver software needs to be modified for each audio device, and for an ordinary user, not only the modification difficulty is huge, but also the workload is undoubtedly increased, and the use experience of the user is seriously affected.
Disclosure of Invention
The embodiment of the invention provides an audio hardware parameter setting method and related equipment, which can dynamically modify the audio hardware coefficient of target audio equipment and is simple and convenient to modify and operate.
In a first aspect, an embodiment of the present invention provides an audio hardware parameter setting method, including:
acquiring audio hardware parameters set by a user aiming at target audio equipment, wherein the audio hardware parameters are set parameters of an audio bus;
calling a first callback function, and updating a variable value in a configurable structure body according to the set audio hardware parameter, wherein the configurable structure body is used for storing the audio hardware parameter of the audio equipment, and the first callback function is used for realizing parameter setting of the configurable structure body through the name of the audio hardware parameter;
responding to the audio operation instruction of the target audio equipment, refreshing the current audio hardware parameter of the target audio equipment according to the updated configurable structure body, and executing the operation corresponding to the audio operation instruction.
Optionally, the responding to the audio operation instruction of the target audio device, refreshing the current audio hardware parameter of the target audio device according to the updated configurable structure, and executing an operation corresponding to the audio operation instruction includes:
responding to the audio operation instruction, and calling a second callback function to acquire the current audio hardware parameter of the target audio equipment, wherein the second callback function is used for reading the audio hardware parameter through the name of the audio hardware parameter;
when the updated audio hardware parameter of the configurable structure is different from the current audio hardware parameter, calling a parameter refreshing function to refresh the audio hardware parameter of the target audio equipment, and executing the operation corresponding to the audio operation instruction;
and when the updated audio hardware parameter of the configurable structure body is the same as the current audio hardware parameter, outputting parameter setting success information and executing the operation corresponding to the audio operation instruction.
Optionally, the method further comprises:
and saving the updated audio hardware parameters in the configurable structural body as power-down backup data.
Optionally, after the set audio hardware parameter is obtained, the method further includes:
acquiring the power-down backup data;
outputting parameter setting success information when the audio hardware parameter at the latest power failure moment in the power failure backup data is the same as the set audio hardware parameter;
and when the audio hardware parameter at the latest power failure moment is different from the set audio hardware parameter, executing and calling the first callback function, and updating the variable quantity value in the configurable structural body according to the set audio hardware parameter.
Optionally, the audio hardware parameters include a clock of the audio bus, a frame synchronization timing mode, and an operation mode.
In a second aspect, an embodiment of the present invention provides an audio hardware parameter setting apparatus, including:
the first acquisition module is used for acquiring audio hardware parameters set by a user aiming at target audio equipment, wherein the audio hardware parameters are setting parameters of an audio bus;
the updating module is used for calling the first callback function and updating the variable value in the configurable structure body according to the set audio hardware parameter, wherein the configurable structure body is used for storing the audio hardware parameter of the audio equipment; the first callback function is used for realizing parameter setting of the configurable structure body through the name of the audio hardware parameter;
and the refreshing module is used for responding to the audio operation instruction of the target audio equipment, refreshing the current audio hardware parameter of the target audio equipment according to the updated configurable structural body, and executing the operation corresponding to the audio operation instruction.
Optionally, the apparatus further comprises:
the storage module is used for storing the updated audio hardware parameters in the configurable structural body as power-down backup data;
the second acquisition module is used for acquiring the power-down backup data;
the first execution module is used for outputting parameter setting success information when the audio hardware parameter at the latest power failure moment in the power failure backup data is the same as the set audio hardware parameter;
and the second execution module is used for executing and calling the first callback function when the audio hardware parameter at the latest power failure moment is different from the set audio hardware parameter, and updating the variable quantity value in the configurable structural body according to the set audio hardware parameter.
Optionally, the refresh module includes:
the first submodule is used for responding to the audio operation instruction and calling a second callback function to acquire the current audio hardware parameter of the target audio equipment, and the second callback function is used for reading the audio hardware parameter through the name of the audio hardware parameter;
the second submodule is used for calling a parameter refreshing function to refresh the audio hardware parameter of the target audio equipment when the updated audio hardware parameter of the configurable structure body is different from the current audio hardware parameter, and executing the operation corresponding to the audio operation instruction;
and the third submodule is used for outputting parameter setting success information when the updated audio hardware parameter of the configurable structure body is the same as the current audio hardware parameter, and executing the operation corresponding to the audio operation instruction.
In a third aspect, an embodiment of the present invention provides an audio hardware parameter setting device, including: a processor and a memory;
the processor is connected with the memory, wherein the memory is used for storing program codes, and the processor is used for calling the program codes to execute the audio hardware parameter setting method of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer storage medium storing a computer program, where the computer program includes program instructions, and the program instructions, when executed by a processor, execute the audio hardware parameter setting method according to the first aspect.
In the embodiment of the invention, the audio hardware parameters set by a user aiming at the target audio equipment are obtained, and the audio hardware parameters are the setting parameters of an audio bus; calling a first callback function, and updating the variable quantity value in the configurable structure body according to the set audio hardware parameter, wherein the configurable structure body is used for storing the audio hardware parameter of the audio equipment; the first callback function is used for realizing parameter setting of the configurable structure body through the name of the audio hardware parameter; responding to an audio operation instruction of the target audio equipment, refreshing the current audio hardware parameter of the target audio equipment according to the updated configurable structural body, and executing the operation corresponding to the audio operation instruction; therefore, the method of the embodiment of the invention can dynamically modify the audio hardware coefficient of the target audio equipment, is simple and convenient to modify and operate, and effectively improves the user experience.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, 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 some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic view of a scene of an audio hardware parameter setting method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an audio hardware parameter setting method according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an audio hardware parameter setting apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an audio hardware parameter setting device according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
It should be understood that the terms "first," "second," and the like in the description and claims of this application and in the drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by the person skilled in the art that the described embodiments of the invention can be combined with other embodiments.
Herein, the audio device refers to an audio output device including a speaker (or a loudspeaker), a sound box, etc., or an audio input device including a microphone (or a microphone).
The terminal comprises terminal equipment such as a desktop computer, a notebook computer, a palm computer and a tablet computer. The terminal and the audio device can be in wired communication or wireless communication, the wired communication mode comprises USB communication or serial communication and the like, and the wireless communication mode comprises Bluetooth communication, WiFi communication and the like. In the embodiment of the invention, the terminal is used for executing the audio hardware parameter setting method, namely executing the audio hardware parameter modification method in the audio driving software.
In the prior art, since one version of audio driver software can only be applied to an audio device with one audio hardware parameter requirement, when the audio device connected with a terminal is replaced, the relevant configuration of the audio driver software needs to be modified correspondingly, so that the modification difficulty is high, the operation is inconvenient, and poor use experience is brought to a user. The application provides an audio hardware parameter modification method, which can dynamically modify the audio hardware coefficient of target audio equipment and is simple and convenient to modify.
Referring to fig. 1, fig. 1 is a schematic view of a scene of a method for setting audio hardware parameters according to an embodiment of the present invention; in fig. 1, the audio device is a speaker as an example, the terminal 102 is a computer, and assuming that the audio device connected to the computer at the last time is the speaker 1, and the audio hardware parameter set by the user 101 for the speaker 1 is a, the audio hardware parameter stored in the configurable structure at this time is a. When the audio device is replaced by the loudspeaker 2, the audio hardware parameter set by the user 101 for the loudspeaker 2 is B, and at this time, the computer updates the variable value of the configurable structure from a to B by calling the first callback function. When a user needs to use the speaker 2 to perform audio playing, that is, the computer receives an audio operation instruction (assumed to be an audio playing instruction) for the speaker 2, the computer refreshes the current audio hardware parameter (the audio hardware parameter before refreshing is still a) of the speaker 2 according to the updated configurable structural body (at this time, the audio hardware parameter in the configurable structural body is B), so that the speaker 2 executes an operation corresponding to the audio operation instruction according to the audio hardware parameter (B), that is, an audio playing operation.
From the above, by using the audio hardware parameter setting method of the embodiment of the invention, the audio hardware parameters of the audio equipment can be dynamically set, and the user only needs to input the audio hardware parameters of the audio equipment to be set, does not need to modify codes every time, is simple and convenient to operate, can realize the adaptation of the audio hardware parameters to the audio equipment, and effectively improves the user experience.
Fig. 2 is a schematic flow chart of a method for setting audio hardware parameters according to an embodiment of the present invention; the audio hardware parameter setting method comprises the following steps:
201. acquiring audio hardware parameters set by a user aiming at target audio equipment, wherein the audio hardware parameters are set parameters of an audio bus;
specifically, the audio hardware parameters include a clock of the audio bus, a frame synchronization timing mode, an operation mode, and the like. The audio bus includes I2S bus and PCM bus, I2S is commonly referred to as Inter-IC Sound, Integrated Interchip Sound, or IIS for short. On the I2S bus, only one master and a sending device can exist at the same time. The master device may be a transmitting device, a receiving device, or other control device that coordinates the transmitting device and the receiving device. In the I2S system, the devices that provide the clocks (SCK and WS) are the master devices. I2S is divided into three different modes of operation, standard I2S mode, left alignment mode and right alignment mode.
Pcm (pulse Code modulation) is a method of digitizing an analog signal by sampling at equal time intervals (i.e., sampling rate clock cycles). PCM digital audio interfaces, i.e. interfaces where audio data transmitted over the interface is sampled by means of PCM. The frame synchronization timing patterns include a long frame synchronization pattern and a short frame synchronization pattern. The operation modes of the PCM BUS comprise three modes of ST-BUS, GCI and McBSP.
202. Calling a first callback function, updating the variable value in the configurable structure according to the set audio hardware parameter, wherein the configurable structure is used for storing the audio hardware parameter of the audio equipment, and the first callback function is used for realizing the parameter setting of the configurable structure through the name of the audio hardware parameter;
specifically, the first callback function is utilized to modify the specific numerical value of the corresponding audio hardware parameter in the configurable structure according to the name of the audio hardware parameter.
203. And responding to the audio operation instruction of the target audio equipment, refreshing the current audio hardware parameter of the target audio equipment according to the updated configurable structural body, and executing the operation corresponding to the audio operation instruction.
Specifically, in order to avoid POP sound (POP sound is a POP sound generated by transient impact caused by various operations at the moment of power-on and power-off of an audio device and after power-on is stable), after receiving an audio operation instruction of a user for a target audio device, the audio hardware parameter of the target audio device is refreshed, and an operation corresponding to the audio operation instruction is executed. The audio operation instruction includes an audio playing instruction and an audio obtaining instruction (e.g., recording, etc.).
Therefore, the method of the embodiment of the invention can dynamically modify the audio hardware coefficient of the target audio equipment, is simple and convenient to modify and operate, and effectively improves the user experience. In addition, the workload of audio driver software debugging can be reduced to a great extent, and the compatibility and the portability of the audio driver software version are improved.
In the embodiment of the invention, a structural body for storing audio hardware parameters is designed, namely a configurable structural body is designed for storing all possible audio hardware parameters of audio equipment. Wherein, different parameter variables in the configurable structure body represent different hardware parameters of the audio bus respectively, the audio hardware parameters take a clock, a frame synchronization timing mode and an operation mode as examples, and the configurable structure body at this time may be:
Figure BDA0002486195660000071
in one possible embodiment, before performing step 201, the method further comprises:
s1, obtaining configuration parameters of the audio equipment in the equipment tree;
specifically, configuration parameters about the audio device in a device tree of the terminal are obtained. The configuration parameters in the device tree may be configuration parameters of any audio device, and are not particularly limited.
And S2, initializing and filling each member variable in the configurable structural body according to the configuration parameters of the audio equipment in the equipment tree.
Specifically, in the drive loading stage, the values of the member variables in the corresponding structure body are filled by reading the configuration items in the equipment tree, so that the normal use of the default configuration of the equipment tree is ensured, and the normal initialization state is ensured.
Further, when initializing the audio driver software, a first callback function (put function) and a second callback function (get function) of each audio hardware parameter in the configurable structure need to be registered, so that the upper layer reads the current audio hardware parameter of the audio device by using the name of the audio hardware parameter, or sets a variable value in the configurable structure by using the name of the audio hardware parameter. For example, an snd _ dai _ new structure is defined, which is used to register a callback function of each audio hardware parameter, and a get function and a put function for the user layer are implemented in each callback function, such as:
Figure BDA0002486195660000072
registering a callback function of each audio hardware parameter, wherein the callback function is used for reading or setting the audio hardware parameter by the upper layer through the name:
static const struct snd_dai_new dai_params_config[]{
{.name=“AUX_PCM Clock”,.get=dai_params_clock_get,.put=
dai_params_clocks_put},
}。
in addition, in the audio driver software, different kcontrol controls are registered according to the arrangement of the snd _ dai _ new structure, and the generated controls are registered for the use of the user layer setting parameters.
In one possible embodiment, step 203 comprises:
2031. responding to the audio operation instruction, and calling a second callback function to acquire the current audio hardware parameter of the target audio equipment, wherein the second callback function is used for reading the audio hardware parameter through the name of the audio hardware parameter;
specifically, after receiving the audio operation instruction, the terminal calls the second callback function to obtain specific values of all current audio hardware parameters of the target audio device.
2032. When the updated audio hardware parameters of the configurable structure body are different from the current audio hardware parameters, calling a parameter refreshing function to refresh the audio hardware parameters of the target audio equipment and executing the operation corresponding to the audio operation instruction;
specifically, when the updated audio hardware parameter in the configurable structure is different from the current audio hardware parameter obtained in step 2031, it indicates that the audio hardware parameter of the target audio device needs to be refreshed, at this time, a parameter refresh function is called to refresh the audio hardware parameter of the target audio device, the audio hardware parameter of the target audio device is refreshed to the audio hardware parameter of the configurable structure, and then the operation corresponding to the audio operation instruction is executed. The parameter refresh function may be a flush function, or may be another function. Furthermore, the audio hardware parameters in the updated configurable structural body at the moment can be saved as power-down backup data; and outputting parameter setting success information to enable the user to know the parameter setting result. The power-fail backup data can be stored in the nonvolatile storage medium, so that the data can still be stored after power failure.
The successful parameter setting information may be output by directly displaying the information on the terminal or sending a message such as a short message, a QQ message or a WeChat message to a predetermined user terminal.
2033. When the updated audio hardware parameters of the configurable structure body are the same as the current audio hardware parameters, parameter setting success information is output, and operation corresponding to the audio operation instruction is executed.
Specifically, the output mode of the successful parameter setting information is the same as that in step 2032, and is not described again.
Specifically, 2031, 2032 and 2033 are only used for distinguishing different steps, and the order of execution of these steps is not limited.
Therefore, in the parameter modification process, not only can the judgment on whether the parameter is updated be carried out, but also dynamic modification can be realized.
In a possible embodiment, since the audio hardware parameters stored in power down are provided, in order to avoid pop sound caused by repeated setting, user experience is optimized, and after power on, after the audio hardware parameters set by a user are obtained, the method further includes:
s3, acquiring power-down backup data;
specifically, as can be seen with reference to the description of step 2032, the power-down backup data stores audio hardware parameters set by a user for refreshing, and when the parameters are stored, the corresponding relationship between the time and the audio hardware parameters may be stored, for example, in a table form. Further, only the audio hardware parameters with the latest time can be reserved, that is, in the manner of covering storage, when there is a new audio hardware parameter needing to be stored, the audio hardware parameters with the older time are covered. It is also possible to save a fixed time interval or a preset number of audio hardware parameters, for example, only audio hardware parameter data with a time interval within 2 days or 5 days (or other time intervals) is reserved. Or only 3 or 5 (or other numbers) audio hardware parameters are reserved, and the setting can be carried out according to the needs.
After the audio hardware parameters set by the user are obtained, data recovery can be performed from a backup area (namely, a nonvolatile storage medium) of the terminal, and the latest audio hardware parameters at the power failure time in the power failure backup data are obtained.
S4, when the audio hardware parameter at the latest power failure moment in the power failure backup data is the same as the set audio hardware parameter, outputting parameter setting success information;
specifically, the fact that the audio hardware parameter at the latest power failure time is the same as the set audio hardware parameter indicates that the current audio hardware parameter of the audio device is the same as the audio hardware parameter that the user wants to set, and the configurable structural body does not need to be updated, and at this time, the parameter setting success information is output. When an audio operation instruction for a target audio device is received, an operation corresponding to the audio operation instruction may be directly performed.
And S5, when the audio hardware parameter at the latest power failure moment is different from the set audio hardware parameter, executing and calling a first callback function, and updating the variable quantity value in the configurable structural body according to the set audio hardware parameter.
Specifically, when the audio hardware parameter at the latest power down time is different from the set audio hardware parameter, it indicates that the current audio hardware parameter of the audio device is different from the audio hardware parameter that the user wants to set, and at this time, the configurable structural body needs to be updated, that is, step 202 and step 203 are executed.
When the configurable structure body is updated, the audio hardware parameters set by a user can be transferred to the first callback function by calling the amix function, so that the first callback function correspondingly modifies the data of the configurable structure body according to the name of the audio hardware parameters, and the configurable structure body is updated.
Likewise, S3, S4, and S5 in the foregoing description are only for distinguishing different steps, and the execution order of the steps is not limited.
In one possible embodiment, when audio hardware parameters set by a user are acquired, information input by the user can be received through a preset interface; in addition, a historical data selection window can be provided, historical data displayed in the window are power-down backup data (more than one data), a user can directly select audio hardware parameters to be set by clicking, manual input is not needed, and user experience is improved.
Based on the description of the above-mentioned audio hardware parameter setting method embodiment, an audio hardware parameter setting device is further disclosed in the embodiments of the present invention, referring to fig. 3, fig. 3 is a schematic structural diagram of an audio hardware parameter setting device provided in the embodiments of the present invention, and the audio hardware parameter setting device includes:
a first obtaining module 301, configured to obtain an audio hardware parameter set by a user for a target audio device, where the audio hardware parameter is a setting parameter of an audio bus;
an updating module 302, configured to invoke the first callback function, and update the variable value in the configurable structure according to the set audio hardware parameter, where the configurable structure is used to store the audio hardware parameter of the audio device; the first callback function is used for realizing parameter setting of the configurable structure body through the name of the audio hardware parameter;
and the refreshing module 303 is configured to respond to the audio operation instruction of the target audio device, refresh the current audio hardware parameter of the target audio device according to the updated configurable structure, and execute an operation corresponding to the audio operation instruction.
In one possible embodiment, the apparatus further comprises:
the third acquisition module is used for acquiring configuration parameters of the audio equipment in the equipment tree;
and the initialization module is used for initializing and filling each member variable in the configurable structural body according to the configuration parameters of the audio equipment in the equipment tree.
In one possible embodiment, the refresh module includes:
the first submodule is used for responding to the audio operation instruction and calling a second callback function to acquire the current audio hardware parameter of the target audio equipment, and the second callback function is used for reading the audio hardware parameter through the name of the audio hardware parameter;
the second submodule is used for calling a parameter refreshing function to refresh the audio hardware parameter of the target audio equipment when the updated audio hardware parameter of the configurable structure is different from the current audio hardware parameter, and executing the operation corresponding to the audio operation instruction;
and the third submodule is used for outputting parameter setting success information when the updated audio hardware parameter of the configurable structural body is the same as the current audio hardware parameter, and executing the operation corresponding to the audio operation instruction.
In one possible embodiment, the apparatus further comprises:
the storage module is used for storing the updated audio hardware parameters in the configurable structural body as power-down backup data;
the second acquisition module is used for acquiring power-down backup data;
the first execution module is used for outputting parameter setting success information when the audio hardware parameter at the latest power failure moment in the power failure backup data is the same as the set audio hardware parameter;
and the second execution module is used for executing and calling the first callback function when the audio hardware parameter at the latest power failure moment is different from the set audio hardware parameter, and updating the variable quantity value in the configurable structural body according to the set audio hardware parameter.
In one possible embodiment, the audio hardware parameters include the clock, frame synchronization timing mode, and operating mode of the audio bus.
It should be noted that, for a specific implementation manner of the audio hardware parameter setting apparatus, reference may be made to the description of the audio hardware parameter setting method, and details are not described here again. Each unit or module in the audio hardware parameter setting apparatus may be respectively or completely combined into one or several other units or modules to form, or some unit(s) or module(s) thereof may be further split into multiple units or modules with smaller functions to form, which may implement the same operation without affecting implementation of technical effects of embodiments of the present invention. The above units or modules are divided based on logic functions, and in practical applications, the functions of one unit (or module) may also be implemented by a plurality of units (or modules), or the functions of a plurality of units (or modules) may be implemented by one unit (or module).
Based on the description of the method embodiment and the device embodiment, the embodiment of the invention also provides audio hardware parameter setting equipment.
Fig. 4 is a schematic structural diagram of an audio hardware parameter setting device according to an embodiment of the present invention. As shown in fig. 4, the audio hardware parameter setting apparatus described above may be applied to the audio hardware parameter setting device 400, and the audio hardware parameter setting device 400 may include: the processor 401, the network interface 404 and the memory 405, and the audio hardware parameter setting device 400 may further include: a user interface 403, and at least one communication bus 402. Wherein a communication bus 402 is used to enable connective communication between these components. The user interface 403 may include a Display (Display) and a Keyboard (Keyboard), and the selectable user interface 403 may also include a standard wired interface and a standard wireless interface. The network interface 404 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 405 may be a high-speed RAM memory or a non-volatile memory (e.g., at least one disk memory). The memory 405 may alternatively be at least one storage device located remotely from the aforementioned processor 401. As shown in fig. 4, the memory 405, which is a type of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program.
In the audio hardware parameter setting apparatus 400 shown in fig. 4, the network interface 404 may provide a network communication function; and the user interface 403 is primarily an interface for providing input to a user; and processor 401 may be used to invoke a device control application stored in memory 405 to implement the steps in the audio hardware parameter setting method described above.
It should be understood that the audio hardware parameter setting device 400 described in the embodiment of the present invention may perform the audio hardware parameter setting method described above, and may also perform the description of the audio hardware parameter setting apparatus described above, which is not described herein again. In addition, the beneficial effects of the same method are not described in detail.
Further, here, it is to be noted that: an embodiment of the present invention further provides a computer storage medium, where a computer program executed by the aforementioned audio hardware parameter setting apparatus is stored in the computer storage medium, and the computer program includes program instructions, and when the processor executes the program instructions, the description of the audio hardware parameter setting method can be executed, so that details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in the embodiments of the computer storage medium to which the present invention relates, reference is made to the description of the method embodiments of the present invention.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (10)

1. An audio hardware parameter setting method, comprising:
acquiring audio hardware parameters set by a user aiming at target audio equipment, wherein the audio hardware parameters are set parameters of an audio bus;
calling a first callback function, and updating a variable value in a configurable structure body according to the set audio hardware parameter, wherein the configurable structure body is used for storing the audio hardware parameter of the audio equipment, and the first callback function is used for realizing parameter setting of the configurable structure body through the name of the audio hardware parameter;
responding to the audio operation instruction of the target audio equipment, refreshing the current audio hardware parameter of the target audio equipment according to the updated configurable structure body, and executing the operation corresponding to the audio operation instruction.
2. The method according to claim 1, wherein the responding to the audio operation instruction of the target audio device, refreshing the current audio hardware parameter of the target audio device according to the updated configurable structure, and executing the operation corresponding to the audio operation instruction comprises:
responding to the audio operation instruction, and calling a second callback function to acquire the current audio hardware parameter of the target audio equipment, wherein the second callback function is used for reading the audio hardware parameter through the name of the audio hardware parameter;
when the updated audio hardware parameter of the configurable structure is different from the current audio hardware parameter, calling a parameter refreshing function to refresh the audio hardware parameter of the target audio equipment, and executing the operation corresponding to the audio operation instruction;
and when the updated audio hardware parameter of the configurable structure body is the same as the current audio hardware parameter, outputting parameter setting success information and executing the operation corresponding to the audio operation instruction.
3. The method of claim 1, further comprising:
and saving the updated audio hardware parameters in the configurable structural body as power-down backup data.
4. The method of claim 3, wherein after obtaining the set audio hardware parameters, the method further comprises:
acquiring the power-down backup data;
outputting parameter setting success information when the audio hardware parameter at the latest power failure moment in the power failure backup data is the same as the set audio hardware parameter;
and when the audio hardware parameter at the latest power failure moment is different from the set audio hardware parameter, executing and calling the first callback function, and updating the variable quantity value in the configurable structural body according to the set audio hardware parameter.
5. The method of any of claims 1 to 4, wherein the audio hardware parameters include a clock of an audio bus, a frame synchronization timing mode, and an operation mode.
6. An audio hardware parameter setting apparatus, comprising:
the first acquisition module is used for acquiring audio hardware parameters set by a user aiming at target audio equipment, wherein the audio hardware parameters are setting parameters of an audio bus;
the updating module is used for calling the first callback function and updating the variable value in the configurable structure body according to the set audio hardware parameter, wherein the configurable structure body is used for storing the audio hardware parameter of the audio equipment; the first callback function is used for realizing parameter setting of the configurable structure body through the name of the audio hardware parameter;
and the refreshing module is used for responding to the audio operation instruction of the target audio equipment, refreshing the current audio hardware parameter of the target audio equipment according to the updated configurable structural body, and executing the operation corresponding to the audio operation instruction.
7. The apparatus of claim 6, further comprising:
the storage module is used for storing the updated audio hardware parameters in the configurable structural body as power-down backup data;
the second acquisition module is used for acquiring the power-down backup data;
the first execution module is used for outputting parameter setting success information when the audio hardware parameter at the latest power failure moment in the power failure backup data is the same as the set audio hardware parameter;
and the second execution module is used for executing and calling the first callback function when the audio hardware parameter at the latest power failure moment is different from the set audio hardware parameter, and updating the variable quantity value in the configurable structural body according to the set audio hardware parameter.
8. The apparatus of claim 6 or 7, wherein the refresh module comprises:
the first submodule is used for responding to the audio operation instruction and calling a second callback function to acquire the current audio hardware parameter of the target audio equipment, and the second callback function is used for reading the audio hardware parameter through the name of the audio hardware parameter;
the second submodule is used for calling a parameter refreshing function to refresh the audio hardware parameter of the target audio equipment when the updated audio hardware parameter of the configurable structure body is different from the current audio hardware parameter, and executing the operation corresponding to the audio operation instruction;
and the third submodule is used for outputting parameter setting success information when the updated audio hardware parameter of the configurable structure body is the same as the current audio hardware parameter, and executing the operation corresponding to the audio operation instruction.
9. An audio hardware parameter setting apparatus, comprising: a processor and a memory;
the processor is connected to a memory, wherein the memory is used for storing program codes, and the processor is used for calling the program codes to execute the audio hardware parameter setting method according to any one of claims 1-5.
10. A computer storage medium, characterized in that the computer storage medium stores a computer program comprising program instructions that, when executed by a processor, perform the audio hardware parameter setting method according to any one of claims 1-5.
CN202010394974.8A 2020-05-11 Audio hardware parameter setting method and related equipment Active CN111679805B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010394974.8A CN111679805B (en) 2020-05-11 Audio hardware parameter setting method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010394974.8A CN111679805B (en) 2020-05-11 Audio hardware parameter setting method and related equipment

Publications (2)

Publication Number Publication Date
CN111679805A true CN111679805A (en) 2020-09-18
CN111679805B CN111679805B (en) 2024-05-14

Family

ID=

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113296984A (en) * 2021-06-15 2021-08-24 杭州朗和科技有限公司 Compatibility parameter determining method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8805790B1 (en) * 2013-03-21 2014-08-12 Nextbit Systems Inc. Backing up audio and video files across mobile devices of a user
CN104240710A (en) * 2013-06-06 2014-12-24 腾讯科技(深圳)有限公司 Information transmission method and system, and terminal equipment
CN104660818A (en) * 2015-02-25 2015-05-27 惠州Tcl移动通信有限公司 Mobile terminal based audio parameter configuration method and system as well as mobile terminal
CN105516853A (en) * 2014-09-26 2016-04-20 惠州市德赛西威汽车电子股份有限公司 On-board entertainment system sound effect parameter debugging device and debugging method
EP3079074A1 (en) * 2015-04-10 2016-10-12 B<>Com Data-processing method for estimating parameters for mixing audio signals, associated mixing method, devices and computer programs
CN109743528A (en) * 2018-12-29 2019-05-10 广州市保伦电子有限公司 A kind of audio collection of video conference and play optimization method, device and medium
CN109960485A (en) * 2017-12-26 2019-07-02 安凯(广州)微电子技术有限公司 A kind of audio adjustment method, audio debugging apparatus and terminal device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8805790B1 (en) * 2013-03-21 2014-08-12 Nextbit Systems Inc. Backing up audio and video files across mobile devices of a user
CN104240710A (en) * 2013-06-06 2014-12-24 腾讯科技(深圳)有限公司 Information transmission method and system, and terminal equipment
CN105516853A (en) * 2014-09-26 2016-04-20 惠州市德赛西威汽车电子股份有限公司 On-board entertainment system sound effect parameter debugging device and debugging method
CN104660818A (en) * 2015-02-25 2015-05-27 惠州Tcl移动通信有限公司 Mobile terminal based audio parameter configuration method and system as well as mobile terminal
EP3079074A1 (en) * 2015-04-10 2016-10-12 B<>Com Data-processing method for estimating parameters for mixing audio signals, associated mixing method, devices and computer programs
CN109960485A (en) * 2017-12-26 2019-07-02 安凯(广州)微电子技术有限公司 A kind of audio adjustment method, audio debugging apparatus and terminal device
CN109743528A (en) * 2018-12-29 2019-05-10 广州市保伦电子有限公司 A kind of audio collection of video conference and play optimization method, device and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘哲峰: "嵌入式 Linux 音频设备的驱动设计与研究", 《中国优秀硕士学位论文全文数据库信息科技辑》, pages 138 - 371 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113296984A (en) * 2021-06-15 2021-08-24 杭州朗和科技有限公司 Compatibility parameter determining method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
AU2010327452B2 (en) Mobile device and control method thereof
CN101354629B (en) Method and apparatus for controlling display of windows
US20080070616A1 (en) Mobile Communication Terminal with Improved User Interface
CN101354646A (en) Method and apparatus for controlling window display
CN111813492B (en) Display method and device for quick application, electronic equipment and storage medium
EP4119207A1 (en) Vibration control method and apparatus, and electronic device and computer-readable storage medium
KR20050091246A (en) Method and apparatus for displaying plural screens at the same time in the mobile phone
CN111240774A (en) Dynamic wallpaper generation method and device, storage medium and electronic equipment
CN108986187A (en) A kind of implementation method, device, storage medium and the android terminal of general animation
CN111679805B (en) Audio hardware parameter setting method and related equipment
US20150317185A1 (en) Method for switching operating system and electronic device using the method
CN111679805A (en) Audio hardware parameter setting method and related equipment
JP2008158892A (en) Sound volume control method and information processor
KR100680917B1 (en) Mobile terminal capable of setting dynamic menu and using menu setting method the same
CN114461478A (en) Simulator, drive test method, electronic device, and computer-readable storage medium
CN109814953B (en) Wearable device view processing method and device, wearable device and storage medium
WO2016138703A1 (en) Standby interface processing method, device and computer storage medium
CN110874143B (en) Sensor data acquisition method, intelligent terminal, storage medium and electronic equipment
JP4887110B2 (en) Mobile communication terminal and server
CN109783329B (en) Application program blank data prompting method and system and terminal equipment
CN111488189B (en) Window display method, device, equipment and computer readable storage medium
KR20060024589A (en) Mobile terminal having an usb on the go module
EP4236285A1 (en) Enhanced vibration prompting method and electronic device
CN109445873B (en) Method and device for displaying setting interface
US20220362668A1 (en) Information display method and apparatus, terminal, storage medium, and computer program product

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