| Summary: | Catch sound key up/down buttons | ||
|---|---|---|---|
| Product: | [Applications] kdeconnect | Reporter: | rugk <7429c5c9> |
| Component: | android-application | Assignee: | Albert Vaca Cintora <albertvaka> |
| Status: | RESOLVED FIXED | ||
| Severity: | wishlist | CC: | danielzgtg.opensource, leonardo906 |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Android | ||
| OS: | Unspecified | ||
| Latest Commit: | https://invent.kde.org/network/kdeconnect-android/commit/7080b43d2d44bdc1052bbb719fbbb7a6668b4785 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
rugk
2018-09-19 20:46:28 UTC
At attempt at this seems to be in the code. However, it is currently broken for me. > remote volume of the connected device. However, first I would only do this when you are at the media control screen Looking at the code, is a possibility that this may have been implemented as changing the volume of a single music application instead of the system. I wasn't able to verify though. > adjust it everywhere, so maybe add an option in the settings, so I can also control it when the screen is off This would have been a huge security problem if the Android OS had allowed such a thing. Imagine all of your apps messing with the volume buttons in the background, and you scrambling to figure out which one is responsible. The most that should be possible is a notification that acts as a lockscreen widget containing the volume buttons. > if you could just add your own "audio channel" That would cause Android to try and send all the audio to KDE Connect, leaving the phone speakers silent. Until we can stream audio to the computer, this would only confuse the user (In reply to Daniel Tang from comment #1) > Looking at the code, is a possibility that this may have been implemented as > changing the volume of a single music application instead of the system. As of my recent changes, you can now control volume of the system default output device while devices page of media control activity is selected. > However, it is currently broken for me. Controlling the volume of an app also seems to be broken for me. (In reply to rugk from comment #0) > I want to be able to quickly adjust the (music) volume, because my screen may > be off or I do not want to navigate to KDE Connect. Googling showed that since lollipop we can listen for volume adjustments in background while we use MediaSession/MediaSessionCompat. And it's already in use by MprisPlugin to listen for clicks of media notification buttons and other related stuff. So it's quite simple to implement. Actually, I just tested my draft version of the solution and it works. I think I will polish that and will make a MR. P.S. Phone music playback has a higher priority than app's volume adjustments listener so the user is still able to control phone music when both devices play something. A possibly relevant merge request was started @ https://invent.kde.org/network/kdeconnect-android/-/merge_requests/245 Git commit 7080b43d2d44bdc1052bbb719fbbb7a6668b4785 by Nicolas Fella, on behalf of Art Pinch. Committed on 01/06/2022 at 22:35. Pushed by nicolasfella into branch 'master'. Control remote device volume by volume keys when MPRIS session is active Allows to control the volume of the default sink of the remote device by pressing phone volume keys on API21+ (Lollipop and onwards) when MPRIS session is active (i.e. MPRIS media control notification is present). Remote device should support System Volume Plugin and report its default sink. Volume controlling works both when the phone screen is off and on. When the screen is on, you'll see a new slider in the volume panel. A +21 -0 src/org/kde/kdeconnect/Helpers/VolumeHelper.kt M +39 -1 src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisMediaSession.java M +6 -18 src/org/kde/kdeconnect/Plugins/MprisPlugin/MprisNowPlayingFragment.java M +3 -1 src/org/kde/kdeconnect/Plugins/SystemVolumePlugin/Sink.java M +11 -22 src/org/kde/kdeconnect/Plugins/SystemVolumePlugin/SystemVolumeFragment.java A +176 -0 src/org/kde/kdeconnect/Plugins/SystemVolumePlugin/SystemVolumeProvider.kt A +11 -0 src/org/kde/kdeconnect/Plugins/SystemVolumePlugin/SystemVolumeUtils.kt https://invent.kde.org/network/kdeconnect-android/commit/7080b43d2d44bdc1052bbb719fbbb7a6668b4785 |