Bug 245321 - audio/alsa-lib: (and others) update to 1.2.2
Summary: audio/alsa-lib: (and others) update to 1.2.2
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: Charlie Li
Depends on:
Blocks: 255348
  Show dependency treegraph
Reported: 2020-04-03 16:22 UTC by Greg V
Modified: 2021-05-12 14:45 UTC (History)
6 users (show)

See Also:

alsa.patch (41.02 KB, patch)
2020-04-03 16:22 UTC, Greg V
no flags Details | Diff
alsa.patch v2 (41.63 KB, patch)
2020-09-29 17:42 UTC, Greg V
no flags Details | Diff
updated patch (46.17 KB, patch)
2021-03-12 06:26 UTC, Steve Wills
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Greg V 2020-04-03 16:22:08 UTC
Created attachment 213022 [details]

- Update to latest version
- Enable Pulseaudio plugin by default (pulse port doesn't enable ALSA by default, so no circular dependencies in default package builds here)
- I can take maintainership I guess.. (but if anyone else wants to, go for it)
Comment 1 Jan Beich freebsd_committer 2020-04-03 19:11:31 UTC
Comment on attachment 213022 [details]

$ poudriere testport -j 113i386 audio/alsa-plugins
====> Running Q/A tests (stage-qa)
Warning: Bad symlink '/usr/local/etc/alsa/conf.d/50-arcam-av-ctl.conf' pointing to an absolute pathname '/usr/local/share/alsa/alsa.conf.d/50-arcam-av-ctl.conf'
Warning: Bad symlink '/usr/local/etc/alsa/conf.d/60-vdownmix.conf' pointing to an absolute pathname '/usr/local/share/alsa/alsa.conf.d/60-vdownmix.conf'
Warning: Bad symlink '/usr/local/etc/alsa/conf.d/50-pulseaudio.conf' pointing to an absolute pathname '/usr/local/share/alsa/alsa.conf.d/50-pulseaudio.conf'
Warning: Bad symlink '/usr/local/etc/alsa/conf.d/60-upmix.conf' pointing to an absolute pathname '/usr/local/share/alsa/alsa.conf.d/60-upmix.conf'
Warning: Bad symlink '/usr/local/etc/alsa/conf.d/50-oss.conf' pointing to an absolute pathname '/usr/local/share/alsa/alsa.conf.d/50-oss.conf'
Warning: Bad symlink '/usr/local/etc/alsa/conf.d/98-usb-stream.conf' pointing to an absolute pathname '/usr/local/share/alsa/alsa.conf.d/98-usb-stream.conf'
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: etc/alsa/conf.d/50-arcam-av-ctl.conf
Error: Orphaned: etc/alsa/conf.d/50-oss.conf
Error: Orphaned: etc/alsa/conf.d/50-pulseaudio.conf
Error: Orphaned: etc/alsa/conf.d/60-upmix.conf
Error: Orphaned: etc/alsa/conf.d/60-vdownmix.conf
Error: Orphaned: etc/alsa/conf.d/98-usb-stream.conf
Error: Orphaned: etc/alsa/conf.d/99-pulseaudio-default.conf.example
Error: Orphaned: share/alsa/alsa.conf.d/50-arcam-av-ctl.conf
Error: Orphaned: share/alsa/alsa.conf.d/50-oss.conf
Error: Orphaned: share/alsa/alsa.conf.d/60-upmix.conf
Error: Orphaned: share/alsa/alsa.conf.d/60-vdownmix.conf
Error: Orphaned: share/alsa/alsa.conf.d/98-usb-stream.conf
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.
*** Error code 1

$ poudriere testport -j 113i386 audio/alsa-utils
[00:00:00] Warning: (audio/alsa-utils): Error: audio/alsa-utils depends on nonexistent origin 'BAT_CONFIGURE_ENABLE=bat'; Please contact maintainer of the port to fix this.
monitor.c:26:10: fatal error: 'sys/inotify.h' file not found
#include <sys/inotify.h>
Comment 2 Greg V 2020-04-03 20:10:35 UTC
> Checking for items in STAGEDIR missing from pkg-plist

Is there a good way to ignore this? ${RM} the files?

> nonexistent origin 'BAT_CONFIGURE_ENABLE=bat'

lol, fail with the backslash, sorry

> fatal error: 'sys/inotify.h' file not found

How?? inotify is in LIB_DEPENDS and USES=localbase is present.. o_0
Comment 3 Jan Beich freebsd_committer 2020-04-03 22:28:59 UTC
(In reply to Greg V from comment #2)
> Is there a good way to ignore this? ${RM} the files?

Patching the source or marking undesired files with @comment in pkg-plist.

> How?? inotify is in LIB_DEPENDS and USES=localbase is present.. o_0

Sorry, I had bug 235240 applied which requires using pkg-config for libinotify.
Comment 4 Greg V 2020-09-29 17:42:15 UTC
Created attachment 218412 [details]
alsa.patch v2

Rebased, fixed aforementioned issues (hopefully did the plist correctly)
Comment 5 Steve Wills freebsd_committer 2021-03-12 06:26:05 UTC
Created attachment 223196 [details]
updated patch

I updated this a bit, fixed a few minor things and cleaned it up. If it looks OK and you're still willing to take maintainer-ship, I'll commit it.
Comment 6 Gleb Popov freebsd_committer 2021-04-26 14:48:37 UTC
What is blocking this? Can we get this in?
Comment 7 Oleh Hushchenkov 2021-05-11 10:49:29 UTC
With this patch I finally got working microphone in chromium with alsa backend. Tested in several online microphone testers, google meet and google duo. Audio calls in telegram-desktop is also working fine. Can it be committed.
Comment 8 commit-hook freebsd_committer 2021-05-11 16:54:55 UTC
A commit in branch main references this bug:

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

commit 44c14328c08e0ba92855367dba48ad9e06dc4b25
Author:     Greg V <greg@unrelenting.technology>
AuthorDate: 2021-05-11 16:49:32 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2021-05-11 16:53:01 +0000

    audio/alsa-lib, audio/alsa-plugins, audio/alsa-utils: Update to 1.2.2

    PR:             245321
    Reviewed by:    swills
    Tested by:      Oleh Hushchenkov <o.hushchenkov@gmail.com>

 audio/alsa-lib/Makefile                            |  27 +-
 audio/alsa-lib/distinfo                            |   5 +-
 audio/alsa-lib/files/linux/types.h                 |  10 +
 .../files/patch-include_alsa-symbols.h (gone)      |  59 ---
 .../patch-modules_mixer_simple_python.c (gone)     | 565 ---------------------
 audio/alsa-lib/files/patch-src_async.c             |   6 +-
 .../alsa-lib/files/patch-src_conf_alsa.conf (new)  |  13 +
 audio/alsa-lib/pkg-plist                           |  85 +---
 audio/alsa-plugins/Makefile                        |  39 +-
 audio/alsa-plugins/distinfo                        |   5 +-
 audio/alsa-plugins/pkg-plist                       |  13 +-
 audio/alsa-utils/Makefile                          |  76 +--
 audio/alsa-utils/distinfo                          |   5 +-
 .../files/patch-alsa-info_alsa-info.sh.1 (new)     |  11 +
 .../files/patch-alsaconf_alsaconf.8 (new)          |  11 +
 .../files/patch-alsaconf_alsaconf.fr.8 (new)       |  11 +
 .../files/patch-alsactl_Makefile.in (new)          |  11 +
 .../files/patch-alsactl_alsactl__init.xml (new)    |  24 +
 .../files/patch-alsamixer_volume__mapping.c (gone) |  11 -
 audio/alsa-utils/files/patch-amidi_amidi.1 (new)   |  15 +
 audio/alsa-utils/files/patch-aplay_aplay.c         |  18 +-
 ...atch-speaker-test_samples_sample__map.csv (new) |   7 +
 .../files/patch-speaker-test_speaker-test.1 (new)  |  11 +
 .../files/patch-utils_alsa-utils.spec.in (new)     |  11 +
 audio/alsa-utils/pkg-plist                         |  10 +-
 25 files changed, 261 insertions(+), 798 deletions(-)
Comment 9 Gleb Popov freebsd_committer 2021-05-11 16:57:28 UTC
Committed, thanks everyone involved.

Greg, I left the MAINTAINER field set to "ports@FreeBSD.org", because you didn't indicate that you're willing to maintain this port. If you want to pick it up, ping me and I'll commit the change.
Comment 10 Charlie Li freebsd_committer 2021-05-11 20:53:06 UTC
audio/alsa-plugins fails to package with FFMPEG enabled, as none of the files exist anymore and the relevant configure option --enable-avcodec no longer exists.

Additionally, in that same port, there is a code path that references byteswap.h, which is a glibc-specific header.
Comment 11 Charlie Li freebsd_committer 2021-05-11 21:32:19 UTC
(In reply to Charlie Li from comment #10)
Ignore the byteswap.h noise, audio/alsa-plugins is a sneaky slave port of audio/alsa-lib and is reflected when using an overlay.

However, the SAMPLERATE option now installs two .conf files, in addition to FFMPEG removal:

--- audio/alsa-plugins/Makefile
+++ audio/alsa-plugins/Makefile
@@ -21,7 +21,7 @@ INSTALL_TARGET=       install-strip
 CPPFLAGS+=     -I${.CURDIR}/../alsa-lib/files

 OPTIONS_SUB=           yes

@@ -41,9 +41,6 @@ JACK_LIB_DEPENDS=     libjack.so:audio/jack

-FFMPEG_LIB_DEPENDS=            libavcodec.so:multimedia/ffmpeg
 PULSEAUDIO_LIB_DEPENDS=                libpulse.so:audio/pulseaudio

diff --git audio/alsa-plugins/pkg-plist audio/alsa-plugins/pkg-plist
index 4847ffc641be..6025845819fb 100644
--- audio/alsa-plugins/pkg-plist
+++ audio/alsa-plugins/pkg-plist
@@ -1,3 +1,4 @@
 @comment etc/alsa/conf.d/50-arcam-av-ctl.conf
 @comment etc/alsa/conf.d/50-oss.conf
 @comment etc/alsa/conf.d/50-pulseaudio.conf
@@ -13,8 +14,6 @@ lib/alsa-lib/libasound_module_ctl_oss.la
@@ -29,12 +28,6 @@ lib/alsa-lib/libasound_module_pcm_usb_stream.la
@@ -45,6 +38,7 @@ lib/alsa-lib/libasound_module_pcm_vdownmix.so
 @comment share/alsa/alsa.conf.d/50-arcam-av-ctl.conf
 @comment share/alsa/alsa.conf.d/50-oss.conf
Comment 12 Charlie Li freebsd_committer 2021-05-11 23:40:13 UTC
Re-opening for this and another issue that leres@ reported: may need to add a USES=gettext-tools to audio/alsa-utils to account for a missing autopoint when NLS is disabled. Phab reviews to come.
Comment 13 Charlie Li freebsd_committer 2021-05-12 04:02:05 UTC
(In reply to Charlie Li from comment #12)
review D30222 and review D30223
Comment 14 Barbara Guida freebsd_committer 2021-05-12 13:50:04 UTC
(In reply to Charlie Li from comment #13)
Building this port from ports, ffmpeg get autodetected if installed.

Running ./configure --help in WRKSRC I can see:
  --disable-libav         Do not build plugins depending on libav/ffmpeg

and running make configure:
  Libav/ffmpeg config:
    LIBAV_CFLAGS:   -I/usr/local/include 
    LIBAV_LIBS:     -L/usr/local/lib -lavcodec -lavutil -lavresample  /  / 
  Libav A52 plugin:   yes
  Libav rate plugin:  yes

So IMHO FFMPEG options should be kept and Makefile changed to something like:

Also pkg-plist should be adjusted accordingly: files under lib/alsa-lib have been renamed from libasound_module_rate_lavcrate* to libasound_module_rate_lavcate* (a "r" has been dropped).

I'm busy at work, I'll post a diff that works for me as soon as I can.
Comment 15 Charlie Li freebsd_committer 2021-05-12 14:07:22 UTC
(In reply to Barbara Guida from comment #14)
I noticed that too. arrowd@ suggested that the configure option is now --disable-libav.
Comment 16 Charlie Li freebsd_committer 2021-05-12 14:24:59 UTC
phab has been re-rolled, FFMPEG should work now.
Comment 17 commit-hook freebsd_committer 2021-05-12 14:31:55 UTC
A commit in branch main references this bug:

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

commit ef51954501992327c9a56137db0526aa538e7fa4
Author:     Charlie Li <vishwin@FreeBSD.org>
AuthorDate: 2021-05-12 03:47:04 +0000
Commit:     Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2021-05-12 14:29:04 +0000

    audio/alsa-utils: fix build with NLS disabled

    The configure step requires `autopoint`, which devel/gettext-tools
    provides. While here, split the deprecated USES=gettext into their
    appropriate constituents.

    Reported by: leres
    PR: 245321
    Approved by: arrowd (mentor)
    Differential Revision: https://reviews.freebsd.org/D30222

 audio/alsa-utils/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Comment 18 commit-hook freebsd_committer 2021-05-12 14:41:58 UTC
A commit in branch main references this bug:

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

commit 933747467c06ec9735b35fe31879bb6f914d33ae
Author:     Charlie Li <vishwin@FreeBSD.org>
AuthorDate: 2021-05-12 03:39:59 +0000
Commit:     Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2021-05-12 14:40:12 +0000

    audio/alsa-plugins: fix non-default OPTIONS

    - Update configure option and plist for FFMPEG
    - Add two missing files with SAMPLERATE

    PR: 245321
    Approved by: arrowd (mentor)
    Differential Revision: https://reviews.freebsd.org/D30223

 audio/alsa-plugins/Makefile  |  6 +++---
 audio/alsa-plugins/pkg-plist | 18 ++++++++++++------
 2 files changed, 15 insertions(+), 9 deletions(-)
Comment 19 Charlie Li freebsd_committer 2021-05-12 14:45:20 UTC
Should be good to go again.