Bug 261767 - audio/alsa-plugins: one of last updates breaks webrtc in www/chromium
Summary: audio/alsa-plugins: one of last updates breaks webrtc in www/chromium
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Hans Petter Selasky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-07 09:33 UTC by Oleh Hushchenkov
Modified: 2022-02-08 09:16 UTC (History)
3 users (show)

See Also:


Attachments
ALSA plugins patch (3.66 KB, patch)
2022-02-07 10:24 UTC, Hans Petter Selasky
no flags Details | Diff
ALSA plugins patch v2 (7.05 KB, patch)
2022-02-07 23:19 UTC, Hans Petter Selasky
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleh Hushchenkov 2022-02-07 09:33:06 UTC
With alsa-plugins-1.2.2_6 I can't use anymore any webrtc resources like google meet and microsoft teams.
Audio glitches and chromium writes a lot of errors:

[39732:100591:0205/184721.685503:ERROR:alsa_output.cc(657)] ALSA returned 20256 of 4096 frames available.
[39732:100591:0205/184721.727935:ERROR:alsa_output.cc(657)] ALSA returned 20256 of 4096 frames available.
[39732:100591:0205/184721.728218:ERROR:alsa_output.cc(657)] ALSA returned 20256 of 4096 frames available.
[39732:100591:0205/184721.770450:ERROR:alsa_output.cc(657)] ALSA returned 20256 of 4096 frames available.
[39732:100591:0205/184721.770637:ERROR:alsa_output.cc(657)] ALSA returned 20256 of 4096 frames available.
[39732:100591:0205/184721.813197:ERROR:alsa_output.cc(657)] ALSA returned 20288 of 4096 frames available.
[39732:100591:0205/184721.813445:ERROR:alsa_output.cc(657)] ALSA returned 20288 of 4096 frames available.
[39732:100591:0205/184721.855614:ERROR:alsa_output.cc(657)] ALSA returned 20288 of 4096 frames available.
[39732:100591:0205/184721.855878:ERROR:alsa_output.cc(657)] ALSA returned 20288 of 4096 frames available.
[39732:100591:0205/184721.899000:ERROR:alsa_output.cc(657)] ALSA returned 20288 of 4096 frames available.
[39732:100591:0205/184721.899095:ERROR:alsa_output.cc(657)] ALSA returned 20288 of 4096 frames available.
[39732:100591:0205/184721.940830:ERROR:alsa_output.cc(657)] ALSA returned 20288 of 4096 frames available.

When I rollback to alsa-plugins-1.2.2_3 webrtc works and no errors from chromium.
Comment 1 Hans Petter Selasky freebsd_committer freebsd_triage 2022-02-07 09:53:52 UTC
Can you use chrome with sndiod in the meanwhile?
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2022-02-07 09:54:02 UTC
Is this a custom build?
Comment 3 Hans Petter Selasky freebsd_committer freebsd_triage 2022-02-07 10:07:59 UTC
Can you share some information about what kind of audio device you are using?

