[collected] Pause on phone call/resume after

It would be great if you could it pause when phone rings. The best way to implement it would be to use a soft pause / soft resume scheme… Have it quickly reduce the volume to a set level (it doesn’t need to go all the way to zero) over about 1 second, then pause playback… then once the phone call is complete resume play and gradually increase volume to where it was before the call, over the course of about 4-6 seconds… Make the timing and levels configurable because everyone’s systems and listening habits are different. soft pause / soft resume is so much nicer when you have the volume up a bit. Personally I would like it to ALWAYS soft pause / soft resume / soft volume change over time… even for manual pause / play / and volume changes

One other nice thing would be if it would rewind the track a set amount after the pause… so if the phone rings right when it gets to your favorite part of the song, well not to worry, when it resumes it will be rewound far enough back so that when it gets to the previous volume level, it’s just in time.

Many of the VLC remotes currently do this, and it’s the only feature preventing me from switching to Volumio all the time… my hifiberry sounds way better than my PC, but I just can’t miss calls, and I like the music loud enough to hear over the machines where I’m working. With all the subwoffers going I normally even miss my phone vibrating, but even if I catch it, I just don’t have time to fiddle around with it and pause the music to answer the phone… it’s too much to do in too short of a time.

This is something that has to be implemented in whatever phone application you use to control Volumio. Volumio does not and can not know the state of your phone.
Ask the makers of your favorite app (probably an MPD client) to implement a feature to pause/play and gradually increase/decrease volume on an incoming call.

If you use the Sound@Home app made by Digx, please suggest it in its own thread: https://volumio.org/forum/sound-home-android-app-for-multi-rooms-and-other-t21.html

Maybe this can be added in the next Volumio version as an option.

This already works for me when using mpdroid. https://play.google.com/store/apps/details?id=com.namelessdev.mpdroid
I don’t think it uses soft pause or resume, but it gets your attention when the music suddenly stops. :slight_smile: It obviously only works when the app is running and is connected, so not if you only use the webUI. Only thing missing is that Mpdroid doesn’t recognize spotify…

Thanks for pointing me in the right direction… I was using sound@home, and didn’t realize it was actually a totally separate project. I didn’t realise Volumio used an MPD server, and therefore I could use any MPD client, thanks for the info. I tried MPdroid and it does at least pause on call which is GREAT!

VLC mobile remote has taken my suggestion and now has soft pause / soft resume, and it’s so very much better that way!
play.google.com/store/apps/deta … bileremote

once you experience soft resume on a high powered system, you never want to do it any other way!
The only problem is, my hifiberry sounds way better than my PC, so I would rather use Volumio for music and VLC just for videos.

If I could configure volumio itself to always perform a soft pause and MOST importantly Very soft resume then I could use any app and not be blasted out when I hang up the phone! This would also provide consistent results no matter what interface is used.

I would also like to suggest soft volume changes, instead of just popping over to the new volume level, use the same specified rates to gradually bring the music up or down to the new levels. Here’s how I suggest to implement it in volumio:

allow 2 user settings, one for soft pause, one for soft resume. ask the user to specify how many ms per % they would like… default soft pause to 10, this will make it take one second to get from 100% down to 0% quick enough to answer the phone or turn it down fast to talk to someone… default soft resume to 100, this will take 10 seconds to get from 0 back to 100%, nice and gradual… allow an option to auto-rewind the track X number of seconds… I like to auto rewind 15 seconds, that way if I’m listening along to my favorite song and need to pause it, I’ll know when I resume it, it will be back to where it was after reaching the original volume level. for volume changes, use the pause speed for turning down the volume, and use the resume speed for turning up the volume.

This would provide a much smoother listening experience for everyone by eliminating sudden volume changes. I’m sure everyone here has accidentally went too far with the volume control… if you click on 75% and it’s slowly building after you do that, and it starts getting louder than you want, you can just reduce it before it gets all the way there and smoothly adjust to a comfortable volume without ever suddenly blasting the cones out of your speakers :smiley:

This is definately something to consider implementing in further releases, I agree.

For now, with the use of any MPD client, this will not be something easy to implement. Since your MPD-client interacts directly with the MPD-server, the best way to do this is with the MPD-client itself.

Another way would be to change the webserver. The webserver listens to playback changes (stop/play/next/volume changes etc etc). If the webserver detects stop/pause/play/mute/unmute, you can then let the webserver itself change the volume gradually. This way, when your phone client plays/resumes playback, the webserver will detect it and change volume to 0, and gradually up it to the volume it was.

However, I dont think this will be included in small updates (like the RPi2 update). You either have to do this yourself, or hope it will be implemented in future releases :slight_smile:

Volumio is open source, and available on GitHub. If you manage to get this working, you may do a pull-request do the Volumio repository. This way other people can use it too, and next releases (even small ones) will have it included :slight_smile:

Modifying the web server sounds like a good way to make it work. I have some programming experience, but not specifically with web servers… could someone point me in the right direction as to find where I might find the web server files and perhaps which file handles requests such as pause play and volume control? I certainly wouldn’t mind putting in some time to try to make this work and contribute my efforts if successful.

Find the repository here: https://github.com/volumio

Volumio-WebUI is the one that you need (don’t use WebUI-new).

A note upfront: I am not familiar with this WebUI setup/structure, so I might be totally wrong here.

In the file “Volumio-WebUI/js/volumio.api.js” (https://github.com/volumio/Volumio-WebUI/blob/master/js/volumio.api.js) You can find the “updateGUI”, I believe this is where the changes are processed to the GUI.
The first block in this function is already the stop/pause/play checks. You should probably add something here to change the volume. (I suggest making a new function to change the volume “gradually”, and calling it from the main function to keep the code clean). If you encounter weird stuff, dont forget the volume knob is set in this function as well, which may or may not interfere with your own volume-changing code.

I’m not that familiar with Javascript, so I’m not able to give you some tips/hints/directions, sorry.

If youre not familiar with GitHub and how to do your own changes without modifying the main repository and making pull requests, lots of guides are available on the internet :wink:

Good luck! :slight_smile: