LINUX.ORG.RU

История изменений

Исправление Chaser_Andrey, (текущая версия) :

Старая цитата:

PulseAudio uses a high quality resampling algorithm by default. ALSA supports only one, a simple linear resampler. If, like most people, you can’t hear a difference anyways, you can configure PulseAudio to use a linear algorithm too by adding “resample-method = src-linear” in /etc/pulse/daemon.conf. CPU usage will drop from 10% to 1%!

И более новая инфа из вики генты:

Re-sampling can require quite a lot of computational power, PA defaults are rather conservative but in certain cases can still take a significant toll, in such cases edit /etc/pulse/daemon.conf and consider changing resample-method to something less CPU intensive, default-sample-format and default-sample-rate can also affect CPU utilization with higher bit-depth and larger difference in sample-rate generally needing more resources (e.g. re-sampling 44.1 kHz to 48 kHz is faster than re-sampling either to 192 kHz). Since re-sampling is done per each channel per input, channel configuration and number of applications can affect performance as well.

Starting with version 7.0 there is also soxr resamplers made available by enabling the sox USE flag. In particular resample-method = soxr-mq should provide acceptable quality while even the higher quality and hence slower soxr-hq is still cheaper than the default speex-float-1. But be warned that the soxr resamplers have roughly 5-20 times higher latency than speex-float, in terms of time the worst case for soxr-mq/hq can be as high as 20 ms while soxr-vhq latency can in few specific setups reach over 27 ms. In terms of feeling 20 ms can range from unnoticeable to irritating depending on person and use case (the usual PA latency's lower bound is around 20-25 ms and more commonly often around 70-90 ms, for comparison).

Note: Using a version of PA with Orc support can noticeably decrease CPU usage, too. Also PA has the ability, if certain conditions are met, to automatically switch sinks between common sampling rates, this effectively can avoid some re-sampling.

Исходная версия Chaser_Andrey, :

Старая цитата:

PulseAudio uses a high quality resampling algorithm by default. ALSA supports only one, a simple linear resampler. If, like most people, you can’t hear a difference anyways, you can configure PulseAudio to use a linear algorithm too by adding “resample-method = src-linear” in /etc/pulse/daemon.conf. CPU usage will drop from 10% to 1%!

И более новая инфа из вики генты:

Re-sampling can require quite a lot of computational power, PA defaults are rather conservative but in certain cases can still take a significant toll, in such cases edit /etc/pulse/daemon.conf and consider changing resample-method to something less CPU intensive, default-sample-format and default-sample-rate can also affect CPU utilization with higher bit-depth and larger difference in sample-rate generally needing more resources (e.g. re-sampling 44.1 kHz to 48 kHz is faster than re-sampling either to 192 kHz). Since re-sampling is done per each channel per input, channel configuration and number of applications can affect performance as well.

Starting with version 7.0 there is also soxr resamplers made available by enabling the sox USE flag. In particular resample-method = soxr-mq should provide acceptable quality while even the higher quality and hence slower soxr-hq is still cheaper than the default speex-float-1. But be warned that the soxr resamplers have roughly 5-20 times higher latency than speex-float, in terms of time the worst case for soxr-mq/hq can be as high as 20 ms while soxr-vhq latency can in few specific setups reach over 27 ms. In terms of feeling 20 ms can range from unnoticeable to irritating depending on person and use case (the usual PA latency's lower bound is around 20-25 ms and more commonly often around 70-90 ms, for comparison).

Note: Using a version of PA with Orc support can noticeably decrease CPU usage, too. Also PA has the ability, if certain conditions are met, to automatically switch sinks between common sampling rates, this effectively can avoid some re-sampling.