Method for reducing camera shake and electronic equipment

By detecting the camera's turn-on state, adjusting the speaker's output power is solved, the camera shaking problem caused by speaker vibration is improved, and the image quality is improved, ensuring the normal operation of the device.

CN119299855APending Publication Date: 2025-01-10HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310842352.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-10
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The vibration of the speaker causes the camera to tremble, especially when using a magnetic camera, affecting the image quality and seriously affecting the normal operation of the equipment.

Method used

By detecting the on state of the camera, adjusting the output power of the speaker, reducing the vibration amplitude of the speaker, thereby reducing the jitter of the camera. The specific method is to reduce the output power of the speaker when the camera is turned on, restore the original power when the camera is turned off, and distinguish the working mode according to different application scenarios to determine whether to reduce the output power of the speaker.

Benefits of technology

It significantly reduces the camera's jitter, improves image quality, and ensures the normal operation of the camera when the speaker is vibrating.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299855A_ABST
    Figure CN119299855A_ABST
Patent Text Reader

Abstract

The invention provides a method for reducing camera shake and electronic equipment. The electronic equipment can reduce the output power of the loudspeaker after detecting that the camera is started, so that the vibration amplitude of the loudspeaker is reduced, the vibration of the camera is reduced, and image jitter is reduced; after it is detected that the camera is turned off, the electronic device may restore the output power of the speaker.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminals, and in particular to a method and electronic device for reducing camera jitter. Background Art

[0002] In electronic devices with integrated speakers and cameras, the vibration of the speakers will cause the camera to vibrate, which in turn causes the image captured by the camera to shake, affecting the camera function. Especially in the scenario of using a magnetic camera (also known as a pogopin camera), the impact of speaker vibration on the pogopin camera is more significant. At this time, the jitter of the image captured by the pogopin camera is also more severe, seriously affecting the normal operation of the pogopin camera. Therefore, there is an urgent need for a method to reduce camera jitter so that the camera can maintain normal operation when the speaker vibrates. Summary of the invention

[0003] The present application provides a method and an electronic device for reducing camera jitter.

[0004] In a first aspect, the present application provides a method for reducing camera jitter, which is applied to an electronic device including a speaker and a camera, the method comprising: using the speaker to play a first audio at a first power; after detecting that the camera is turned on, using the speaker to continue playing the first audio at a second power, the second power being lower than the first power; after detecting that the camera is turned off, using the speaker to continue playing the first audio at the first power.

[0005] By implementing the method provided in the first aspect, after detecting that the camera is turned on, the electronic device can reduce the output power of the speaker, thereby reducing the vibration amplitude of the speaker, reducing the vibration of the camera, and reducing image jitter; after detecting that the camera is turned off, the electronic device can restore the output power of the speaker.

[0006] In combination with the method provided in the first aspect, in some embodiments, the camera is a magnetic camera.

[0007] The magnetic camera, i.e., the pogo pin camera, is more significantly affected by the vibration of the speaker. Therefore, using the method provided in the first aspect in an electronic device using the pogo pin camera can significantly reduce the jitter of the pogo pin camera, reduce image jitter, and improve picture quality.

[0008] Specifically, the speaker includes a power amplifier PA, and using the speaker to play the first audio at a first power specifically includes: PA processes the first audio at a first gain, and the speaker plays the processed first audio at a first loudness; using the speaker to continue playing the first audio at a second power specifically includes: PA continues to process the first audio at a second gain, and the speaker plays the processed first audio at the first loudness.

[0009] In combination with the method provided in the first aspect, detecting that the camera is turned on specifically includes: detecting that a first category of applications turns on the camera; the first category of applications includes: video call applications, camera applications, device managers, sports applications, and somatosensory game applications.

[0010] In this way, the electronic device can distinguish applications according to the characteristics of the scenarios in which different applications use the camera, and determine which applications need and can reduce camera jitter by reducing the output power of the speaker. For applications that do not need or do not support reducing camera jitter by reducing the output power of the speaker, the electronic device will not use the method of reducing the output power of the speaker provided in the first aspect to reduce camera jitter, so as to avoid affecting the normal operation of such applications.

[0011] In combination with the above embodiments, in some implementations, the working mode of the electronic device includes a first mode, a second mode and a third mode, the output power of the speaker corresponding to the first mode is the first power, the output power of the speaker corresponding to the second mode is the first power, the sound effects of the first mode and the second mode are different, and the output power of the speaker corresponding to the third mode is the second power; before using the speaker to continue playing the first audio at the second power, the method also includes: determining that the current working mode of the electronic device is the first mode; using the speaker to continue playing the first audio at the second power, specifically including: setting the working mode of the electronic device to the third mode, and using the speaker to continue playing the first audio at the second power; using the speaker to continue playing the first audio at the first power, specifically including: setting the working mode of the electronic device to the first mode, and using the speaker to continue playing the first audio in the first mode.

