Skip to content

Volume component signal overflow with extreme levels #416

Closed

Description

@juimonen

There's mild crackling noise coming from volume component if volume levels are at maximum and incoming signal has very high levels (has to peak at max sample values). This is very "pathological" use case but might actually happen, I was getting this with pcm ripped from CD and running through sox conversion to 48kHz (which clipped couple of very high level samples). Also able to get it with a sine sweep maxed to 0dB. From recorded pcm you can see that there are couple of very sharp transitions from positive to negative -> overflow.

Activity

  1. mengdonglin commented on Sep 30, 2018

    @mengdonglin
    Collaborator

    @juimonen Could you add the labels for the platform and branch on which you observe the bug? Thanks!

  2. juimonen commented on Sep 30, 2018

    @juimonen
    Author

    I saw this with up2 and master branch. However I think this will manifest in all configurations, but I have not tested all of them. It could be a certain "version" of the volume processing function (like some 24 bit to 32 bit) but I could not find/fix it yet because trace went berserk...

  3. lgirdwood commented on Oct 1, 2018

    @lgirdwood
    Member

    @singalsu any thoughts on this one ?

  4. singalsu commented on Oct 1, 2018

    @singalsu
    Collaborator

    Yes, I've heard this noise too. There's rattle with highest volume and it goes away with next lower step. The volume mode in the test pipeline is 32->24. I need to test if there's difference in gcc and/or xt-xcc compiled volume since they use a different gain algo core. We can debug this now when we got trace to work again.

  5. singalsu commented on Nov 1, 2018

    @singalsu
    Collaborator

    I'll start working with debugging this. I was just able to reproduce it and confirmed that this happens with gcc build and 32->24 volume mode. It doesn't happen with 16->24 and 24->24.

  6. singalsu commented on Nov 2, 2018

    @singalsu
    Collaborator

    Confirmed the bug and made a fix, PR to appear soon. I need to review other conversions for similar issue. The q_multsr_sat_32x32() function ensures proper saturation to 32 bits but if the output of volume is 24 bits the result may be still be an overflow. Need to instead calculate 32 bit result and shift right by 8 to get a properly saturated 24 bit sample.

    snd_volume_rattle

  7. singalsu commented on Nov 2, 2018

    @singalsu
    Collaborator

    The bug fix is in PR #528. The test content that triggered this is a loud Van Halen song and an EQ response that has a boost at mid frequencies. Since the issue disappeared by adjusting volume down it was clear that issue was in volume (pipeline host -> EQ -> volume -> DAI). I added a wrap check trace output code into a volume that confirmed it. With the patch applied I could no more hear the issue with the same content.

    @tlauda I've also checked that the HiFi3 version of volume does not have this issue. There was need to fix only the generic C version.

  8. mengdonglin commented on Nov 19, 2018

    @mengdonglin
    Collaborator

    @juimonen Could you help to check if this issue is fixed by PR #528 on your side? If yes, please help to close the issue. Thanks!

  9. singalsu commented on Nov 19, 2018

    @singalsu
    Collaborator

    I've verified this. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

APLApplies to Apollolake platformP2Critical bugs or normal featuresbugSomething isn't working as expected

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions