0

I'm trying to use the emms-state package to get a nice-looking description of the currently playing track in the mode line. It mostly works -- track name, artist, year, and current timestamp -- but I can't see how long the current track is.

 

I think the problem is that the emms-track-get function doesn't retrieve the info-playing-time key/variable. I can test this by editing the emms-track-description-function to try to retrieve info-playing-time, but the track listings in a playlist buffer do not show this.

 

Is there any way to fix this? I'm using emms-player-mpv as the only player, could that be the origin of this issue?

This answer to a similar post suggests "installing emms from the package repository. Not from the GNU site." Not quite sure what that means, but I'm using emms from MELPA.

EDIT: Meant emms-state, found here, not emms-status.

8
  • Where does the emms-status package come from? I cannot find it on MELPA. Commented Nov 18, 2022 at 18:38
  • @FranBurstall Whoops, meant emms-state: github.com/alezost/emms-state.el . But the problem is independent of this package. Commented Nov 19, 2022 at 10:44
  • I cannot reproduce your issue: if I evaluate (emms-track-get (emms-playlist-current-selected-track) 'info-playing-time) in the scratch buffer, I get the track length. Commented Nov 21, 2022 at 17:59
  • @FranBurstall Hmm... I get nil when I do the same (while a track is playing), while e.g. 'info-artist gives the correct value. Do I need something like emms-info-libtag, as in this answer (which I've realized is also by you!). Commented Nov 23, 2022 at 5:48
  • You probably need some emms-info-* loaded (I think the default these days is emms-info-native which has no external dependencies and is pretty good). Commented Nov 23, 2022 at 22:25

1 Answer 1

0

After trying to add various different emms-info-functions, I found this thread and started working through the suggested solutions.

What I think has ended up working for me is:

  • Doing git clone https://git.savannah.gnu.org/git/emms.git to some local directory (which is what I think this post was suggesting).

  • As suggested in the thread, running make emms-print-metadata inside the emms directory, and moving emms-print-metadata via sudo cp src/emms-print-metadata /usr/local/bin/.

I am now able to do $ emms-print-metadata ~/Music/song.mp3 and get the artist name etc. and now the total time. Restarting Emacs to make sure emms is configured properly now results in the total time being shown in the mode-line, and (emms-track-get (emms-playlist-current-selected-track) 'info-playing-time) working when called via M-:.

I had actually found this answer describing the same procedure beforehand, although I thought that the problem described there was specific to emms-info-libtag.

Also, for anyone else using emms-mpv-player, the following might help when adding a new file (e.g. a recently downloaded podcast ep.) to a playlist:

(setq emms-player-mpv-update-metadata t)

EDIT

I realize now that the above is incomplete -- I need

(require 'emms-info-libtag)
(setq emms-info-functions '(emms-info-libtag)) 

as well, which I apparently tried at some point. This was after doing another emms-cache-reset and having all the time info disappear, (with the currently playing track being showing its time info via emms-player-mpv-update-metadata, but unplayed tracks being unaffected).

2
  • 1
    Glad this all worked out for you. I did a little experimentation and it turns out that emms-info-native is not extracting the playing time (I am sure it used to). I shall report this to the emms devs. Commented Nov 25, 2022 at 20:14
  • @FranBurstall Ah good - glad it's not something specific to my setup. FWIW I had this issue on Emacs v 27.2 and now on 28.2, with emms version 20220908.122. Commented Nov 26, 2022 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.