[0012] At this time, in a scenario where power can correspond to different working modes, based on the previously recorded working mode of the electronic device, after turning off the camera, the electronic device can not only restore the output power of the speaker to the level before the camera is turned on, but also restore the working mode of the electronic device to the level before the camera is turned on, thereby ensuring that the working state of the electronic device remains unchanged before and after the camera is used.

[0013] In combination with the above embodiments, in some implementations, the hardware abstraction layer of the electronic device includes a camera hardware abstraction layer CamerHal and a television system; the working mode of the electronic device is a first mode, specifically including: CameraHal creates a first thread; CameraHal uses the first thread to obtain a first object from the television system, and the working mode of the electronic device recorded in the first object is the first mode.

[0014] It takes a relatively long time to obtain the working mode of the current electronic device. Creating a thread to obtain the working mode of the current electronic device can avoid the above process of obtaining the working mode of the current electronic device, which affects the initialization process of the camera, so that the electronic device can normally turn on the camera.

[0015] In a second aspect, the present application provides an electronic device, comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.

[0016] In a third aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions so that the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.

[0017] In a fourth aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, causes the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.

[0018] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.

[0019] It can be understood that the electronic device provided in the second aspect, the chip system provided in the third aspect, the computer storage medium provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the method provided in the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flow chart of a method for reducing camera jitter provided in an embodiment of the present application;

[0021] Figure 2 is a flow chart of another method for reducing camera jitter provided by an embodiment of the present application;

[0022] Figure 3 is a system architecture diagram of an Android-based electronic device 100 provided in an embodiment of the present application;

[0023] Figure 4-Figure 5 This embodiment of the present application provides a method based on Figure 3 A timing diagram of the system architecture shown;

[0024] Figure 6 A schematic structural diagram of an electronic device 100 is shown. DETAILED DESCRIPTION

[0025] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application.

[0026] On electronic devices with integrated speakers and cameras, the vibration of the speakers will cause the camera to vibrate, which in turn causes the image captured by the camera to shake, affecting the camera function. Especially in the scenario of using a magnetic camera (also known as a pogopin camera), the impact of the speaker vibration on the pogopin camera is more significant. At this time, the image captured by the pogopin camera will also shake more violently, seriously affecting the normal operation of the pogopin camera.

[0027] Therefore, there is an urgent need for a method to reduce camera shake so that the camera can maintain normal operation when the speaker vibrates.

[0028] The electronic device integrated with the speaker and the camera may be referred to as the electronic device 100. For example, the electronic device 100 may be a large-screen TV. The embodiments of the present application will be described later by taking the large-screen TV as an example.

[0029] Not limited to large-screen TVs, the electronic device 100 may also be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device and / or a smart city device, etc. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device 100.

[0030] In one implementation, the electronic device 100 may add a new image signal processor (ISP) to process the generated image containing jitter, reduce image jitter, and thus improve image quality. However, the added ISP means that physical space needs to be reserved in the electronic device 100 to place the above ISP. This increases the size of the camera module and the cost of the camera module.

[0031] In view of this, an embodiment of the present application provides another method for reducing camera jitter.

[0032] In the method for reducing camera jitter provided in an embodiment of the present application, after detecting that the camera is turned on, the electronic device 100 can reduce the gain of the power amplifier (PA) in the speaker, thereby reducing the output power of the speaker at the same loudness, reducing the vibration amplitude of the speaker, and then reducing the vibration of the camera and reducing image jitter; after detecting that the camera is turned off, the electronic device 100 can restore the output power of the speaker to the state before the camera is turned on, that is, restore the original working state of the speaker.

[0033] Figure 1 This is a flow chart of a method for reducing camera jitter provided in an embodiment of the present application.

[0034] S101: Detect that the camera is turned on.

[0035] The electronic device 100 may be installed with a target application. In the embodiment of the present application, the target application refers to an application that supports calling a camera and providing shooting services, including system applications of the electronic device 100, and also includes third-party applications provided by other developers installed on the electronic device 100.

[0036] For example, the target application may be a camera application, an instant messaging application that provides video calls (such as WeChat), an Internet social application based on audio and video creation (such as TikTok), a fitness application based on camera body sensing detection, a game application, etc. The present application embodiment does not limit this.

[0037] The electronic device 100 can detect that the camera is turned on. For different target applications, the timing at which the electronic device 100 detects that the camera is turned on is different.

[0038] Taking the camera application as an example, the electronic device 100 can detect a user operation of clicking on the camera application icon to open the camera application. At this time, when the user operation of clicking on the camera application icon to open the camera application is detected, the electronic device 100 can determine that the camera is turned on. For another example, taking the instant messaging application as an example, after opening the instant messaging application, the electronic device 100 can detect a user operation of starting a video call. At this time, when the user operation of starting a video call is detected, the electronic device 100 can determine that the camera is turned on. In an Internet social application based on audio and video creation, when it is detected that an audio and video work is started to be created, such as when a vibrato video is started, the electronic device 100 can determine that the camera is turned on, and so on, which will not be listed one by one here.

[0039] S102, obtaining and recording the current working mode of the speaker: normal mode / low gain mode.

[0040] The working mode of the speaker (denoted as PAmode) may include a normal mode (PAmode=Norm) and a low gain mode (PAmode=Low). When PAmode=Norm, that is, in the normal mode, the gain of the PA is higher, the output power of the speaker is higher, and the vibration amplitude is larger. When PAmode=Low, that is, in the low gain mode, the gain of the PA is lower, the output power of the speaker is lower, and the vibration amplitude is smaller. For the same sound source, when other parameters of the speaker are the same, the louder the loudness, the higher the output power of the speaker. Therefore, the basis of the relationship between the gain and the output power of the speaker described in this application includes: the same sound source and the same loudness.

[0041] Among them, according to the posture of the electronic device 100, the normal mode can be further divided into a wall-mounted mode and a table-mounted mode. Wall-mounted means hanging the electronic device 100 on a wall. Table-mounted means placing the electronic device 100 on a table. Different sub-modes in the normal mode can correspond to different sound effects, but the gains of the corresponding PAs are the same, that is, the output power of the corresponding speakers is the same.

[0042] The normal mode is not limited to being subdivided according to the posture of the electronic device 100. The electronic device 100 can also subdivide the normal mode according to the user's usage scenario to determine multiple submodes. For example, depending on whether it is used by the elderly, the normal mode can also include an elderly mode. In addition, the normal mode can also include a theater mode, a sports mode, a music mode, and other distinctive sound effect modes, which are not limited in the embodiments of the present application. The working mode of the speaker is also called the working mode of the electronic device.

[0043] Table 1 is a table of output power of a speaker working mode provided in an embodiment of the present application.

[0044] Table 1

[0045]

[0046] The above maximum output power refers to the output power of the speaker corresponding to the maximum loudness.

[0047] As shown in Table 1, in normal mode, the maximum output power of the speaker is 9.6W; in low-gain mode, the maximum output power of the speaker is 5W, which is lower than that in normal mode. Correspondingly, the vibration amplitude of the speaker in low-gain mode is also lower than that in normal mode.

[0048] After detecting that the camera is turned on, the electronic device 100 can obtain the current working mode of the speaker: normal mode or low gain mode. It can be understood that when a more detailed sub-mode such as the above-mentioned wall-mounted mode and table-mounted mode is set for the normal mode, the electronic device 100 can obtain the above-mentioned sub-mode. Then, the electronic device 100 can record the obtained working mode of the speaker.

[0049] S103: Set the speaker working mode to a low gain mode.

[0050] In one case, when the current working mode of the speaker is the normal mode, including any sub-mode in the normal mode, after setting, the working mode of the speaker is updated to the low gain mode, and the output power of the speaker is reduced. At this time, as the output power of the speaker is reduced, the vibration generated by the speaker is also reduced, and then the camera is less affected by the vibration of the speaker, the camera jitter is reduced, and the image jitter is reduced.

[0051] S104: Detecting that the camera is turned off.

[0052] After detecting that the camera is turned on, the electronic device can detect that the camera is turned off. For different target applications, the user operation corresponding to the electronic device 100 detecting that the camera is turned off is also different.

[0053] Taking the camera application as an example, when a user operation of exiting the camera application is detected, the electronic device 100 can determine that the camera is turned off. The above-mentioned user operation of exiting the camera application, for example: switching to another application, clicking the home button to return to the homepage, and so on. For another example, taking the instant messaging application as an example, when a user operation of ending a video call is detected, the electronic device 100 can determine that the camera is turned off. In an Internet social application based on audio and video creation, when it is detected that the creation of an audio and video work has ended, such as when a vibrato video is finished, the electronic device 100 can determine that the camera is turned off, and so on, which will not be listed one by one here.

[0054] S105: restore the working mode of the speaker to the original mode.

[0055] After detecting that the camera is turned off, the electronic device 100 can obtain the operating mode of the speaker recorded above, and then the electronic device 100 can reset the operating mode of the speaker according to the operating mode of the speaker recorded above, and restore the operating mode of the speaker from the low gain mode to the original mode.

