Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix volume adjustment by employing DBus #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

F1iX
Copy link

@F1iX F1iX commented Feb 13, 2021

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.

@HaarigerHarald
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants