از 27 مارس 2025، توصیه می کنیم از android-latest-release
به جای aosp-main
برای ساختن و کمک به AOSP استفاده کنید. برای اطلاعات بیشتر، به تغییرات AOSP مراجعه کنید.
گرم کردن صدا
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
گرم کردن صدا زمانی است که طول می کشد تا مدار تقویت کننده صدا در دستگاه شما به طور کامل تغذیه شود و به حالت عادی کار کند. عوامل اصلی در زمان گرم کردن صدا، مدیریت توان و هرگونه منطق "de-pop" برای تثبیت مدار است.
این سند نحوه اندازه گیری زمان گرم کردن صدا و راه های ممکن برای کاهش زمان گرم کردن را شرح می دهد.
گرم شدن خروجی را اندازه گیری کنید
رشته FastMixer AudioFlinger به طور خودکار گرم شدن خروجی را اندازه گیری می کند و آن را به عنوان بخشی از خروجی فرمان dumpsys media.audio_flinger
گزارش می دهد. در زمان گرم کردن، FastMixer به طور مکرر write()
را فراخوانی می کند تا زمانی که زمان بین دو write()
مقدار مورد انتظار باشد. FastMixer با دیدن مدت زمانی که یک لایه انتزاعی سخت افزاری (HAL) برای تثبیت شدن طول می write()
گرم شدن صدا را تعیین می کند.
برای اندازه گیری گرم شدن صدا، این مراحل را برای بلندگوی داخلی و هدفون سیمی و در زمان های مختلف پس از بوت شدن دنبال کنید. زمان گرم کردن معمولاً برای هر دستگاه خروجی و درست پس از راهاندازی دستگاه متفاوت است:
- مطمئن شوید که FastMixer فعال است.
- با انتخاب تنظیمات > صدا > صداهای لمسی در دستگاه، صداهای لمسی را فعال کنید.
- مطمئن شوید که صدا برای حداقل سه ثانیه خاموش است. پنج ثانیه یا بیشتر بهتر است، زیرا خود سخت افزار ممکن است منطق قدرت خود را فراتر از سه ثانیه ای که AudioFlinger دارد، داشته باشد.
- صفحه اصلی را فشار دهید، و باید صدای کلیک را بشنوید.
- برای دریافت گرمایش اندازه گیری شده دستور زیر را اجرا کنید:
adb shell dumpsys media.audio_flinger | grep measuredWarmup
شما باید خروجی را مانند این ببینید:
sampleRate=44100 frameCount=256 measuredWarmup=X ms, warmupCycles=X
measuredWarmup=X
تعداد میلیثانیهای است که برای تکمیل اولین مجموعه HAL write()
طول کشید.
warmupCycles=X
تعداد درخواستهای نوشتن HAL است که طول میکشد تا زمان اجرای write()
با آنچه مورد انتظار است مطابقت داشته باشد.
- پنج اندازه گیری انجام دهید و همه آنها را به همراه میانگین ثبت کنید. اگر همه آنها تقریباً یکسان نیستند، احتمالاً اندازه گیری نادرست است. به عنوان مثال، اگر پس از خاموش شدن صدا به اندازه کافی منتظر نمانید، زمان گرم شدن کمتری نسبت به مقدار متوسط خواهید دید.
در حال حاضر هیچ ابزاری برای اندازه گیری گرم شدن ورودی صوتی ارائه نشده است. با این حال، زمان گرم کردن ورودی را می توان با مشاهده زمان لازم برای بازگشت startRecording() تخمین زد.
زمان گرم کردن را کاهش دهید
زمان گرم کردن را معمولاً می توان با ترکیبی از موارد زیر کاهش داد:
- طراحی مدار خوب
- تأخیرهای زمانی دقیق در درایور دستگاه هسته
- انجام عملیات گرم کردن مستقل به طور همزمان و نه متوالی
- روشن گذاشتن مدارها یا عدم پیکربندی مجدد ساعت (مصرف برق بیکار را افزایش می دهد)
- ذخیره پارامترهای محاسبه شده
با این حال، مراقب بهینه سازی بیش از حد باشید. ممکن است متوجه شوید که باید بین زمان کم گرم شدن در مقابل عدم وجود پاپ در انتقال قدرت، معاوضه کنید.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-03-26 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-03-26 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Audio warmup is the time it takes for the audio amplifier circuit in your device to\nbe fully powered and reach its normal operation state. The major contributors\nto audio warmup time are power management and any \"de-pop\" logic to stabilize\nthe circuit.\n\nThis document describes how to measure audio warmup time and possible ways to decrease\nwarmup time.\n\nMeasure output warmup\n---------------------\n\n\nAudioFlinger's FastMixer thread automatically measures output warmup\nand reports it as part of the output of the `dumpsys media.audio_flinger` command.\nAt warmup, FastMixer calls `write()`\nrepeatedly until the time between two `write()`s is the amount expected.\nFastMixer determines audio warmup by seeing how long a Hardware Abstraction\nLayer (HAL) `write()` takes to stabilize.\n\nTo measure audio warmup, follow these steps for the built-in speaker and wired headphones\nand at different times after booting. Warmup times are usually different for each output device\nand right after booting the device:\n\n1. Ensure that FastMixer is enabled.\n2. Enable touch sounds by selecting **Settings \\\u003e Sound \\\u003e Touch sounds** on the device.\n3. Ensure that audio has been off for at least three seconds. Five seconds or more is better, because the hardware itself might have its own power logic beyond the three seconds that AudioFlinger has.\n4. Press Home, and you should hear a click sound.\n5. Run the following command to receive the measured warmup: \n\n ```\n adb shell dumpsys media.audio_flinger | grep measuredWarmup\n ```\n\n\n You should see output like this: \n\n ```\n sampleRate=44100 frameCount=256 measuredWarmup=X ms, warmupCycles=X\n ```\n\n\n The `measuredWarmup=X` is X number of milliseconds\n it took for the first set of HAL `write()`s to complete.\n\n\n The `warmupCycles=X` is how many HAL write requests it took\n until the execution time of `write()` matches what is expected.\n6. Take five measurements and record them all, as well as the mean. If they are not all approximately the same, then it's likely that a measurement is incorrect. For example, if you don't wait long enough after the audio has been off, you will see a lower warmup time than the mean value.\n\nMeasure input warmup\n--------------------\n\n\nThere are currently no tools provided for measuring audio input warmup.\nHowever, input warmup time can be estimated by observing\nthe time required for [startRecording()](http://developer.android.com/reference/android/media/AudioRecord.html#startRecording())\nto return.\n\nReduce warmup time\n------------------\n\n\nWarmup time can usually be reduced by a combination of:\n\n- Good circuit design\n- Accurate time delays in kernel device driver\n- Performing independent warmup operations concurrently rather than sequentially\n- Leaving circuits powered on or not reconfiguring clocks (increases idle power consumption)\n- Caching computed parameters\n\n\nHowever, beware of excessive optimization. You may find that you\nneed to tradeoff between low warmup time versus\nlack of popping at power transitions."]]