Re: [mpg123-users] How to use a play list in remote mode?
Brought to you by:
sobukus
From: Seamus de M. <sea...@gm...> - 2025-04-01 01:13:45
|
On Mon, Mar 31, 2025 at 3:56 PM Thomas Orgis <tho...@or...> wrote: > Am Sun, 30 Mar 2025 20:05:14 -0500 > schrieb Seamus de Mora <sea...@gm...>: > > > Yes - I can see that would complicate things. However, in my case I do > not > > need "both sides" controlling the playing; > > i.e. *"if <remote mode>; then <disable local mode>; fi"* > > This is how I *imagined* it would work. I am not a fan of complexity! > > Well, the implementation is different. The remote control mode is > kindof a separate main program, its own control loop, where the normal > mpg123 control flow, optionally with terminal control keys, is a > different one. > > > So - First: what is '$n' in your loadlist command? - does it refer to a > > single line/track from 'playlist.m3u' ? (sorry, but the remote help is > > unclear to me in this respect) > > $n is any number between 1 and the number of tracks in the list, > causing mpg123 to start playing that track from the list. The value 0 > would start the last track, -1 causes the listing only. > > > Another question is wrt the meaning of '<url>'. Is this for playing a > > "streaming radio station"?? > > This means any file path or HTTP(S) URL for remote playlists. Playlist > support is strongly linked to web radio streams, as they usually come > in form of a playlist URL. > > > I don't follow this command... I tried it on my system; I got no errors, > > and no response. ? > > […] > > pi@rpi3a:~/soundfiles $ playlist=$(echo loadlist -1 > > /home/pi/soundfiles/plist.m3u | mpg123 -R - | grep '^@I LISTENTRY' | cut > -f > > 4- -d ' ') > > It just stores the playlist in the variable named 'playlist'. > > $ echo "$playlist" > > should print something. But working with this relies on your track file > names not having spaces in them, so is fragile. > > > Here's the result in terminal 1: > > > > @I { > > @I LISTENTRY 1: /home/pi/soundfiles/Sinatra-Morning.mp3 > > @I LISTENTRY 2: /home/pi/soundfiles/Sinatra-String.mp3 > > @I LISTENTRY 3: /home/pi/soundfiles/Sinatra-TakeAway.mp3 > > @I LISTENTRY 4: /home/pi/soundfiles/Sinatra-Watch.mp3 > > @I } > > This is your playlist, parsed by mpg123 code. Of course not that useful > for simple m3u files without comments, etc. > > > And then again from terminal 2, the ONLY thing that seemed to yield a > > result was this: > > > > 'echo "load /home/pi/soundfiles/Sinatra-Morning.mp3" > /tmp/mpg123_fifo' > > Though > > loadlist 1 plist.m3u > > should do the same. If not, I got a serious bug at my hands. > > > IOW - I can find no way to initiate playing a list via the (-R) remote > > mode; this is what I need to be able to do. ??? > > Currently, you can issue the playing of a single track from the list > only. Your frontend script would need to wait until mpg123 signals end > of playback and then issue loading of the next track. > > > And just one other Q re remote mode (-R)... when I did manage to play a > > song, <MANY> of these strings appeared in terminal 1: > > > > ... > > @F 6484 448 169.38 11.70 > > @F 6485 447 169.40 11.68 > > @F 6486 446 169.43 11.65 > > ... > > > > How do I stop this? > > silence > > (see `help silence'). > > > No - I'm not interested in "fine-grained control of playback"; as I said > > I'd like to have a command (remote or otherwise) that simply "loop > plays" a > > playlist from beginning to end, and recognizes a "pause" command to > toggle > > the playback process. > > Ah … you want the playlist in a loop? Or shuffled? There's a number of > options there. Right now the only way to have mpg123 play a list of > files by itself is running it normal/terminal control mode (which you > could also automate, btw.). If we add playlist playing to the remote > control mode, looping and shuffling should also be included, probably > via extra commands. This is not too bad, as the concerned code has been > factored out of the main program in the meantime, just the clear demand > should be there. I'm not totally opposed to doing that, it's not really > hard and a detour from that Windows portability mess. > > > WRT "--continue mode", I see nothing about continue mode in the remote > > help... are you suggesting that from 'terminal 1' I enter this?: > > This is something independent of remote control mode. See --continue in > the man page. It results in something like > > [CONTINUE] track 3 frame 3083 > > being printed when mpg123 is interrupted (`pkill -INT mpg123` works, > too). You can use this data to re-start mpg123 on the correct track and > offset again. Is is accurate to summarize what you've said as follows?: - As of today, loop-playing a playlist using the remote mode is not possible; only the terminal mode can accommodate this. - Loop-playing via remote mode might be added at some point in the future. If this is an accurate synopsis, can you give me a clue or two on what a 'terminal-mode' command to loop-play a list would look like? And can you tell me if the aforementioned "loop-play-via-terminal-mode" could be paused via the 'remote-mode` command for 'PAUSE/P'?? i.e. 'echo "pause" > /tmp/mpg123_fifo' And of course, any comments you care to add re how to "automate" this 'terminal-mode' approach would be much appreciated! Thanks again for your time :) |