raspicast
raspicast copied to clipboard
Fix volume adjustment by employing DBus
Thanks for this great app, @HaarigerHarald !
Unfortunately, volume adjustment using the volume buttons did not work for me.
After some debugging I found that the command echo -n +>>/dev/shm/.r_input 2>/dev/null
generated by the app upon button press does not change the volume.
However I was able to control the volume on the command line in a manually started /usr/bin/omxplayer.bin -b -o local --vol 0 video.mp4
process.
Also it seems that dev/shm/.r_input
or /tmp/.r_input
are always owned by pi even though I am using a different user for SSH (and X obviously).
Eventually I found that omxplayer accepts volume adjustments from DBus via dbus-send --print-reply --dest=org.mpris.MediaPlayer2.omxplayer /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Action int32:18
(and -17
respectively) and fixed it in the app.
The only small problem I have with this is that there is no way to preserve the current volume for subsequent tracks. Do you mean that the .r_input
file can't be read by omxplayer or can't be written by Raspicast? If it is the former I guess we could combine both ways, i.e. don't pipe it through the file just use it to keep track of volume up/down and use DBUS while omxplayer is running.