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

Audio hardware parameter setting method and related equipment Download PDF

Info

Publication number
CN111679805B
CN111679805B CN202010394974.8A CN202010394974A CN111679805B CN 111679805 B CN111679805 B CN 111679805B CN 202010394974 A CN202010394974 A CN 202010394974A CN 111679805 B CN111679805 B CN 111679805B
Authority
CN
China
Prior art keywords
audio
audio hardware
hardware parameters
parameters
equipment
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
CN202010394974.8A
Other languages
Chinese (zh)
Other versions
CN111679805A (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
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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

The embodiment of the invention discloses an audio hardware parameter setting method and related equipment, wherein the audio hardware parameter set by a user aiming at target audio equipment is obtained, and the audio hardware parameter is a setting parameter of an audio bus; calling a first callback function, updating variable values in a configurable structure according to the set audio hardware parameters, wherein the configurable structure is used for storing the audio hardware parameters 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 current audio hardware parameters of the target audio equipment according to the updated configurable structural body, and executing an operation corresponding to the audio operation instruction; therefore, the method of the embodiment of the invention can realize the dynamic modification of the audio hardware coefficient of the target audio equipment, has simple modification operation and effectively improves the user experience.

Description

Audio hardware parameter setting method and related equipment
Technical Field
The present invention relates to the field of audio technologies, and in particular, to a method and related device for setting audio hardware parameters.
Background
Terminals, especially wireless terminals, are increasingly in demand for audio devices. Audio data transmission mainly relies on an audio bus, such as a PCM bus or an I2S bus, and different audio devices have a variety of differences in the hardware parameter requirements of the audio bus. In the prior art, one version of audio driving software can only be suitable for audio equipment with one hardware parameter requirement, and cannot be compatible with the hardware configuration requirements of different audio equipment. Therefore, when the terminal is connected with different audio devices (each audio device has different requirements on hardware parameters of the audio bus) each time, relevant configuration of audio driving software needs to be modified for each audio device, so that modification difficulty is huge for common users, workload is definitely increased, and use experience of the users 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 have simple modification operation.
In a first aspect, an embodiment of the present invention provides a method for setting audio hardware parameters, 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 variable values in a configurable structure body according to the set audio hardware parameters, wherein the configurable structure body is used for storing the audio hardware parameters of the audio equipment, and the first callback function is used for realizing parameter setting of the configurable structure body through names of the audio hardware parameters;
Responding to the audio operation instruction of the target audio equipment, refreshing the current audio hardware parameters of the target audio equipment according to the updated configurable structural body, and executing the operation corresponding to the audio operation instruction.
Optionally, the responding to the audio operation instruction of the target audio device refreshes the current audio hardware parameters of the target audio device according to the updated configurable structure body, and executing the 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 parameters of the target audio equipment, wherein the second callback function is used for reading the audio hardware parameters through the names of the audio hardware parameters;
When the updated audio hardware parameters of the configurable structure body are different from the current audio hardware parameters, a parameter refreshing function is called to refresh the audio hardware parameters of the target audio equipment, and the operation corresponding to the audio operation instruction is executed;
And when the updated audio hardware parameters of the configurable structure body are the same as the current audio hardware parameters, outputting parameter setting success information, and executing the operation corresponding to the audio operation instruction.
Optionally, the method further comprises:
and storing the audio hardware parameters in the updated configurable structure body as power-down backup data.
Optionally, after acquiring the set audio hardware parameters, the method further includes:
Acquiring the power-down backup data;
outputting parameter setting success information when the audio hardware parameters at the latest power-down time in the power-down backup data are the same as the set audio hardware parameters;
And when the audio hardware parameters at the latest power-down time are different from the set audio hardware parameters, executing and calling the first callback function, and updating the variable values in the configurable structural body according to the set audio hardware parameters.
Optionally, the audio hardware parameters include a clock, a frame synchronization timing mode, and an operational mode of the audio bus.
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 a first callback function, updating the variable values in the configurable structural body according to the set audio hardware parameters, and the configurable structural body is used for storing the audio hardware parameters 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 parameters 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 audio hardware parameters in the updated configurable structure 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-down time in the power-down 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-down time is different from the set audio hardware parameter, and updating the variable value in the configurable structure body according to the set audio hardware parameter.
Optionally, the refresh module includes:
The first sub-module is used for responding to the audio operation instruction, calling a second callback function to acquire the current audio hardware parameters of the target audio equipment, and the second callback function is used for reading the audio hardware parameters through the names of the audio hardware parameters;
the second sub-module is used for 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 when the updated audio hardware parameters of the configurable structure body are different from the current audio hardware parameters;
And the third sub-module is used for outputting parameter setting success information and executing the operation corresponding to the audio operation instruction when the audio hardware parameters updated by the configurable structural body are the same as the current audio hardware parameters.
In a third aspect, an embodiment of the present invention provides an audio hardware parameter setting apparatus, including: a processor and a memory;
The processor is connected to a memory, where the memory is configured to store program code, and the processor is configured to invoke the program code to execute the audio hardware parameter setting method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer storage medium storing a computer program, the computer program comprising program instructions which, when executed by a processor, perform the audio hardware parameter setting method of 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, updating variable values in a configurable structure according to the set audio hardware parameters, wherein the configurable structure is used for storing the audio hardware parameters 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 current audio hardware parameters of the target audio equipment according to the updated configurable structural body, and executing an operation corresponding to the audio operation instruction; therefore, the method of the embodiment of the invention can realize the dynamic modification of the audio hardware coefficient of the target audio equipment, has simple modification operation 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 required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of a scenario of an audio hardware parameter setting method according to an embodiment of the present invention;
fig. 2 is a flowchart of 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 device 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 solutions 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 in the claims and drawings are used for distinguishing between different objects and not necessarily for describing a particular sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may 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 may be included in at least one embodiment of the invention. The appearances of such phrases 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. Those of skill in the art will explicitly and implicitly appreciate that the described embodiments of the invention may be combined with other embodiments.
Herein, the audio device refers to an audio output device including a speaker (or a loudspeaker), a sound box, or the like, 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, a tablet personal computer and the like. The terminal and the audio equipment can be in wired communication or wireless communication, wherein the wired communication mode comprises USB communication, 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 method for modifying the audio hardware parameter in the audio driving software.
In the prior art, since the audio driver software of one version is only suitable for audio equipment with one audio hardware parameter requirement, when the audio equipment connected with the terminal is replaced, relevant configuration of the audio driver software needs to be correspondingly modified, so that the modification difficulty is high, the operation is inconvenient, and bad use experience is brought to users. The application provides an audio hardware parameter modification method which can dynamically modify the audio hardware coefficient of target audio equipment and has simple modification operation.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of an audio hardware parameter setting method according to an embodiment of the present invention; in fig. 1, the audio device is exemplified by a speaker, the terminal 102 is a computer, and if the audio device connected to the computer at the previous time is 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 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 the user needs to utilize the loudspeaker 2 to play audio, that is, the computer receives an audio operation instruction (assumed to be an audio playing instruction) for the loudspeaker 2, the computer refreshes the current audio hardware parameters of the loudspeaker 2 (the audio hardware parameters before refreshing are still a) according to the updated configurable structure (the audio hardware parameters in the configurable structure are B at this time), so that the loudspeaker 2 executes an operation corresponding to the audio operation instruction, that is, an audio playing operation according to the audio hardware parameters (B).
It can be seen from the above that, by using the audio hardware parameter setting method of the embodiment of the present invention, the audio hardware parameters of the audio device can be dynamically set, and the user only needs to input the audio hardware parameters of the audio device to be set, without modifying the code each time, so that the operation is simple and convenient, and the audio hardware parameters can be adapted to the audio device, thereby effectively improving the user experience.
Fig. 2 is a schematic flow chart of an audio hardware parameter setting method 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 an audio bus, a frame synchronization timing mode, an operation mode, and the like. The audio buses include an I2S bus and a PCM bus, the I2S being commonly referred to as Inter-IC Sound, INTEGRATED INTERCHIP Sound, or IIS for short. Only one master device and transmitting device can exist simultaneously on the I2S bus. 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, devices providing clocks (SCK and WS) are master devices. The I2S is divided into three different modes of operation, a standard I2S mode, a left aligned mode and a right aligned mode, respectively.
PCM (Pulse Code Modulation) is a method of digitizing an analog signal by sampling at equal intervals (i.e., sampling rate clock cycles). The PCM digital audio interface, i.e. the audio data transmitted over the interface, is obtained by PCM sampling. The frame synchronization timing modes include a long frame synchronization mode and a short frame synchronization mode. The modes of operation of the PCM bus include ST-BUS, GCI, mcBSP modes.
202. Calling a first callback function, updating variable values in a configurable structural body according to the set audio hardware parameters, wherein the configurable structural body is used for storing the audio hardware parameters of the audio equipment, and the first callback function is used for realizing parameter setting of the configurable structural body through names of the audio hardware parameters;
Specifically, with the first callback function, the specific value of the corresponding audio hardware parameter in the configurable fabric may be modified according to the name of the audio hardware parameter.
203. Responding to the audio operation instruction of the target audio equipment, refreshing the current audio hardware parameters 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 refers to POP sound generated by transient impact caused by various operations after the audio device is powered on and powered off at the moment and after the power on is stable), after receiving an audio operation instruction of a user for the target audio device, audio hardware parameters of the target audio device are refreshed, and an operation corresponding to the audio operation instruction is executed. The audio operation instruction comprises an audio playing instruction and an audio acquisition instruction (such as recording and the like).
Therefore, the method of the embodiment of the invention can realize the dynamic modification of the audio hardware coefficient of the target audio equipment, has simple modification operation and effectively improves the user experience. In addition, the workload of debugging the audio driving software can be reduced to a great extent, and meanwhile, the compatibility and portability of the audio driving 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 used for storing all possible audio hardware parameters of the audio equipment. Wherein, different parameter variables in the configurable structural body represent different hardware parameters of the audio bus respectively, the audio hardware parameters take clock, frame synchronization time sequence mode and operation mode as examples, and the configurable structural body at this time can be:
In one possible embodiment, before performing step 201, the method further comprises:
s1, acquiring configuration parameters of audio equipment in an equipment tree;
Specifically, configuration parameters about audio devices in a device tree of the terminal are acquired. The configuration parameters in the device tree may be any configuration parameters of the audio device, and are not particularly limited.
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 configuration items in the equipment tree are read, the values of the member variables in the corresponding structural body are filled, and the normal use of the default configuration of the equipment tree is ensured, so that 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 are required to be registered, so that the upper layer can read the current audio hardware parameter of the audio device through the name of the audio hardware parameter, or can set the variable value in the configurable structure through the name of the audio hardware parameter. For example, a snd_dai_new structure is defined, and is used for registering callback functions of each audio hardware parameter, and get and put functions of a user layer are implemented in each callback function, such as:
A callback function registering each audio hardware parameter 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, different kcontrol controls are registered in the audio driving software according to the configuration of the snd_dai_new structure, and the registered controls are used for setting parameters of a user layer.
In one possible embodiment, step 203 includes:
2031. Responding to the audio operation instruction, calling a second callback function to acquire the current audio hardware parameter of the target audio device, 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 may obtain the specific values of all the current audio hardware parameters of the target audio device by calling the second callback function.
2032. When the updated audio hardware parameters of the configurable structure body are different from the current audio hardware parameters, a parameter refreshing function is called to refresh the audio hardware parameters of the target audio equipment, and an operation corresponding to the audio operation instruction is executed;
Specifically, when the updated audio hardware parameters in the configurable structure body are different from the current audio hardware parameters obtained in step 2031, it indicates that the audio hardware parameters of the target audio device need to be refreshed, at this time, a parameter refreshing function is called to refresh, the audio hardware parameters of the target audio device are refreshed to the audio hardware parameters of the configurable structure body, and then an operation corresponding to the audio operation instruction is executed. The parameter refreshing function may be a flush function or other functions. Further, the audio hardware parameters in the updated configurable structure at the moment can be saved as power-down backup data; and outputs parameter setting success information so that the user knows the parameter setting result. The power down backup data can be stored in a nonvolatile storage medium so as to realize that the data can still be stored after power down.
The mode of outputting the parameter setting success information can be that the parameter setting success information is directly displayed on the terminal or a message such as a short message, a QQ or a WeChat is sent to a preset user terminal.
2033. And when the updated audio hardware parameters of the configurable structural body are the same as the current audio hardware parameters, outputting parameter setting success information, and executing the operation corresponding to the audio operation instruction.
Specifically, the output manner of the parameter setting success information is the same as that of step 2032, and will not be described again.
In particular, 2031, 2032 and 2033 are only for distinguishing between different steps, and the order of execution of these steps is not limited.
Therefore, in the parameter modification process, the parameter updating judgment can be performed, and the dynamic modification can be realized.
In one possible embodiment, due to the audio hardware parameters stored in the power-down state, in order to avoid pop sound caused by repeated setting, the user experience is optimized, and after power-up, after the audio hardware parameters set by the user are obtained, the method further includes:
s3, acquiring power-down backup data;
Specifically, as can be seen from the description of step 2032, the power-down backup data is stored with audio hardware parameters set by the user for refreshing, and when the parameters are stored, the corresponding relationship between the storage time and the audio hardware parameters may be stored, for example, in the form of a table. Further, only the audio hardware parameters with the latest time can be reserved, namely, when new audio hardware parameters needing to be stored exist in the mode of overlaying storage, the audio hardware parameters with the older time are overlaid. It is also possible to save a fixed time interval or a preset number of audio hardware parameters, e.g. only audio hardware parameter data with a time interval within 2 days or 5 days (or other time interval) is reserved. Or only 3 or 5 (or other numbers) audio hardware parameters are reserved, and can be set according to the needs.
After the audio hardware parameters set by the user are obtained, data recovery can be performed from the backup area (namely the nonvolatile storage medium) of the terminal, and the audio hardware parameters at the latest power-down time in the power-down backup data are obtained.
S4, outputting parameter setting success information when the audio hardware parameters at the latest power-down time in the power-down backup data are the same as the set audio hardware parameters;
specifically, when the audio hardware parameter at the latest power-down time is the same as the set audio hardware parameter, it indicates that the current audio hardware parameter of the audio device is the same as the audio hardware parameter which the user wants to set, and the configurable structure body does not need to be updated, and at this time, 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.
S5, when the audio hardware parameter at the latest power-down time is different from the set audio hardware parameter, executing and calling a first callback function, and updating the variable 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 structure needs to be updated, that is, step 202 and step 203 are performed.
When the configurable structure is updated, the audio hardware parameters set by the 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 according to the names of the audio hardware parameters, and the configurable structure is updated.
Also, S3, S4 and S5 in the foregoing description are merely for distinguishing between different steps, and the order of execution of these steps is not limited.
In one possible embodiment, when the audio hardware parameters set by the 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, the historical data displayed in the window is power-down backup data (more than one data), and a user can directly select the audio hardware parameters to be set by clicking without manually inputting, so that the user experience is improved.
Based on the description of the embodiment of the audio hardware parameter setting method, the embodiment of the invention also discloses an audio hardware parameter setting device, referring to fig. 3, fig. 3 is a schematic structural diagram of the audio hardware parameter setting device provided by the embodiment of the invention, where the audio hardware parameter setting device includes:
the first obtaining module 301 is 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;
The updating module 302 is configured to call a first callback function, update a variable value in a configurable structure according to a 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 sub-module is used for responding to the audio operation instruction, calling a second callback function to acquire the current audio hardware parameter of the target audio device, and the second callback function is used for reading the audio hardware parameter through the name of the audio hardware parameter;
The second sub-module is used for 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 when the updated audio hardware parameters of the configurable structure body are different from the current audio hardware parameters;
And the third sub-module is used for outputting the successful parameter setting information and executing the operation corresponding to the audio operation instruction when the audio hardware parameters updated by the configurable structural body are the same as the current audio hardware parameters.
In one possible embodiment, the apparatus further comprises:
the storage module is used for storing the audio hardware parameters in the updated configurable structure 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-down time in the power-down 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-down moment is different from the set audio hardware parameter, and updating the variable value in the configurable structural body according to the set audio hardware parameter.
In one possible embodiment, the audio hardware parameters include a clock of the audio bus, a frame synchronization timing mode, and an operational mode.
It should be noted that, for the specific functional implementation manner of the audio hardware parameter setting apparatus, reference may be made to the description of the above audio hardware parameter setting method, and no further description is given here. The units or modules in the audio hardware parameter setting device may be combined into one or several other units or modules, or some (some) of the units or modules may be split into multiple units or modules with smaller functions, which may achieve the same operation without affecting the implementation of the technical effects of the 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 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 an audio hardware parameter setting device.
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 above-described audio hardware parameter setting apparatus may be applied to the audio hardware parameter setting device 400, and the audio hardware parameter setting device 400 may include: processor 401, network interface 404 and memory 405, in addition, the audio hardware parameter setting device 400 may further comprise: a user interface 403, and at least one communication bus 402. Wherein communication bus 402 is used to enable connected communications between these components. The user interface 403 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 403 may further include a standard wired interface and a 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 (non-volatile memory), such as at least one disk memory. The memory 405 may also optionally be at least one storage device located remotely from the aforementioned processor 401. As shown in fig. 4, an operating system, a network communication module, a user interface module, and a device control application may be included in the memory 405, which is one type of computer storage medium.
In the audio hardware parameter setting apparatus 400 shown in fig. 4, the network interface 404 may provide a network communication function; while user interface 403 is primarily an interface for providing input to a user; and the processor 401 may be used to invoke the device control application stored in the memory 405 to implement the steps in the audio hardware parameter setting method described above.
It should be understood that, in the embodiment of the present invention, the audio hardware parameter setting apparatus 400 may perform the audio hardware parameter setting method described above, and may also perform the description of the audio hardware parameter setting device described above, which is not described herein again. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiment of the present invention further provides a computer storage medium, in which a computer program executed by the aforementioned audio hardware parameter setting apparatus is stored, and the computer program includes program instructions, when executed by the processor, can execute the foregoing description of the audio hardware parameter setting method, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer storage medium according to the present invention, please refer to the description of the method embodiments of the present invention.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps 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 (Random Access Memory, RAM), or the like.
The foregoing disclosure is illustrative of the present invention and is not to be construed as limiting the scope of the invention, which is defined by the appended claims.

Claims (7)

1. An audio hardware parameter setting method, comprising:
Acquiring audio hardware parameters set by a user aiming at target audio equipment, wherein the audio equipment is audio output equipment or audio input equipment, and the audio hardware parameters are set parameters of an audio bus;
calling a first callback function, and updating variable values in a configurable structure body according to the set audio hardware parameters, wherein the configurable structure body is used for storing the audio hardware parameters of the audio equipment, and the first callback function is used for realizing parameter setting of the configurable structure body through names of the audio hardware parameters;
Responding to the audio operation instruction of the target audio equipment, refreshing the current audio hardware parameters of the target audio equipment according to the updated configurable structural body, and executing the operation corresponding to the audio operation instruction;
The method further comprises the steps of:
storing the audio hardware parameters in the updated configurable structure body as power-down backup data;
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 parameters at the latest power-down time in the power-down backup data are the same as the set audio hardware parameters;
Executing and calling the first callback function when the audio hardware parameter at the latest power-down time is different from the set audio hardware parameter, and updating the variable value in the configurable structure body according to the set audio hardware parameter;
the obtaining the audio hardware parameters set by the user comprises the following steps:
And receiving information input by a user through a preset interface or selecting data through a historical data selection window, wherein the historical data displayed in the window is power-down backup data.
2. The method of claim 1, wherein the responding to the audio operation instruction of the target audio device, refreshing the current audio hardware parameters 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 parameters of the target audio equipment, wherein the second callback function is used for reading the audio hardware parameters through the names of the audio hardware parameters;
When the updated audio hardware parameters of the configurable structure body are different from the current audio hardware parameters, a parameter refreshing function is called to refresh the audio hardware parameters of the target audio equipment, and the operation corresponding to the audio operation instruction is executed;
And when the updated audio hardware parameters of the configurable structure body are the same as the current audio hardware parameters, outputting parameter setting success information, and executing the operation corresponding to the audio operation instruction.
3. The method of any of claims 1 to 2, wherein the audio hardware parameters include a clock, a frame synchronization timing mode, and an operational mode of an audio bus.
4. 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 equipment is audio output equipment or audio input equipment, and the audio hardware parameters are setting parameters of an audio bus;
the updating module is used for calling a first callback function, updating the variable values in the configurable structural body according to the set audio hardware parameters, and the configurable structural body is used for storing the audio hardware parameters 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;
The refreshing module is used for responding to the audio operation instruction of the target audio equipment, refreshing the current audio hardware parameters of the target audio equipment according to the updated configurable structural body and executing the operation corresponding to the audio operation instruction;
the apparatus further comprises:
the storage module is used for storing the audio hardware parameters in the updated configurable structure 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-down time in the power-down backup data is the same as the set audio hardware parameter;
The second execution module is used for executing and calling the first callback function when the audio hardware parameter at the latest power-down time is different from the set audio hardware parameter, and updating the variable value in the configurable structure body according to the set audio hardware parameter;
The first obtaining module is configured to receive information input by a user through a preset interface or perform data selection through a historical data selection window, where historical data displayed in the window is power-down backup data.
5. The apparatus of claim 4, wherein the refresh module comprises:
The first sub-module is used for responding to the audio operation instruction, calling a second callback function to acquire the current audio hardware parameters of the target audio equipment, and the second callback function is used for reading the audio hardware parameters through the names of the audio hardware parameters;
the second sub-module is used for 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 when the updated audio hardware parameters of the configurable structure body are different from the current audio hardware parameters;
And the third sub-module is used for outputting parameter setting success information and executing the operation corresponding to the audio operation instruction when the audio hardware parameters updated by the configurable structural body are the same as the current audio hardware parameters.
6. An audio hardware parameter setting apparatus, comprising: a processor and a memory;
The processor is connected to a memory, wherein the memory is adapted to store program code, and the processor is adapted to invoke the program code to perform the audio hardware parameter setting method according to any of claims 1-3.
7. A computer storage medium storing a computer program comprising program instructions which, when executed by a processor, perform the audio hardware parameter setting method according to any of claims 1-3.
CN202010394974.8A 2020-05-11 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 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 2020-05-11 Audio hardware parameter setting method and related equipment

Publications (2)

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

Family

ID=72433693

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN111679805B (en)

Families Citing this family (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 音频设备的驱动设计与研究;刘哲峰;《中国优秀硕士学位论文全文数据库信息科技辑》;I138-371 *

Also Published As

Publication number Publication date
CN111679805A (en) 2020-09-18

Similar Documents

Publication Publication Date Title
US20080070616A1 (en) Mobile Communication Terminal with Improved User Interface
US8649826B2 (en) Mobile device and control method thereof
TWI453603B (en) Platform independent information handling system, communication method, and computer program product thereof
JP7224554B1 (en) INTERACTION METHOD, DEVICE, ELECTRONIC DEVICE AND COMPUTER-READABLE RECORDING MEDIUM
CN113190314B (en) Interactive content generation method and device, storage medium and electronic equipment
CN101354646A (en) Method and apparatus for controlling window display
JP2023540753A (en) Video processing methods, terminal equipment and storage media
EP4119207A1 (en) Vibration control method and apparatus, and electronic device and computer-readable storage medium
WO2023051293A1 (en) Audio processing method and apparatus, and electronic device and storage medium
CN109151172A (en) Audio output control method and relevant device
JP2013542479A (en) Composite attribute control method and portable terminal supporting the same
CN112579038A (en) Built-in recording method and device, electronic equipment and storage medium
CN111679805B (en) Audio hardware parameter setting method and related equipment
KR20120076485A (en) Method and apparatus for providing e-book service in a portable terminal
WO2006054869A1 (en) Mobile communication terminal capable of playing and updating multimedia content and method of playing the same
US9230529B2 (en) Music reproducing apparatus
US20080155416A1 (en) Volume control method and information processing apparatus
CN108986187A (en) A kind of implementation method, device, storage medium and the android terminal of general animation
WO2015117550A1 (en) Method and apparatus for acquiring reverberated wet sound
CN113407103B (en) Music playing control method and terminal equipment
CN111666068B (en) Platform development framework, construction method, equipment and medium
CN110874143B (en) Sensor data acquisition method, intelligent terminal, storage medium and electronic equipment
CN109445873B (en) Method and device for displaying setting interface
EP4236285A1 (en) Enhanced vibration prompting method and electronic device
KR20120018539A (en) Control method for display having a plurality of display panel and apparatus thereof

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