[0056] For example, when executing S102, the electronic device 100 obtains and records that the current working mode of the speaker is the wall-mounted mode. After executing S103, the working mode of the speaker is modified to the low-gain mode. After detecting that the camera is turned off, the electronic device 100 can modify the working mode of the speaker to the wall-mounted mode again according to the aforementioned recorded wall-mounted mode, that is, restore the working mode of the speaker to the original wall-mounted mode.

[0057] pass Figure 1 In the method shown in S101 to S105, after detecting that the camera is turned on, the electronic device 100 can set the working mode of the speaker to a low gain mode, reduce the output power of the speaker, reduce the vibration amplitude of the speaker, and thereby reduce the vibration of the camera and reduce image jitter; after detecting that the camera is turned off, the electronic device 100 modifies the working mode of the speaker again, restores the working mode of the speaker to the state before the camera is turned on, and continues the previous working state.

[0058] Optionally, in other embodiments, the gains of the PAs corresponding to different sub-modes in the normal mode may be different, and the corresponding maximum output powers may also be different, but are all higher than the maximum output power of the low-gain mode.

[0059] Table 2 is another speaker working mode output power table provided in an embodiment of the present application.

[0060] Table 2

[0061]

[0062] Referring to Table 2, the PA gain corresponding to the wall-mounted mode may be greater than the PA gain corresponding to the table-mounted mode. At this time, the maximum output power of the wall-mounted mode may be 9.6W, which is greater than the maximum output power of the table-mounted mode of 8W.

[0063] Figure 2 This is a flowchart of another method for reducing camera jitter provided in an embodiment of the present application.

[0064] like Figure 2As shown, before setting the working mode of the speaker to the low gain mode (S103), S1021, the electronic device 100 may also determine whether the target application for turning on the camera is a preset application that supports setting low gain. When the target application is a preset application that supports setting low gain, after obtaining and recording the current working mode of the speaker (S102), (S103) the electronic device 100 may set the working mode of the speaker to the low gain mode (PAmode=Low); when the target application is not a preset application that supports setting low gain, the electronic device 100 may not modify the working mode of the speaker.

[0065] Referring to S104 and S105, the electronic device 100 can detect that the camera is turned off, and then the electronic device 100 can restore the working mode of the speaker to the original working mode. It can be understood that in the scenario where the working mode of the speaker is not modified, the electronic device 100 does not need to restore the working mode of the speaker to the original working mode.

[0066] According to the functions and usage characteristics of the target application, the target application can be divided into various types, such as video call, camera, device manager, sports, somatosensory games, monitoring, etc. Among them, video call applications such as Changlian, WeChat, etc.; camera applications such as camera, beauty camera, etc.; sports applications such as hot dance, body shape, etc.; somatosensory game applications such as Amy Skiing, Subway Surfers, etc.; monitoring applications such as Hikvision Internet, Meow Eye Elf, etc. During the operation of the above applications, the camera can be called to provide users with related functions based on camera shooting, such as video passing, taking photos or videos, auxiliary sports supervision, somatosensory recognition, video monitoring, etc. The device manager installed on the electronic device 100 can also call the camera to provide users with the function of detecting and correcting the camera.

[0067] In a specific implementation, the electronic device 100 may set the above one or more types of target applications as applications supporting setting of low gain. Table 3 exemplarily shows a group of target applications supporting setting of low gain.

[0068] Table 3

[0069] Target Applications Support settings No setup required Video call √ Camera √ Equipment Manager √ Sports √ Motion sensing games √ Guardianship √

[0070] As shown in Table 3, video call, camera, device manager, sports, and somatosensory game applications can be set to support low gain settings; monitoring applications can correspond to applications that do not need to set low gain. That is to say, when the target application is a video call, camera, device manager, sports, somatosensory game, etc., after detecting that the camera is turned on, the electronic device 100 can set the working mode of the speaker to low gain mode; when the target application is a monitoring application, after detecting that the camera is turned on, the electronic device 100 may not modify the working mode of the speaker.

[0071] Exemplarily, at a certain moment, the electronic device 100 can use a music player to play the first audio. The working mode used by the electronic device 100 when playing audio is usually a non-low gain mode (i.e., normal mode), such as a wall-mounted mode. At this time, the output power of the speaker of the electronic device 100 is relatively high, such as 9.6w as shown in Table 1. The output power of the speaker corresponding to the normal mode (e.g., the above 9.6w) can be called the first power.

[0072] For the first audio, at this time, the electronic device 100 uses the speaker to play the first audio at the first power.

[0073] During the process of playing the first audio, the electronic device 100 may detect a user operation of opening a camera application to start shooting. At this time, the electronic device 100 may record the working mode currently used by the current electronic device, such as a wall-mounted mode. Then, the electronic device 100 may switch the working mode of the electronic device to a low-gain mode. At this time, the output power of the speaker of the electronic device 100 is reduced, for example, to 5w. The output power of the speaker corresponding to the low-gain mode may be referred to as a second power. The second power is lower than the first power.

