How to read the volume level with

Thanks for the details! Really appreciate it.

I can see that a faded daemon makes sense – particular when you don’t want to fade now, but a some time in the future. Certainly more flexible, but also a lot more complex.

Thanks for the clarification of your desired use case. I can see that as a valid value add. At first glance, I think this would not be difficult. I will try to get this use case covered in my implementation of fading.

Would it suffice to simply be able to run a command like:

roon_fade now

If so, what do you want the behavior to look like after an immediate fade? Pause or stop replay? Continue muted replay until another command is issued indicating fade back in?

Note that to mute Roon audio you can currently use roon -c mute or roon -c mute_all to mute audio in the default zone or all zones. To unmute, re-issue the same command. This is what I use when the phone rings but it is maybe not as graceful as a fade. I just discovered a bug with mute_all but it still seems to work.

I’ll get right on it!

I’ve committed a first pass at “immediate mode” volume fading. I’m still working on it but wanted to give you a peek at where I’m going to get any feedback you may have. To grab the latest changes, do a git pull in your cloned RoonCommandLine directory and copy bin/roon_fade to /usr/local/Roon/bin/roon_fade. Only this one file changed (other than corresponding changes to its man page) so it is only necessary to update the roon_fade command.

Currently how I have implemented this is to add support for a now argument - the command roon_fade now fades volume immediately. After fading in this manner it then prompts to restore volume or stop playback and exit. Immediate fade also pauses playback then restores playback if you respond ‘y’ to restore volume.

Let me know what you think, this is very much still a work in progress.

1 Like

Thanks @Ronald_Record. Just saw your update. Will pull your changes later. You are very quick.


By the way, was I correct that your use case is fading at the end of the track?

Yes, fading at the end of the track was what I tackled. I misunderstood your use case but hopefully now both our use cases are covered.

Yes, I am quick :slight_smile:

This feature is isolated from the rest of RoonCommandLine fairly well so I am more comfortable pushing changes to fading in that regard. Also, I subscribe to the open source motto of “Release early and release often”. Finally, with this particular change - immediate fading, most of the work was just copying code from roon_faded to roon_fade. The roon_fade now command handles fading similar to how it is done in roon_faded, disabling the daemon temporarily if it is running. So there is not a lot of “new” code in this change.

The fading works indeed. Thanks for this.

It feels correct when I am playing music and then issue

roon_fade now 

it does fade out and stops the music. :smile:

I am not so keen that it then asks for user input (I like usually command which do their thing and finish) to do something. Plus when i say no, it needs a long time to return (I guess it “fades in” the stopped music).

The other case, when I am not playing music, is a bit weird. I issue roon_fade now and the first thing the command does is nothing (well, I guess it “fades out” the stopped music), then I have to say “y” and then, finally it starts playing with the fading.

Finally, the fade time in teh comamnd line argumet and in the config varaible FADE_TIME does seem be in units of maybe 1/7 sec: E.g. setting FADE_TIME=100 gives me approx 15sec fade out or fade in.

After a very brief look at your fade_ou function, I think, the factor for outdiv might need to be modified to get the FADE_TIME units to full seconds? But this is probably system-depended. Maybe not too important…

For me a more natural behaviour is when fade now works like a toggle:

  • If the music is playing, the command just fades out and stops the music (and set the volume back to the volume level at the beginning of the fade).

  • If the music is stopped or paused and you issue the command, it remembers the current volume level, then while starting t play it fades in from zero to the remembered volume level.

I think then there is no need for a separate FADE_IN config variable…

Of course if somebody doesn’t like toggle commands, two separate commando fade now-in and fade now-out would do the trick too.

I will see whether I can wack something up over Xmas…

@hallo_leo good feedback, thanks for testing and for your suggestions. I agree, the default mode for immediate fading should be non-interactive and roon_fade now should act like a toggle. This should be fairly easy to implement and test. I will have that ready today or tomorrow.

However, I would also like an interactive mode. I forgot which zone(s) I am fading in, which I am not, what the fade duration is, tell me what’s going on and where, then show me my options. Interactive mode should only be presented if requested. Implementing what I envision with this may take a few more days.

I will have to dig a little to figure out what is going on with the FADE_TIME calculation. Thanks for the report. I have not noticed that on my system but will perform additional tests to see what’s going on. And take a look at FADE_IN as well. I am sure I can simplify things a bit, especially in the immediate fade mode.

I got to thinking about your fading use case where the phone rings and you want the music to fade out. I thought this would be a good use case for voice control of Roon. Just say “Hey Siri, fade roon” and that triggers an iOS shortcut which executes roon_fade now. But, this doesn’t work if the command is interactive and waiting for keyboard input sometimes. It needs to be non-interactive to automate with voice control.

Your feedback has been very helpful. Things are going to get hectic here so I am not sure when I will have all this tied together in a release. I’d like to get a new release out before my last minute Christmas shopping panic but probably should shop first and release later. Enjoy the holidays!

Thanks @Ronald_Record

Agreed.

Agreed again. :smile: I have an observation about non-interactive use at the meoment. Will make a new topic about t.

Please do your shopping first! (I have to do mine as well…) There’s no urgency for this feature. As said maybe I can cobble something up in the Xmas-New Year break.

Same to you.