Bug 249483 - Bring back multimedia/quodlibet with latest version 4.3.0
Summary: Bring back multimedia/quodlibet with latest version 4.3.0
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL: https://quodlibet.readthedocs.io/en/l...
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-20 14:30 UTC by Aaron LI
Modified: 2020-10-19 13:37 UTC (History)
2 users (show)

See Also:


Attachments
multimedia/quodlibet: version 4.3.0 tarball (1.76 KB, application/x-bzip)
2020-09-20 14:30 UTC, Aaron LI
no flags Details
multimedia/quodlibet: Update to version 4.3.0 (7.14 KB, patch)
2020-09-21 22:54 UTC, Aaron LI
no flags Details | Diff
Bring back multimedia/quodlibet with latest version 4.3.0 (4.94 KB, patch)
2020-09-23 16:30 UTC, Aaron LI
no flags Details | Diff
Bring back multimedia/quodlibet with latest version 4.3.0 (4.94 KB, patch)
2020-09-24 16:07 UTC, Aaron LI
no flags Details | Diff
Bring back multimedia/quodlibet with latest version 4.3.0 (6.34 KB, patch)
2020-10-15 14:17 UTC, Aaron LI
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron LI 2020-09-20 14:30:20 UTC
Created attachment 218109 [details]
multimedia/quodlibet: version 4.3.0 tarball

Hello,

The attached tarball is the 'multimedia/quodlibet' port that is updated to the latest 4.3.0 version.  I've tested and am using it on DragonFly BSD now, and it should just work on FreeBSD.

Since this port hasn't been updated for years by its maintainer, I'm wanting to take its maintainership.

Please review, and thanks.
Comment 1 daniel.engberg.lists 2020-09-20 19:02:34 UTC
Please submit your patch as a svn diff or git patch

Set URL to https://quodlibet.readthedocs.io/en/latest/changelog.html#release-4-3-0 in PR

Is there a reason why we can't use upstream release archive/tarball? (also suggested by 5.4.3 in Porter's Handbook)

https://github.com/quodlibet/quodlibet/releases/tag/release-4.3.0 --> 
https://github.com/quodlibet/quodlibet/releases/download/release-4.3.0/quodlibet-4.3.0.tar.gz

Set python as min 3.5+

Remove #DBUS_BUILD_DEPENDS... if its not used.

Looks good to me otherwise but I'm not a python port expert.

