Bug 246726 - multimedia/mpv needs sndio by default
Summary: multimedia/mpv needs sndio by default
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-multimedia (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-25 20:25 UTC by Daniel Ebdrup Jensen
Modified: 2020-11-25 10:57 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Ebdrup Jensen freebsd_committer freebsd_triage 2020-05-25 20:25:39 UTC
As a follow up to bug 211893 and to aid in using FreeBSD as a desktop OS, it would help enormously if mpv could include support for sndio by default.

The reason it would work is it would integrate well with the documentation provided at https://wiki.freebsd.org/Sound#For_Firefox.2FChrome_video_conferencing:_sndio_integration_for_userspace_programs for using sndio for Firefox.

Would this be possible?
Comment 1 Tobias Kortkamp freebsd_committer freebsd_triage 2020-05-25 22:20:50 UTC
I strongly disagree.  The sndio backend has problems and was removed
upstream [1].  We should enable OPENAL by default instead.  We can
turn on sndio support in audio/openal-soft by default.

[1] https://github.com/mpv-player/mpv/commit/71d218eae4b4d93ada34ff74906f71ad359c84bc#diff-7ea2892c97fb115fc8ed8f8e6574e022

> The reason it would work is it would integrate well with the
> documentation provided at
> https://wiki.freebsd.org/Sound#For_Firefox.2FChrome_video_conferencing:_sndio_integration_for_userspace_programs
> for using sndio for Firefox.

The "simple" setup is way too complicated:
sndiod defaults to using rsnd/default which is mapped to /dev/dsp,
so just `sndiod` is enough and should be equivalent to `sndiod -f
rsnd/$(sysctl -n hw.snd.default_unit)`.

While I'd recommend running sndiod because of bug #218188, it does
not need to be running at all for simple stuff to work.
Comment 2 Evilham 2020-05-25 23:03:04 UTC
\o it looks like that'd make sense, I'm testing audio/openal-soft with SNDIO (and all audio options disabled) and multimedia/mpv with OPENAL (and all other audio options disabled).

Will be reporting back over May 26th CEST time :-). Hopefully nothing will get in the way.
Comment 3 Daniel Ebdrup Jensen freebsd_committer freebsd_triage 2020-05-25 23:14:10 UTC
Comment 2
As long as it means I can get audio from mpv without having to switch things around or use pulseaudio (which also requires switching things around for me), I'll be happy. :)

Having checked your suggestion, I've adopted the other documentation a bit.
I don't think there's a need to discuss it further in this report, as I'm not sure it's related.
Comment 4 Evilham 2020-05-26 08:43:15 UTC
Hello, reporting back on my tests with mpv + openal with sndio stupport.

On the mpv side of things, which is relevant for this PR, it seems fairly uncontroversial (no extra dependencies, no side-effects) to have the OPENAL option enabled by default and it works fine.
It does require --ao=openal, else it defaults to using OSS (which also works even with sndio enabled), a user could also set this option system-wide or user-wide in the corresponding configuration files.

Regarding audio/openal-soft, I've opened bug 246741 because it looks to me like that discussion is worth having in a different place.

Hope that's useful.
Comment 5 Jan Beich freebsd_committer freebsd_triage 2020-06-09 04:01:46 UTC
(In reply to Tobias Kortkamp from comment #1)
> We should enable OPENAL by default instead.

OPENAL is not usable after https://github.com/mpv-player/mpv/commit/d27ad9654218

$ mpv --no-config --msg-level=ao=v --ao=openal foo.mp3
[...]
[ao] Trying audio driver 'openal'
[ao/openal] requested format: 44100 Hz, stereo channels, floatp
[ao/openal] broken.
[ao] Failed to initialize audio driver 'openal'
Could not open/initialize audio device -> no sound.
Audio: no audio

Exiting... (Errors when loading file)
Comment 6 Tobias Kortkamp freebsd_committer freebsd_triage 2020-06-09 12:12:33 UTC
(In reply to Jan Beich from comment #5)
Yikes...  There is still the SDL backend for now which we could use like
OpenBSD does.
Comment 7 Daniel Ebdrup Jensen freebsd_committer freebsd_triage 2020-06-09 13:38:29 UTC
That's probably just going to be removed too? :(
Comment 8 Rene Ladan freebsd_committer freebsd_triage 2020-10-05 17:23:44 UTC
Maintainer reset.
Comment 9 Jan Beich freebsd_committer freebsd_triage 2020-11-22 20:00:25 UTC
Obsolete after ports r556071.
Comment 10 Ivan Rozhuk 2020-11-25 03:04:31 UTC
We should enable OSS by default: https://github.com/mpv-player/mpv/pull/8312 :)

There is no issues with OSS and sndio except wm4 does not want spent time to convert it to new internal API.
Comment 11 Ivan Rozhuk 2020-11-25 04:10:14 UTC
SNDIO: https://github.com/mpv-player/mpv/pull/8314
Comment 12 commit-hook freebsd_committer freebsd_triage 2020-11-25 10:57:02 UTC
A commit references this bug:

Author: jbeich
Date: Wed Nov 25 10:56:19 UTC 2020
New revision: 556287
URL: https://svnweb.freebsd.org/changeset/ports/556287

Log:
  multimedia/mpv: restore --ao=oss and disable OPENAL (like before r556071)

  PR:		246726
  Submitted by:	rozhuk.im@gmail.com

Changes:
  head/multimedia/mpv/Makefile
  head/multimedia/mpv/distinfo