[0074] For the first audio, at this time, the output power of the electronic device 100 for playing the first audio is updated to 5w, that is, the electronic device 100 continues to play the first audio at the second power using the speaker.

[0075] After detecting the user operation of opening the camera application to start shooting, the electronic device 100 can detect the user operation of closing the camera application to end shooting. At this time, the electronic device 100 can restore the working mode of the electronic device to the wall-mounted mode used originally. Among them, the output power of the speaker can be restored to the first power corresponding to the wall-mounted mode. Then, the electronic device 100 uses the speaker to continue to play the first audio at the first power.

[0076] The first power and the second power correspond to the same loudness (first loudness). For example, when the first power is the maximum output power of the normal mode (including any sub-mode in the normal mode), the second power corresponds to the maximum output power of the low gain mode. The loudness corresponding to the two is the same, which is the maximum loudness.

[0077] The PA gain corresponding to the first power is the first gain, and the PA gain corresponding to the second power is the second gain. The first gain is higher than the second gain. Therefore, when the loudness is the same, the first power is higher than the second power.

[0078] The wall-mounted mode shown in Table 1 may be referred to as a first mode, the table-mounted mode may be referred to as a second mode, and the low-gain mode may be referred to as a third mode.

[0079] Figure 3 It is a system architecture diagram of an Android-based electronic device 100 provided in an embodiment of the present application.

[0080] Android architecture is a layered architecture. The layered architecture divides the system into several layers. The layers communicate with each other through interfaces. Figure 3 As shown, the Android-based layered architecture adopted by the electronic device 100 may include five layers, namely, application layer, framework layer, hardware abstraction layer, driver layer and hardware layer from top to bottom.

[0081] The application layer can include a series of application packages. In the Android architecture, the application package of the application layer is also called the Android application package (APK). Figure 3 As shown, in the embodiment of the present application, the application layer includes at least a camera APK. Corresponding to the camera APK, the application layer also includes a camera access interface (Camera 2 API). The camera APK can obtain camera services downward through the camera access interface.

[0082] The framework layer includes some predefined functions for implementing specific functions. Figure 3 As shown, corresponding to the camera APK, the framework layer at least includes the camera service (CameraService).

[0083] The hardware abstraction layer is located between the framework layer and the driver layer, providing a virtual hardware platform for the operating system. Figure 3 As shown, in the embodiment of the present application, the hardware abstraction layer at least includes a camera hardware abstraction layer (CameraHal), a television system and an audio hardware abstraction layer (AudioHal).

[0084] The driver layer is the layer between hardware and software. The driver layer includes drivers for various hardware. Figure 3 As shown, in the embodiment of the present application, the driver layer includes at least a camera device driver and an audio device driver (MTK MI). The camera device driver is used to drive the camera sensor to capture images and drive the image signal processor (ISP) to pre-process the images. The audio device driver is used to drive the speaker to process audio signals.

[0085] The speaker includes a power amplifier (PA). Figure 1 and Figure 2 The setting of the speaker working mode (PAmode) shown is to set the gain of the PA. Under different gains, the output power of the speaker with the same sound source and the same loudness is different, and the greater the gain, the greater the output power.

[0086] Taking opening the camera application to take a photo as an example, after detecting the user operation of clicking the camera application icon to open the camera application, the camera APK can first send an instruction to open the camera to the camera service through the camera access interface. In response to the above instruction, the camera service can continue to send the camera opening instruction downward to control the camera to power on and run (①).

[0087] On the other hand, the camera service can receive the configuration file sent by the camera APK, and generate image stream configuration information based on the above configuration file. The image stream configuration information includes the type and quantity of image streams. The types of image streams include but are not limited to preview streams, analysis streams, photo streams, and video streams. One type of image stream can be configured with only one or more. After generating the configuration information, the camera service can send the above image stream configuration information to CameraHal (②). Then, CameraHal can create image streams of corresponding types and quantities based on the above configuration information.

[0088] When the configuration file is sent by the camera APK, the camera APK can also send an application identifier (②) to CameraHal through the camera service. The application identifier uniquely corresponds to the target application that calls the camera. CameraHal can determine whether the target application is a preset application that supports setting low gain based on the application identifier, and then determine whether it is necessary to set the speaker working mode to low gain mode to reduce camera jitter. In some embodiments, the package name of the target application can be used as the application identifier.

[0089] According to the mapping relationship shown in Table 1, CameraHal can determine that the target application corresponding to the received application identifier is an application that supports setting low gain, or an application that does not need to set low gain.

