Bug 272004 - multimedia/pipewire: unbreak audio with default config
Summary: multimedia/pipewire: unbreak audio with default config
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: Jan Beich
URL: https://gitlab.freedesktop.org/pipewi...
Keywords:
Depends on: 272337
Blocks: 280505
  Show dependency treegraph
 
Reported: 2023-06-15 03:57 UTC by Jan Beich
Modified: 2024-08-06 20:55 UTC (History)
1 user (show)

See Also:
arrowd: maintainer-feedback+
jbeich: merge-quarterly+


Attachments
v1 (apply via "git am") (3.83 KB, patch)
2023-06-15 03:57 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2023-06-15 03:57:29 UTC
Created attachment 242783 [details]
v1 (apply via "git am")

FreeBSD kernel doesn't support ALSA, so there're no "hw" devices, only plugins. alsa-lib provides default config to map /dev/dsp to pcm.default using "oss" plugin. Let's make pipewire use it.

Based on bug 255348. I didn't test planar vs. interleaved samples but bug 184006 should handle float to integer conversion.

$ mpv --no-video --ao=pipewire --msg-level=ao=v https://feeds.fireside.fm/bsdnow/rss
[...]
[ao] Trying audio driver 'pipewire'
[ao/pipewire] requested format: 48000 Hz, stereo channels, floatp
[ao/pipewire] Headers version: 0.3.62
[ao/pipewire] Library version: 0.3.62
[ao/pipewire] Core user: foo
[ao/pipewire] Core host: 131amd64-default
[ao/pipewire] Core version: 0.3.62
[ao/pipewire] Core name: pipewire-0
[ao/pipewire] device buffer: 960 samples.
[ao/pipewire] using soft-buffer of 9600 samples.
AO: [pipewire] 48000Hz stereo 2ch floatp
A: 00:00:00 / 00:46:40 (0%) Cache: 184s/6MB
Comment 1 Jan Beich freebsd_committer freebsd_triage 2023-06-15 04:33:16 UTC
Comment on attachment 242783 [details]
v1 (apply via "git am")

> +MEDIASESSION_RUN_DEPENDS=	alsa-plugins>0:audio/alsa-plugins

This brings audio/pulseaudio via bug 245321. Maybe multimedia/pipewire should also enable PULSEAUDIO option by default.

Note, audio/alsa-plugins is required to avoid the following after installing /usr/local/etc/pipewire/pipewire.conf.d/alsa-default.conf Adding "nofail" will make the error non-fatal at the cost of broken audio (again).

$ pipewire
[...]
ALSA lib dlmisc.c:285:(snd_dlobj_cache_get0) Cannot open shared library /usr/local/lib/alsa-lib/libasound_module_pcm_oss.so ((null): Cannot open "/usr/local/lib/alsa-lib/libasound_module_pcm_oss.so")
[E][0.237744] spa.alsa     | [      alsa-pcm.c:  558 spa_alsa_open()] 'pcm.default': playback open failed: Device not configured
[W][0.237750] mod.adapter  | [       adapter.c:  232 find_format()] 0x2efa73d40040: can't get format: Device not configured
[E][0.237755] mod.adapter  | [module-adapter.c:  283 create_object()] usage: node.name=<string>
[E][0.237759] pw.resource  | [      resource.c:  265 pw_resource_errorf_id()] usage: node.name=<string>
[E][0.237839] pw.conf      | [          conf.c:  692 create_object()] can't create object from factory adapter: Invalid argument
[E][0.238164] default      | [      pipewire.c:  125 main()] failed to create context: Invalid argument
Comment 2 Gleb Popov freebsd_committer freebsd_triage 2023-06-15 15:21:36 UTC
If this works for you, go for it.
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-06-15 22:12:14 UTC
A commit in branch main references this bug:

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

commit a7aaffb08b1688f28121d1f12e8012fd40bf75e7
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-06-15 03:28:16 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-06-15 22:10:49 +0000

    multimedia/pipewire: unbreak audio with default config

    $ pw-play foo.wav
    stream node 35 error: no node available
    remote error: id=2 seq:5 res:-2 (No such file or directory): no node available

    PR:             272004
    Approved by:    arrowd (maintainer)

 multimedia/pipewire/Makefile                       | 13 +++++++++---
 .../pipewire/files/10-alsa-default.conf.in (new)   | 23 ++++++++++++++++++++++
 multimedia/pipewire/pkg-plist                      |  1 +
 3 files changed, 34 insertions(+), 3 deletions(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-06-15 22:15:15 UTC
A commit in branch 2023Q2 references this bug:

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

commit 3bfa97870dbb2b3af241bb59aae978c6af7826b5
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-06-15 03:28:16 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-06-15 22:12:24 +0000

    multimedia/pipewire: unbreak audio with default config

    $ pw-play foo.wav
    stream node 35 error: no node available
    remote error: id=2 seq:5 res:-2 (No such file or directory): no node available

    PR:             272004
    Approved by:    arrowd (maintainer)

    (cherry picked from commit a7aaffb08b1688f28121d1f12e8012fd40bf75e7)

 multimedia/pipewire/Makefile                       | 12 +++++++++--
 .../pipewire/files/10-alsa-default.conf.in (new)   | 23 ++++++++++++++++++++++
 multimedia/pipewire/pkg-plist                      |  1 +
 3 files changed, 34 insertions(+), 2 deletions(-)