| Summary: | ALSA: excessive IO causes high CPU usage | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Paul Cercueil <paul> |
| Component: | audio | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | HG 1.2 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Attachments: | Patch to fix the issue | ||
Generally we don't mess with SDL 1.2, but this patch was straightforward enough that I've applied it to revision control here: https://hg.libsdl.org/SDL/rev/9c0fc6e28c5e --ryan. Does the default/2.0 branch not need this change? |
Created attachment 4157 [details] Patch to fix the issue Quote from the patch: "On GCW Zero jz4770 platform, I saw higher than usual CPU usage when running a more recent kernel (4.xx series versus 3.xx). Upon investigation, it was found that the ALSA pcm file was not blocking as it should. This resulted in ~30-50,000 system calls a second that were unnecesary. After adjusting the order in which SDL requests its pcm blocking mode, the number of syscalls a second has dropped to a much smaller figure, < 1,000/sec if I recall correctly. CPU usage also dropped by ~5%."