[0090] After determining that the target application is an application that supports setting low gain, CameraHal can send an instruction to AudioHal through the TV system to set the speaker working mode to low gain mode (PAmode=Low) (③). In response to the above instruction, AudioHal can set the speaker working mode to low gain mode through MTK MI, reduce PA gain, and thus reduce speaker output power (④).

[0091] In addition, before sending an instruction to AudioHal to set the speaker working mode to low gain mode, CameraHal can first obtain the current speaker working mode from AudioHal and record it, so as to restore the speaker working mode to the original mode after the camera is turned off. For example, CameraHal can obtain from AudioHal that the current speaker working mode is wall-mounted mode.

[0092] After detecting the user operation of exiting the camera application, the camera APK can send an instruction to turn off the camera to the camera service through the camera access interface, and further transmit the above instruction to CameraHal (⑤) through the camera service.

[0093] In response to the above instruction, CameraHal may first obtain the previously recorded working mode of the speaker before the setting. Then, CameraHal may send an instruction to AudioHal to restore the working mode of the speaker (⑥). In response to the above instruction, AudioHal may reset the working mode of the speaker to the previously recorded working mode through MTK MI, thereby restoring it to the original working mode, restoring the original gain of the PA, and restoring the original output power of the speaker (⑦).

[0094] For example, according to the previously recorded setting that the working mode of the front speaker is the wall-mounted mode (PAmode=0), CameraHal can send an instruction to AudioHal to set the working mode of the speaker to the wall-mounted mode. In response to the above instruction, AudioHal can re-set the working mode of the speaker to the wall-mounted mode through MTK MI, thereby restoring it to the wall-mounted mode, restoring the original higher gain of the PA, and restoring the original higher output power of the speaker. In this way, the electronic device 100 can process and play the audio according to the previous higher output power.

[0095] Specifically, Figure 4 This embodiment of the present application provides a method based on Figure 3 The timing diagram of the system architecture is shown.

[0096] like Figure 4 As shown, the camera access interface may include camera management (CameraManager) and camera device description (CameraDeviceImpl). The camera service may include camera device client (CameraDeviceClient) and camera device (Camera3Device). CameraHal may include camera device parameters (CameraDeviceSession). The TV system may include TV client (TvClient) and TV middleware (TvMiddleWare).

[0097] S401. The camera APK detects that the camera is turned on. Referring to S101, the specific events of different target applications detecting that the camera is turned on are different, which will not be repeated here.

[0098] S402. The camera APK obtains the camera ID through CameraManager.

[0099] One or more cameras may be installed on the electronic device 100. Each camera uniquely corresponds to a camera identifier (CameraId). For a general large-screen TV, such a device is usually equipped with only one camera. In the embodiment of the present application, a large-screen TV usually uses a pogopin camera. The camera APK can use CameraManager.getCameraIdList() to obtain all camera identifiers.

[0100] S403. The camera APK obtains the camera capability through CameraManager.

[0101] The camera APK can use CameraManager.getCameraCharacteristics() to obtain camera capabilities. When using CameraManager.getCameraCharacteristics(), the camera APK can write the camera ID of the target camera, for example, CameraManager.getCameraCharacteristics(CameraId=1), then the camera APK can obtain the capabilities of the camera with CameraId=1.

[0102] Camera capabilities include, but are not limited to, Exposure compensation, AE / AF / AWB mode, AE / AWB lock, AF trigger, Precapture AE trigger, Metering regions, Flash trigger, Exposure time, ISO Sensitivity, Frame duration, Lens focus distance, Color correction matrix, JPEG metadata, Tonemap curve, Crop region, Target FPS range, Capture intent, Video stabilization, etc.

[0103] S404. The camera APK sends an instruction to open the camera through CameraManager.

[0104] The camera APK can use CameraManager.openCamera() to send an instruction to open the camera. When using CameraManager.openCamera(), the camera APK can write the camera ID of the target camera, for example, CameraManager.openCamera(CameraId=1). At this time, the camera APK can instruct the CameraManager to open the camera with CameraId=1. Then, the CameraManager can send an instruction to open the camera downward to control the camera with the corresponding camera ID to power on and run.

[0105] S405. The camera APK sends the configuration file to the CameraDeviceClient through the CameraDeviceImpl.

[0106] The camera APK can send the configuration file to the CameraDeviceClient through the CameraDevice.CreateCaptureSession() provided by CameraDeviceImpl. When using CameraDevice.CreateCaptureSession(), the camera APK can write the file name of the configuration file, such as CameraDevice.CreateCaptureSession(SessionConfiguration config), and send the target configuration file to the CameraDeviceClient.

[0107] S406. CameraDeviceClient generates image stream configuration information based on the received configuration file, and returns the image stream configuration information to the camera APK.

[0108] S407. The camera APK transmits the image stream configuration information and application identifier to the CameraDeviceSession through CameraDeviceImpl, CameraDeviceClient, and Camera3Device.

