Git Product home page Git Product logo

Comments (10)

i-rinat avatar i-rinat commented on August 25, 2024 1

Also, runtime power management may interfere. You can use powertop utility to find out whenever power management is enabled for various devices. It's in "Tunables" tab.

If PM was enabled, try to disable it and test again.

from apulse.

i-rinat avatar i-rinat commented on August 25, 2024

This will be hard to reproduce (for me), as I tend to do the opposite: close and start browser quite often.

By the way, when audio glitches appear, do they appear if you run some other audio application too? In other words, if you experience audio stuttering, try to mute all Firefox tabs, and start audio player. Does it play audio fine? It's also worth to try run audio player through both ALSA and apulse, and compare results. Perhaps, there is something wrong in the way apulse handles audio.

from apulse.

trlkly avatar trlkly commented on August 25, 2024

Sorry it took me so long, but it took a while for the problem to crop up again.

There are no problems with ALSA using VLC. There are problems playing audio in any other tab. And powertop only reports on my CPU, where I've actually turned off throttling due to other issues. That said, it seems that Firefox's content process is using up more CPU on idle than I would expect. It seems to be maxing out one of my cores.

Since restarting the content process fixes it, I don't think my CPU is being throttled down. It may be a runaway thread in Firefox. I didn't have them back when I was using the ALSA backend, but that was a different version of Firefox.

Since I have no real need to use my computer right now, I can try to leave it in its current condition, so I can test anything else you want to offer.

That said, I am aware the problem may have nothing to do with apulse. I do have a similar problem on my Windows computer sometimes. Though it seems to happen without any cores being maxed out.

from apulse.

i-rinat avatar i-rinat commented on August 25, 2024

so I can test anything else you want to offer

Sorry, I have no ideas left. I could guess there are buffer underruns/overruns, they sound like clicks or stuttering. But that hypothesis doesn't explain why one need to keep application running for so long to make the bug appear.

Recently, I've added some code that handles x-runs and prevents them: ec575ce...86f0841. Main part of the fix is the code which calculates buffer_size. It turned out that on the current machine I have a limit of 940 frames. Periods can't be shorter than that. So if application asks for 300 frames period and 1200 frames buffer, which is completely fine with buffer having four periods, it gets 940 frames period and 1200 frames buffer. That made buffer x-run happen almost immediately.

Now buffer sizes are enlarged as needed. So it's worth to try v0.1.10, which have changes mentioned above.

from apulse.

h1z1 avatar h1z1 commented on August 25, 2024

What soundcard / driver are you using? What kernel version? What is firefox actually doing? (strace or gdb backtrace). And, by "ALSA works using VLC", do you mean playing a file for 12 hours or leaving it running ?

Could very well be the sound card is going into powersave and not coming out properly. Off the top of my head I don't recall if VLC leaves the card open while not in use. Firefox should be closing it when not in use specifically to allow power save.

from apulse.

trlkly avatar trlkly commented on August 25, 2024

from apulse.

Alexander-- avatar Alexander-- commented on August 25, 2024

@trlkly have you had a look at powertop? The corresponding option is "Enable Audio codec power management" ("Bad" means, that power optimisations are disabled). If you have a USB audio card, have a glance at USB powersaving options too.

from apulse.

trlkly avatar trlkly commented on August 25, 2024

from apulse.

i-rinat avatar i-rinat commented on August 25, 2024

Firefox's content process is constantly pegging one of my CPU cores, even when I'm not playing audio

If I had similar issue, first step was to try to run perf top first while running distribution-supplied Firefox version, to find out where CPU time is spent. Next step is to try the same with Firefox built from source with debug information enabled. That could reduce scope of suspected code.

from apulse.

trlkly avatar trlkly commented on August 25, 2024

I've not encountered this for a while, so I'm going to tentatively close it.

If I know my luck, if it's gonna come back, it will come up now that I've done so. So I might as well hurry it along.

from apulse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.