Change Level of Volume Steps
#1
Is there any way I can change the amount the volume increases/decreases with every button press on my MCE remote?

In its default state, its very slow with every button press so takes about 20 seconds to go from 100% to 50%, I'd like it to drop 10% every button press if possible

This is on openelec
Reply
#2
I had this problem myself. The number of button presses you need to get from zero volume to full is 90. If you want 10% meaning you want zero to full in 10 steps. You need to make a script that does 9 volumeup presses and map that script to the button. I like having 6 steps so I made a script that sends volumeup/volumedown 15 times.(also on openelec)

First make the script for volumeup and volumedown

create a file, call it volumeup.py

inside the file place this code

Code:
import xbmc

xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")
xbmc.executebuiltin("Action(VolumeUp)")

you'll also need a script for volume down

create another file call it volumedown.py

place this inside the file

Code:
import xbmc

xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")
xbmc.executebuiltin("Action(VolumeDown)")

Once you saved them you would need to place them inside the userdata folder
/storage/.xbmc/userdata

(I use filezilla to transfer the files into my pi)

now you would need to know how to map actions to keys
this may help http://kodi.wiki/view/Keymap
unless you already know how to do that
but I'll give you an idea. you need to create a file and called it remote.xml
inside the file you would have code that looks something like


Code:
<keymap>
  <global>
    <remote>
      <volumeplus>RunScript(/storage/.xbmc/userdata/volumeup.py)</volumeplus>
      <volumeminus>RunScript(/storage/.xbmc/userdata/volumedown.py)</volumeminus>
    </remote>
  </global>
</keymap>

this all depends on the keynames of you button that you press (if that page doesn't help, hopefully someone will chime in). xbmc might see your keyname as something else, but this is default name for volume up buttons

so where I put
<volumeplus>RunScript(/storage/.xbmc/userdata/volumeup.py)</volumeplus>
the keyname is "volumeplus" if you was showing a different keyname then it would be
<keyname>RunScript(/storage/.xbmc/userdata/volumeup.py)</keyname> (repplacing "keyname" with whatever yours is called)

after you created remote.xml and saved it you would need to place this inside keymaps folder
/storage/.xbmc/userdata/keymaps

then reboot and it should work i.e when you press volume up it executes your volumeup script telling xbmc to press volume up 9 times (or volumedown 9 times)

I'm using this on a pi and there is a delay of about a second from pressing a button and getting my action done, on more capable hardware I except this to be a none issue. but it works and I know if I want half the volume I only press volumedown 3 times on my remote, wait a second and xbmc does the rest. Smile

notes
some remtoes are seen as keyboards to xbmc. so when creating the remote.xml you should rename it to keyboard.xml
also you would need to change a few things in the file. so where ever I put remote you would replace it with keyboard.

It sounds like alot but its not really.I don't come on that often but if you get stuck and no one comes in to help I'll reply but not sure when. good luck

P.S. I wrote a little guide on how to find out what the name of the keys on your remote
http://forums.tvaddons.ag/threads/7920-M...-ONE-CLICK
the site is down at the moment but once its back up that will help you plug the holes
Reply
#3
It would be nice if a nice dev would somehow write some code that lets us chose the increments of how much volume goes up/down by. we already got so much customisation and this would be a nice benefit. this can be an option in advancesettings.xml file. thanks
Reply
#4
Thanks MediaPi, thats worked but it seems really slow in registering the button presses, like a 5 second delay

Hopefully someone can give us some in built options
Reply
#5
This has been my pet peeve ever since I started using XBMC. Adjusting volume takes ages.
Reply
#6
jurm for me theres a delay of about a second and a half, are you on gotham? have you overclocked your pi. under 2 seconds is doable for me but 5 seconds is abit much.

+1 to saku
Reply

Logout Mark Read Team Forum Stats Members Help
Change Level of Volume Steps0