[0109] S408. CameraDeviceSession creates image streams of corresponding types and quantities based on the received image stream configuration information.

[0110] S409.CameraDeviceSession creates and initializes an audio setting thread. In the embodiment of the present application, the audio setting thread (ChangePaMode) is used to obtain and set the speaker working mode. The above audio setting thread (ChangePaMode) is also called the first thread.

[0111] S410. CameraDeviceSession obtains TvManager object and Audio object from TvClient through ChangePaMode. TvManager object includes Audio object. The Audio object records the working mode of the current speaker. The above Audio object is also called the first object.

[0112] S411.ChangePaMode reads and records the current speaker operating mode from the Audio object.

[0113] S412. After determining that the target application corresponding to the application identifier is an application that supports setting low gain, ChangePaMode can send low power mode parameters through TvClient, TvMiddleWare, AudioHal, and Mtk MI to set the working mode of the speaker to low gain mode.

[0114] Among them, TvMiddleWare can send the low gain mode parameters to AudioHal through HnTvHidlSetHangMode(), AudioHal can send the low gain mode parameters to Mtk MI through MI_AOUT_SetAttr(), and Mtk MI can write the configuration table with the low gain mode parameters to the device / dev / mik / aout, that is, the speaker, to set the working mode of the speaker to the low gain mode.

[0115] The configuration table records the logical address of the register for adjusting the analog gain, such as 0x54. Mtk MI can modify the value of the above register according to the low-gain mode parameters, thereby reducing the gain of the PA and reducing the output power of the speaker. For example, Mtk MI can modify 0x54=17 (hexadecimal: 0x11) to 0x54=23 (hexadecimal: 0x17) to reduce the PA gain, thereby reducing the maximum output power of the speaker from 9.6w to 5w, that is, changing the working mode of the speaker from normal mode to low-gain mode.

[0116] When the maximum output power of the speaker is 9.6W, the maximum decibel detected at a distance of 2m from the speaker is about 75db. When the maximum output power of the speaker is 5W, the maximum decibel detected at a distance of 2m from the speaker is about 69db.

[0117] catch Figure 5 :

[0118] S420: Detecting that the camera is turned off. Referring to S104, the specific events of detecting that the camera is turned off are different for different target applications, which will not be described in detail here.

[0119] S421. The camera APK sends an instruction to close the camera through the CameraManager. The CameraManager can transparently transmit the instruction to close the camera to the CameraDeviceSession.

[0120] S422. CameraDeviceSession obtains the TvManager object and the Audio object from TvClient through ChangePaMode. At this time, the working mode of the speaker recorded in the Audio object is the low gain mode set above.

[0121] S423.ChangePaMode sends the previously recorded working mode parameters through TvClient, TvMiddleWare, AudioHal, and Mtk MI to set the working mode of the speaker to the previously recorded working mode.

[0122] Taking the wall-mounted mode as an example, ChangePaMode sends the wall-mounted mode parameter 0 corresponding to the wall-mounted mode through TvClient, TvMiddleWare, AudioHal, and MtkMI. Mtk MI can determine the corresponding register 0x54 value according to the wall-mounted mode parameter 0, for example, 17 (hexadecimal: 0x11), and then modify 0x54=23 to 0x54=17 to increase the PA gain, thereby adjusting the maximum output power of the speaker from 5w back to 9.6w corresponding to the wall-mounted mode, that is, restoring the working mode of the speaker from the low-gain mode to the wall-mounted mode.

[0123] Figure 6 A schematic structural diagram of an electronic device 100 is shown.

[0124] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a power supply 142, a wireless communication module 160, an audio module 170, a speaker 170A, a microphone 170C, a sensor module 180, a button 190, an indicator 192, a camera 193, a display screen 194, etc.

[0125] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0126] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. The controller can generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. A memory can also be set in the processor 110 for storing instructions and data.

[0127] The USB interface 130 is an interface that complies with USB standard specifications, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.

[0128] The power supply 142 receives an external power output and supplies power to the electronic device 100 .

[0129] The wireless communication function of the electronic device 100 can be implemented through the modem processor and baseband processor of the wireless communication module 160.

[0130] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0131] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0132] The ISP is used to process the data fed back by the camera 193. The camera 193 is used to capture static images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1. The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy. The video codec is used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0133] In the embodiment of the present application, the electronic device 100 uses the capabilities provided by the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor to call the camera 193 for shooting. The camera 193 includes a pogo pin camera.

[0134] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0135] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data. The non-volatile memory can also store executable programs and store user and application data. The non-volatile memory can load the executable program and the user and application data into the random access memory in advance for the processor 110 to directly read and write.