--HPS
Comment 4 Oleh Hushchenkov 2022-02-07 10:09:58 UTC
(In reply to Hans Petter Selasky from comment #2)

Yes, this is chromium from ports tree with ALSA enabled.
Comment 5 Oleh Hushchenkov 2022-02-07 10:10:57 UTC
(In reply to Hans Petter Selasky from comment #3)
This is ThinkPad T440P laptop.

cat /dev/sndstat 
Installed devices:
pcm0: <Intel Haswell (HDMI/DP 8ch)> (play)
pcm1: <Realtek ALC292 (Analog 2.0+HP/2.0)> (play/rec) default
pcm2: <Realtek ALC292 (Left Analog Mic)> (rec)
No devices installed from userspace.
Comment 6 Oleh Hushchenkov 2022-02-07 10:13:33 UTC
(In reply to Hans Petter Selasky from comment #1)
I have no sndio installed and chromium built without sndio support.
Comment 7 Hans Petter Selasky freebsd_committer freebsd_triage 2022-02-07 10:24:14 UTC
Created attachment 231599 [details]
ALSA plugins patch

Can you test this patch? With the latest alsa-plugins port?
Comment 8 Oleh Hushchenkov 2022-02-07 10:50:39 UTC
(In reply to Hans Petter Selasky from comment #7)
With the patch almost the same.

Google meet:
[6607:114276:0207/124146.333440:ERROR:alsa_output.cc(657)] ALSA returned 5292 of 1764 frames available.
[6607:114276:0207/124146.333593:ERROR:alsa_output.cc(657)] ALSA returned 5292 of 1764 frames available.
[6607:114276:0207/124146.344133:ERROR:alsa_output.cc(657)] ALSA returned 5292 of 1764 frames available.
[6607:114276:0207/124146.344267:ERROR:alsa_output.cc(657)] ALSA returned 5292 of 1764 frames available.
[6607:114276:0207/124146.354369:ERROR:alsa_output.cc(657)] ALSA returned 5292 of 1764 frames available.
[6607:114276:0207/124146.354439:ERROR:alsa_output.cc(657)] ALSA returned 5292 of 1764 frames available.
[6607:114276:0207/124146.365253:ERROR:alsa_output.cc(657)] ALSA returned 5292 of 1764 frames available.

Skype web:
[6636:100392:0207/124623.729582:ERROR:alsa_output.cc(657)] ALSA returned 12064 of 4096 frames available.
[6636:100392:0207/124623.729749:ERROR:alsa_output.cc(657)] ALSA returned 12064 of 4096 frames available.
[6636:100392:0207/124623.772094:ERROR:alsa_output.cc(657)] ALSA returned 12096 of 4096 frames available.
[6636:100392:0207/124623.772259:ERROR:alsa_output.cc(657)] ALSA returned 12096 of 4096 frames available.
[6636:100392:0207/124623.815172:ERROR:alsa_output.cc(657)] ALSA returned 12064 of 4096 frames available.
[6636:100392:0207/124623.815753:ERROR:alsa_output.cc(657)] ALSA returned 12064 of 4096 frames available.
[6636:100392:0207/124623.857242:ERROR:alsa_output.cc(657)] ALSA returned 12096 of 4096 frames available.
[6636:100392:0207/124623.857384:ERROR:alsa_output.cc(657)] ALSA returned 12096 of 4096 frames available.
[6636:100392:0207/124623.900581:ERROR:alsa_output.cc(657)] ALSA returned 12064 of 4096 frames available.
[6636:100392:0207/124623.900720:ERROR:alsa_output.cc(657)] ALSA returned 12064 of 4096 frames available.
[6636:100392:0207/124623.942799:ERROR:alsa_output.cc(657)] ALSA returned 12096 of 4096 frames available.
[6636:100392:0207/124623.943068:ERROR:alsa_output.cc(657)] ALSA returned 12096 of 4096 frames available.
Comment 9 Hans Petter Selasky freebsd_committer freebsd_triage 2022-02-07 23:19:23 UTC
Created attachment 231623 [details]
ALSA plugins patch v2

Please try this updated patch.

Thank you!
Comment 10 Oleh Hushchenkov 2022-02-08 09:07:41 UTC
(In reply to Hans Petter Selasky from comment #9)
Hi Hans,

The second patch works.

Thank you for the quick fix and all your efforts on FreeBSD audio and USB support.
Comment 11 Hans Petter Selasky freebsd_committer freebsd_triage 2022-02-08 09:16:27 UTC
Thank you for testing!
Comment 12 commit-hook freebsd_committer freebsd_triage 2022-02-08 09:16:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e66a5ac7ef614d579dcb68d7213b87fec617eee7

commit e66a5ac7ef614d579dcb68d7213b87fec617eee7
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-02-07 23:23:21 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-02-08 09:15:40 +0000

    audio/alsa-plugins: Fix more oss_pointer() calculation bugs.

    Correctly set the water level based on min_avail to avoid infinite
    polling loops.

    Applications tested: chrome, musescore, aplay and arecord .

    PR:             261767
    Approved by:    pi (implicit)

 audio/alsa-plugins/Makefile                   |   2 +-
 audio/alsa-plugins/files/patch-oss_pcm__oss.c | 129 +++++++++++++++-----------
 2 files changed, 76 insertions(+), 55 deletions(-)