librespot-java icon indicating copy to clipboard operation
librespot-java copied to clipboard

Shell events don't trigger

Open kondas opened this issue 1 year ago • 2 comments

Describe the bug Shell events doesn't trigger

To Reproduce Using this configuration, the shell commands don't get executed. I've compared the trace level logs, and there is no difference if the shell commands are enabled.

[shell]
	onTrackSeeked = ""
	onStartedLoading = ""
	onConnectionDropped = "rm -rf /opt/hifi/spocon-connected"
	onMetadataAvailable = ""
	onTrackChanged = ""
	onPanicState = ""
	onFinishedLoading = ""
	# Shell events enabled
	enabled = true
	onPlaybackResumed = ""
	onConnectionEstablished = "touch /opt/hifi/spocon-connected"
	onPlaybackEnded = ""
	onContextChanged = ""
	# Execute the command with `bash -c`
	executeWithBash = false
	onPlaybackPaused = ""
	onInactiveSession = ""
	onVolumeChanged = ""

Version/Commit 1.6.2

kondas avatar Dec 30 '22 19:12 kondas

I observe the same. I would really like to trigger something like a timeout counter when Playback ends, so my Raspberry Pi is shutdown after that period. But as @kondas already wrote: No difference in having enabled = true or not.

PS: It's also quite hard to understand from a user perspective how this works, since close to no docs seem to exist for this. Asking in the librespot Gitter channel for details on the shell section, the only resources I got pointed to after several days are:

  • The initial GitHub implementation request ( #329 )
  • The source code ( here )

The-Judge avatar Jan 02 '23 13:01 The-Judge

These are working correctly for me. I did have some troubles with them initially. You may find that setting the metadata pipe item in the configuration file to "" helps. i.e.

[player] metadataPipe = ""

FYI - I did compile from the dev branch using the instructions here https://github.com/librespot-org/librespot-java/issues/321 but this may also work with the release version too.

I am reviewing the code (I am not a java dev) and I am not entirely sure why this works. I will post any observations should I discover them.

aleszczynskig avatar Mar 31 '23 06:03 aleszczynskig