[0136] In the embodiment of the present application, the executable program code and user data of the method for reducing camera jitter described in the embodiment of the present application can be stored in a non-volatile memory. When implementing the above-mentioned method for reducing camera jitter, the electronic device 100 can load the executable program code and user data in the non-volatile memory into the random access memory and execute them, thereby realizing the function of reducing camera jitter.

[0137] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function.

[0138] The electronic device 100 can implement audio functions such as music playback, video calls, etc. through the audio module 170, the speaker 170A, the microphone 170C, and the application processor.

[0139] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0140] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A. In the embodiment of the present application, the electronic device 100 can reduce the output power of the speaker by setting the gain of the PA in the speaker 170A, thereby reducing the vibration amplitude of the speaker, reducing the impact of its vibration on the camera 193, reducing the jitter of the camera 193, and further reducing the jitter of the image captured by the camera 193.

[0141] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by approaching the microphone 170C with his mouth to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C.

[0142] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0143] The pressure sensor is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor can be set on the display screen 194. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor. The gyroscope sensor can be used to determine the motion posture of the electronic device 100. The air pressure sensor is used to measure the air pressure. The magnetic sensor includes a Hall sensor. The electronic device 100 can use the magnetic sensor to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the characteristics such as automatic unlocking of the flip cover are set. The acceleration sensor can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). Distance sensor, used to measure the distance. The proximity light sensor may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The ambient light sensor is used to sense the brightness of ambient light. The fingerprint sensor is used to collect fingerprints. The temperature sensor is used to detect temperature. The touch sensor, also known as a "touch control device". The touch sensor can be arranged on the display screen 194, and the touch sensor and the display screen 194 form a touch screen, also known as a "touch screen". The touch sensor is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor can also be arranged on the surface of the electronic device 100, which is different from the position of the display screen 194. The bone conduction sensor can obtain vibration signals.

[0144] The buttons 190 include a power button, a volume button, etc. The electronic device 100 can receive button inputs and generate key signal inputs related to user settings and function control of the electronic device 100. The indicator 192 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0145] As used in the specification and appended claims of the present application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include plural expressions, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more of the listed items. As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrase "when determining..." or "if (stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "when (stated condition or event) is detected" or "in response to detecting (stated condition or event)", depending on the context.

[0146] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.

[0147] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

Claims

1. A method for reducing camera jitter, applied to an electronic device including a speaker and a camera, characterized in that: The method comprises: Playing a first audio at a first power using the speaker; After detecting that the camera is turned on, using the speaker to continue playing the first audio at a second power, where the second power is lower than the first power; After detecting that the camera is turned off or on, the first audio is continuously played using the speaker at the first power.

2. The method according to claim 1, characterized in that: The camera is a magnetic camera.

3. The method according to claim 1, characterized in that: The speaker comprises a power amplifier PA, The using the speaker to play the first audio at the first power specifically includes: the PA processes the first audio at a first gain, and the speaker plays the processed first audio at a first loudness; The using the speaker to continue playing the first audio at the second power specifically includes: the PA continues to process the first audio at the second gain, and the speaker plays the first audio after continued processing at the first loudness.

4. The method according to any one of claims 1 to 3, characterized in that: The detecting that the camera is turned on specifically includes: detecting that a first type of application turns on the camera; The first category of applications includes: video call applications, camera applications, device managers, sports applications, and somatosensory game applications.

5. The method according to claim 4, characterized in that The working modes of the electronic device include a first mode, a second mode and a third mode. The output power of the speaker corresponding to the first mode is the first power. The output power of the speaker corresponding to the second mode is the first power. The sound effects of the first mode and the second mode are different. The output power of the speaker corresponding to the third mode is the second power. Before continuing to play the first audio with the speaker at the second power, the method further includes: Determining that the current operating mode of the electronic device is the first mode; The step of continuing to play the first audio at the second power using the speaker specifically includes: Setting the working mode of the electronic device to the third mode, and using the speaker to continue playing the first audio at the second power; The step of continuing to play the first audio at the first power using the speaker specifically includes: The working mode of the electronic device is set to the first mode, and the first audio is continued to be played by the speaker in the first mode.

6. The method according to claim 5, characterized in that The hardware abstraction layer of the electronic device includes a camera hardware abstraction layer CamerHal and a television system; The determining that the current operating mode of the electronic device is the first mode specifically includes: The CameraHal creates a first thread; The CameraHal uses the first thread to obtain a first object from the television system, and the working mode of the electronic device recorded in the first object is the first mode.

7. An electronic device, characterized in that: The method comprises one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, wherein the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the method according to any one of claims 1 to 6 is executed.

8. A chip system, the chip system is applied to electronic equipment, the chip system comprises one or more processors, characterized in that: The processor is configured to call computer instructions so as to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the method according to any one of claims 1 to 6 is executed.