losnoco / Cog

Cog - A Free and Open Source Audio Player for macOS 10.13+
https://cog.losno.co
GNU General Public License v2.0
700 stars 45 forks source link

High Energy Impact #326

Open ysmolski opened 2 years ago

ysmolski commented 2 years ago

High Energy impact when playing mp3 streams or mp3 in general. It grows gradually from 8-10 energy usage in the first 15 minutes to 20.0+ in next 15 minutes and then 30+ after that.

I use Earpods Pro and noticed if I remove them, playing stops, energy goes to ~5.0 and if I put them on again it suddenly goes from 8-10 before to ~15-16.

Before that I was using it on Intel CPU (10.14.X) and there was no such issues. If I run the same mp3 streams on VLC, energy impact is around 7-8 constantly.

I can provide debug info if needed. Just let me know. Thanks

**Version information:***

kode54 commented 2 years ago

Turn off positional audio in the menu that opens from the AirPods icon on the menu bar.

ysmolski commented 2 years ago

It was turned off before as the first thing.

Screenshot 2022-09-03 at 10 25 20

I am trying to listen to Cog without AirPods and energy usage is high too. ~17-20

Is there a way I can profile it somehow on my machine?

kode54 commented 2 years ago

Install Xcode, run the Instruments app, run the Timing module against Cog and only Cog. Probably not very helpful, though.

kode54 commented 2 years ago

Please try the new release once binaries are pushed. ee5231f567a354e9320ae1432695a30cea9de9c7 / 066ee806dca273a1bfe371ad86a58b13c27ab4f2 should alleviate some of the CPU usage when the window is not visible, if the visualization toolbar item or visualization popup are currently open but the window is obscured.

kode54 commented 1 year ago

Remove the visualization from the toolbar, or hide the window, and processing usage will drop significantly. Yes, apparently a lot of processing power is used up by having a 60fps SceneKit object just hanging out there in the window. I could also make the frame rate configurable and default it to something like 15fps like most other players do, while making the windowed one use a different frame rate as well. Frame rates are fully flexible.