> Ok, i see that no one use emms and tramp together. Still, i do not think that
> it is a bad idea to integrate a little bit emms and tramp
 
hi i wrote in about this a few years back and thought the sshfs option was 
good enough for me.
 
However, my suggestion at the time was to define a new type of *track* structure
specifically for TRAMP filenames. There's several considerations for dealing 
with
them that are different from a URL track. for example, how should the tag editor
work? i assume it should be similar to a URL, like you could add local metadata 
but
not edit the remote file.
 
The benefit of integrating with TRAMP would be a more "on the fly" type of 
adding
to playlists, i don't have to think about mounting an entire directory to play 
a song,
just add it to a playlist transparently with Emacs minibuffer tramp filenames.


> >> >
> >> > As i see it, there are two reasons why mpv doesn't play such files.
> >> > (As i understand vlc also)
> >> > 1. Mpv uses different naming scheme than tramp.
> >> > So instead of /sftp: one should write sftp://
> >> >
> >> > 2. mpv does not support protocols rsync, sshx, ssh only sftp
> >> >
> >> > I would suggest changing few lines in emms-player-mpv-start.
> >> > (Although i did it through advice-add)
> >> >
> >> > --- emms-player-mpv.el 2024-12-02 17:19:18.807604784 +0100
> >> > +++ emms-player-mpv-new.el 2024-12-04 15:36:39.132959493 +0100
> >> > @@ -722,7 +722,10 @@
> >> > (setq emms-player-mpv-stopped nil)
> >> > (emms-player-mpv-proc-playing nil)
> >> > (let*
> >> > - ((track-name (emms-track-get track 'name))
> >> > + ((name-origin (emms-track-get track 'name))
> >> > + (track-name (if (string-match "^/ssh:\\|^/sshx:\\|^/rsync:\\|^/sftp:" 
> >> > name-origin)
> >> > + (replace-match "sftp://"; nil nil name-origin)
> >> > + name-origin))
> >> > (track-playlist-option
> >> > (and emms-player-mpv-use-playlist-option
> >> > (memq (emms-track-get track 'type)
> >> >
> >> > What would be better solution? 
> >> 
> >> Perhaps this is a good solution (taking the above into consideration); I
> >> haven't looked into it yet. I would like to read Mike Kazantsev's view
> >> on it first.
> >
> > I've never used emacs tramp mode myself, but it seem to make sense to
> > translate track URLs passed to mpv there.
> >
> > One concern might be that it'd include an otherwise-legitimate
> > filenames by accident, but I think chance of someone naming a file
> > "/ssh:..." under root dir is low enough to probably not even bother
> > making an option to disable it.
> >
> > I'd condense regexp to "^/\\(ssh\\|sshx\\|rsync\\|sftp\\):" - might
> > express "/one-of-protocols:" intent a bit better, with an identical
> > start/end character, but it should work fine either way of course.
> >
> >
> > Also, if rsync's on the list, maybe all other ssh-related tramp access
> > methods can be added too - plink, plinkx, scp, scpx, pscp, psftp, fcp.
> >
> > https://www.gnu.org/software/emacs/manual/html_node/tramp/Inline-methods.html
> > https://www.gnu.org/software/emacs/manual/html_node/tramp/External-methods.html
> >
> > I think all the extra ones listed above basically mean "ssh connection
> > follows" and for mpv that always translates to sftp:// method.
> >
> >
> > Same as with tramp mode, never used sftp:// file paths myself either.
> > As far as I can tell it'd be an URL that mpv passes to ffmpeg's libav as-is,
> > and it's documented to use libssh to handle those.
> >
> > Afaik emacs uses OpenSSH for tramp mode, and libssh is a different ssh
> > implementation from that, so its access might work differently from
> > tramp mode due to emacs-side configuration, OpenSSH configuration,
> > and more general differences between OpenSSH and libssh.
> > (I think libssh does read e.g. ~/.ssh configs and pickup ssh-agent 
> > from env though, so should probably not give any surprises)
> >
> > I'd be a bit uneasy about giving mpv an ssh access to any ssh user not
> > strictly locked to sftp tbh (which can be easily configured in openssh),
> > but this doesn't enable any new access methods, as sftp:// URLs were
> > implicitly supported by emms before, I think.
> >
> >
> >> > My entire music collection is on the remote server, to which i have
> >> > access trough ssh. 
> >> 
> >> I think of this as a file-system level issue. Why not mount the remote
> >> directory instead?
> >
> > I also always just mounted stuff using sshfs, and have always been
> > using it as a primary way for accessing any media files or often editing
> > remote configuration files as well.
> > (as using NFS was always more difficult and not required performance-wise)
> >
> > But that's just me, tramp mode might have some advantages over that, idk.
> 
 

Reply via email to