Best regards,
Daniel
Comment 2 Aaron LI 2020-09-21 16:06:27 UTC
(In reply to daniel.engberg.lists from comment #1)

Hi Daniel,

Thank you for your kind help.  I've updated this port and improved a bit.  Please review the attached Git patch.  Following are my changes:

* Update to the latest version 4.3.0
* Take maintainership as this port hasn't been updated by its original
  maintainer for years
* Remove configure options since they're just optional runtime
  dependencies and don't affect the build
* Add a 'pkg-message' to mention those optional runtime dependencies so
  that users can choose and know what to install

Best regards,
Aaron
Comment 3 daniel.engberg.lists 2020-09-21 22:25:23 UTC
Hi Aaron, 

Your changes sounds great however I think you forgot to attach the patch?

Best regards,
Daniel
Comment 4 Aaron LI 2020-09-21 22:54:29 UTC
Created attachment 218165 [details]
multimedia/quodlibet: Update to version 4.3.0
Comment 5 Aaron LI 2020-09-21 22:55:51 UTC
(In reply to daniel.engberg.lists from comment #3)

Ooops, sorry.  Now I add the patch.  Thank you for reviewing.

Best regards,
Aaron
Comment 6 Aaron LI 2020-09-21 23:09:23 UTC
Hmm, I just noticed that this port was marked to be expired on 2020-09-15, so it has been removed from the ports tree recently.

Just a side note.

Best regards,
Aaron
Comment 7 Fernando Apesteguía freebsd_committer 2020-09-23 14:22:32 UTC
(In reply to Aaron LI from comment #6)
Hi Aaron,

I'm a bit confused here. The title says update for multimedia/quodlibet but the attachment is named after multimedia/playerctl but still seems to apply to multimedia/quodlibet. So... which one is it?
Comment 8 Aaron LI 2020-09-23 16:13:35 UTC
Comment on attachment 218109 [details]
multimedia/quodlibet: version 4.3.0 tarball

deprecated
Comment 9 Aaron LI 2020-09-23 16:19:28 UTC
Comment on attachment 218165 [details]
multimedia/quodlibet: Update to version 4.3.0

Well, the old version of this port uses Python 2.7 and has been removed in commit https://github.com/freebsd/freebsd-ports/commit/c06d5bc6d131c081e20d12a1f3e58373ce49a785
Comment 10 Aaron LI 2020-09-23 16:30:04 UTC
Created attachment 218215 [details]
Bring back multimedia/quodlibet with latest version 4.3.0

Since the old version of this port uses Python 2.7 and has been removed in commit https://github.com/freebsd/freebsd-ports/commit/c06d5bc6d131c081e20d12a1f3e58373ce49a785, so this patch brings it back but updates it to the latest version 4.3.0 and uses Python 3.5+.
Comment 11 Aaron LI 2020-09-23 16:32:03 UTC
(In reply to Fernando Apesteguía from comment #7)

Sorry for the confusion. The attachment name error was a copy/paste error... I already fixed it.

In addition, I added a new patch that should apply on the master branch of freebsd-ports.

Thank you for the review.

Regards,
Aaron
Comment 12 Fernando Apesteguía freebsd_committer 2020-09-24 07:28:35 UTC
(In reply to Aaron LI from comment #11)
It's OK.

Now, this thing builds and runs, but I can not make it play a song. It says "No GStreamer audio sink found". The pipeline box in preferences is empty. I have plenty of gstreamer packages installed:

$ pkg info -x 'gstrea.*'
gstreamer-0.10.36_6
gstreamer-ffmpeg-0.10.13_7
gstreamer-plugins-0.10.36_12,3
gstreamer-plugins-a52dec-0.10.19_2,3
gstreamer-plugins-bad-0.10.23_4,3
gstreamer-plugins-core-0.10_13
gstreamer-plugins-dts-0.10.23_2,3
gstreamer-plugins-dvd-0.10.19_6,3
gstreamer-plugins-good-0.10.31_3,3
gstreamer-plugins-libpng-0.10.31_2,3
gstreamer-plugins-mad-0.10.19_3,3
gstreamer-plugins-mp3-0.10.0_1
gstreamer-plugins-ogg-0.10.36_2,3
gstreamer-plugins-pango-0.10.36_3,3
gstreamer-plugins-theora-0.10.36_2,3
gstreamer-plugins-ugly-0.10.19_2,3
gstreamer-plugins-vorbis-0.10.36_2,3
gstreamer-plugins-xvid-0.10.23_2,3
gstreamer1-1.16.2
gstreamer1-libav-1.16.2
gstreamer1-plugins-1.16.2
gstreamer1-plugins-a52dec-1.16.2
gstreamer1-plugins-bad-1.16.2
gstreamer1-plugins-core-1.16
gstreamer1-plugins-dts-1.16.2
gstreamer1-plugins-dvdread-1.16.2_1
gstreamer1-plugins-good-1.16.2
gstreamer1-plugins-mpg123-1.16.2
gstreamer1-plugins-ogg-1.16.2
gstreamer1-plugins-pango-1.16.2
gstreamer1-plugins-png-1.16.2
gstreamer1-plugins-resindvd-1.16.2_1
gstreamer1-plugins-theora-1.16.2
gstreamer1-plugins-ugly-1.16.2
gstreamer1-plugins-vorbis-1.16.2

A quick guide on how to make it work in order to test it?
Comment 13 Aaron LI 2020-09-24 16:03:23 UTC
(In reply to Fernando Apesteguía from comment #12)

Hi Fernando, thank you for the testing.

I looked into the QuodLibet code and find that error comes from:

https://github.com/quodlibet/quodlibet/blob/quodlibet-4.3/quodlibet/quodlibet/player/gstbe/util.py#L101

On *BSD, it should use the 'autoaudiosink' Gstreamer audio sink, which is provided by the 'gstreamer1-plugins-good' package and this package is already installed on your system.  I can't figure out why it doesn't work for you :(

I'm using the new QuodLibet on my DragonFly BSD (5.9-development) desktop for several days, and it works fine.  I'm also using the Gstreamer v1.16.2, same version as yours:

-----------------------------------------------------------------------------
% pkg info -x 'gstrea.*'
gstreamer1-1.16.2
gstreamer1-libav-1.16.2
gstreamer1-plugins-1.16.2
gstreamer1-plugins-bad-1.16.2
gstreamer1-plugins-faad-1.16.2
gstreamer1-plugins-flac-1.16.2
gstreamer1-plugins-gl-1.16.2
gstreamer1-plugins-good-1.16.2
gstreamer1-plugins-mpg123-1.16.2
gstreamer1-plugins-ogg-1.16.2
gstreamer1-plugins-speex-1.16.2
gstreamer1-plugins-ugly-1.16.2
gstreamer1-plugins-vorbis-1.16.2
gstreamer1-plugins-wavpack-1.16.2
-----------------------------------------------------------------------------

One difference here is that I don't have the legacy Gstreamer 0.10.x, but I don't think it's the issue, because QuodLibet requires Gstreamer 1.0:

https://github.com/quodlibet/quodlibet/blob/quodlibet-4.3/quodlibet/quodlibet/_init.py#L396

Nevertheless, please try this in Python 3:

-----------------------------------------------------------------------------
>>> import gi
>>> gi.require_version('Gst', '1.0')
>>> from gi.repository import Gst
>>> Gst.init_check()
(True, argv=[])
>>> Gst.ElementFactory.make('autoaudiosink', None)
<__gi__.GstAutoAudioSink object at 0x8019dc870 (GstAutoAudioSink at 0x801fae060)>
-----------------------------------------------------------------------------

and try:

-----------------------------------------------------------------------------
% gst-inspect-1.0 autoaudiosink
Factory Details:
  Rank                     none (0)
  Long-name                Auto audio sink
  Klass                    Sink/Audio
  Description              Wrapper audio sink for automatically detected audio sink
  Author                   Jan Schmidt <thaytan@noraisin.net>

Plugin Details:
  Name                     autodetect
  Description              Plugin contains auto-detection plugins for video/audio in- and outputs
  Filename                 /usr/local/lib/gstreamer-1.0/libgstautodetect.so
  Version                  1.16.2
  License                  LGPL
  Source module            gst-plugins-good
  Source release date      2019-12-03
  Binary package           GStreamer Good Plug-ins source release
  Origin URL               Unknown package origin

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBin
                         +----GstAutoDetect
                               +----GstAutoAudioSink
-----------------------------------------------------------------------------

Hope this helps.

Regards,
Aaron
Comment 14 Aaron LI 2020-09-24 16:07:00 UTC
Created attachment 218244 [details]
Bring back multimedia/quodlibet with latest version 4.3.0

Change 'python:3.5+' to 'python:3.6+' as Python >=3.6 is required.
Comment 15 Fernando Apesteguía freebsd_committer 2020-09-24 16:18:40 UTC
(In reply to Aaron LI from comment #13)
Factory Details:
  Rank                     none (0)
  Long-name                Auto audio sink
  Klass                    Sink/Audio
  Description              Wrapper audio sink for automatically detected audio sink
  Author                   Jan Schmidt <thaytan@noraisin.net>

Plugin Details:
  Name                     autodetect
  Description              Plugin contains auto-detection plugins for video/audio in- and outputs
  Filename                 /usr/local/lib/gstreamer-1.0/libgstautodetect.so
  Version                  1.16.2
  License                  LGPL
  Source module            gst-plugins-good
  Source release date      2019-12-03
  Binary package           GStreamer Good Plug-ins source release
  Origin URL               Unknown package origin

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBin
                         +----GstAutoDetect
                               +----GstAutoAudioSink


For the python stuff:

python3.6
Python 3.6.12 (default, Sep  5 2020, 11:31:39)
[GCC 4.2.1 Compatible FreeBSD Clang 8.0.1 (tags/RELEASE_801/final 366581)] on freebsd12
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'gi'
>>>
Comment 16 Fernando Apesteguía freebsd_committer 2020-09-24 16:33:43 UTC
With python3.7

$ python3.7
Python 3.7.9 (default, Sep  5 2020, 01:21:24)
[Clang 8.0.1 (tags/RELEASE_801/final 366581)] on freebsd12
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>> gi.require_version('Gst', '1.0')
>>> from gi.repository import Gst
>>> Gst.init_check()
(True, argv=[])
>>> Gst.ElementFactory.make('autoaudiosink', None)
<__gi__.GstAutoAudioSink object at 0x801e80280 (GstAutoAudioSink at 0x802073020)>
>>>
Comment 17 Fernando Apesteguía freebsd_committer 2020-10-14 06:57:36 UTC
Hi Aaron,

Sorry for my late response. I tested this a bit more. Interestingly, when I start quodlibet from a terminal as a regular user, I see this:

$ quodlibet
W: [(null)] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.


And I get the "No GStreamer audio sink found" and can not play music files. 

However, if I launch it as root, I don't see that warning and I can play files without problems. It might be a problem with my environment (I do not use Gnome) or permissions on my side.

Are you running it as a regular user?
Comment 18 Aaron LI 2020-10-14 13:37:08 UTC
(In reply to Fernando Apesteguía from comment #17)

Interesting!  I never thought about the PulseAudio might play a role here.  Actually, DragonFly BSD's DPorts removed PulseAudio altogether since it never worked well ;)

I run QuodLibet as a regular user (but I'm in groups 'wheel', 'operator', 'video'; however, I don't think these supplement groups would make a difference).

I did some searches and someone suggest the 'dbus' should be started as it's required by PulseAudio.  In addition, PulseAudio may choose the wrong sink.  So I suggest that you could try:

* make sure 'dbus' is running
* check the sink device in '/dev/sndstat' and set it for PulseAudio with 'pacmd set-default-sink <sink-number>'
* is 'pulseaudio' running as your user? (On Linux, 'pulseaudio' is auto started and running as the regular user)

If you could figure it out, I'll update the 'pkg-message' to guide users.

-------------------

On the other hand, QuodLibet sometimes just crash on DragonFly BSD. I believe this issue is DragonFly-specific (the old QuodLibet also had such an issue) and I'm investigating it.

-------------------

Regards,
Aaron
Comment 19 Aaron LI 2020-10-14 13:39:16 UTC
(In reply to Fernando Apesteguía from comment #17)

One more idea, should installing 'gstreamer1-plugins-pulse' be helpful?

Regards,
Aaron
Comment 20 Fernando Apesteguía freebsd_committer 2020-10-14 15:11:31 UTC
(In reply to Aaron LI from comment #19)
That was it.

With it installed, it works. Without it, it shows the error.

Would you add it to the run dependencies?
Comment 21 Aaron LI 2020-10-14 15:41:42 UTC
(In reply to Fernando Apesteguía from comment #20)

Cool!

We can list 'gstreamer1-plugin-pulse' as a runtime dependency on FreeBSD.  However, I'm wondering why Gstreamer's 'autoaudiosink' prefer PulseAudio instead of OSS on FreeBSD...  Do you have any ideas?  (I'll also investigate a bit.)

Regards,
Aaron
Comment 22 Aaron LI 2020-10-14 15:59:23 UTC
(In reply to Fernando Apesteguía from comment #20)

OK, I've found it.

See: https://github.com/quodlibet/quodlibet/blob/quodlibet-4.3/quodlibet/quodlibet/player/gstbe/util.py#L84

QuodLibet will check whether PulseAudio is running (by executing 'pulseaudio --check') and will use the 'pulsesink' if yes...  Then PulseAudio is chosen over the OSS (via the 'autoaudiosink').

I'm thinking whether we should just disable PulseAudio on FreeBSD (e.g., by removing that 'pulse_is_running()' check) ?  Another idea is to provide a 'PULSEAUDIO' build option.  If checked, add 'gstreamer1-plugins-pulse' to the runtime dependency; otherwise, disable the PulseAudio detection.

What would you suggest?  Thanks.

Regards,
Aaron
Comment 23 Fernando Apesteguía freebsd_committer 2020-10-14 16:12:50 UTC
(In reply to Aaron LI from comment #22)
I would do it optional. Some people use pulseaudio on FreeBSD.
Comment 24 Aaron LI 2020-10-15 14:17:39 UTC
Created attachment 218764 [details]
Bring back multimedia/quodlibet with latest version 4.3.0

Add 'PULSEAUDIO' option to work better with PulseAudio.
Comment 25 Aaron LI 2020-10-15 14:25:36 UTC
(In reply to Fernando Apesteguía from comment #23)

I've updated the port with the 'PULSEAUDIO' option.  In addition, I added a new patch to make QuodLibet better detect the PulseAudio status.  Now, QuodLibet/Gstreamer would not use PulseAudio even if the PulseAudio is running but the 'pulse' plugin is missing.  This would avoid the issue of no Gstreamer sink found that you had before.

So please test the updated port with 'PULSEAUDIO' option OFF and 'gstreamer1-plugin-pulse' uninstalled.  I believe it will now use the OSS sink and work well.  I'll submit the patch to upstream after your confirmation.

Also, please test with the 'PULSEAUDIO' option ON. (I can't test it on DragonFly BSD because we just don't have PulseAudio ;).

Thank you, regards.

Aaron
Comment 26 commit-hook freebsd_committer 2020-10-19 06:46:35 UTC
A commit references this bug:

Author: fernape
Date: Mon Oct 19 06:46:26 UTC 2020
New revision: 552712
URL: https://svnweb.freebsd.org/changeset/ports/552712

Log:
  multimedia/quodlibet re-add with latest version 4.3.0

  Repo-copied from @548979.

  PR was filed just the day after the port was deleted. The new version works fine
  with modern versions of Python. Builds in {11.4,12.1}[amd64,i386] and 13-current
  amd64. Run tested fine in 12.1 amd64.

  Submitter claims maintainership (already maintaininer for multimedia/playerctl).

  ChangeLog: https://quodlibet.readthedocs.io/en/latest/changelog.html#release-4-3-0

  PR:	249483
  Submitted by:	aly@aaronly.me (maintainer)

Changes:
  head/MOVED
  head/multimedia/Makefile
  head/multimedia/quodlibet/
  head/multimedia/quodlibet/Makefile
  head/multimedia/quodlibet/distinfo
  head/multimedia/quodlibet/files/patch-gdist_man.py
  head/multimedia/quodlibet/files/patch-quodlibet_player_gstbe_util.py
  head/multimedia/quodlibet/pkg-descr
  head/multimedia/quodlibet/pkg-message
Comment 27 Fernando Apesteguía freebsd_committer 2020-10-19 06:48:14 UTC
Committed,

Thanks!
Comment 28 Aaron LI 2020-10-19 13:37:18 UTC
(In reply to Fernando Apesteguía from comment #27)

Awesome. Thank you.

Regards,
Aaron