pixelbook-linux icon indicating copy to clipboard operation
pixelbook-linux copied to clipboard

cras eating a lot of CPU

Open flantel opened this issue 6 years ago • 4 comments

I notice that the cras process continually uses ~25% CPU, even when no audio is being used.

strace shows it doing nothing more than polling. Any idea why this might be?

flantel avatar May 26 '19 17:05 flantel

@flantel I'm also seeing this as well. Might try and get the updates from a more recent branch of cras pulled in and see if I can get it working. At first pass there have been some substantial changes which on a simple checkout and build are breaking.

daemonp avatar Dec 19 '19 08:12 daemonp

@daemonp Great, god luck!

flantel avatar Dec 19 '19 14:12 flantel

@daemonp cras doesn't like gcc9 I have discovered in the past, while is OK compiling on gcc8.

flantel avatar Dec 19 '19 15:12 flantel

There is a secondary cras thread (you can find the pid using tree view of htop) that seems to be going crazy. Strace -p on that thread shows a lot of activity:

strace: Process 727 attached ppoll([{fd=7, events=POLLIN}], 1, {tv_sec=0, tv_nsec=15658212}, NULL, 8) = 0 (Timeout) clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=968429276}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=968568089}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=968693214}) = 0 ioctl(24, SNDRV_PCM_IOCTL_DELAY, 0x7f451b749c20) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=968952679}) = 0 poll([{fd=17, events=POLLIN}], 1, 0) = 0 (Timeout) ioctl(25, SNDRV_PCM_IOCTL_HWSYNC, 0x3a980) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=969256689}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=969350108}) = 0 ioctl(25, SNDRV_PCM_IOCTL_DELAY, 0x7f451b749bf0) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=969539028}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=969631605}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=969778149}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=969874428}) = 0 write(17, "\1\0\0\0\0\0\0\0N\4\0\0", 12) = 12 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=970291813}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=970398450}) = 0 ioctl(25, SNDRV_PCM_IOCTL_HWSYNC, 0x3a980) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=970593024}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=970725400}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=970827116}) = 0 ioctl(24, SNDRV_PCM_IOCTL_HWSYNC, 0x3a980) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=971023695}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=971117146}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=971211565}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=971386072}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=971482421}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=971626276}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=971908331}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=972008255}) = 0 ioctl(24, SNDRV_PCM_IOCTL_HWSYNC, 0x3a980) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=972199157}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=972296890}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=972389456}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=972482760}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=972576666}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=972669939}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=972792253}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=972885302}) = 0 ppoll([{fd=7, events=POLLIN}], 1, {tv_sec=0, tv_nsec=0}, NULL, 8) = 0 (Timeout) clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=973090081}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=973182892}) = 0 clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=43496, tv_nsec=973276301}) = 0

David-S-Morgan avatar Apr 07 '20 15:04 David-S-Morgan