Testing and feedback Auto volume skill

I made a skill to auto set the volume level acording to surounding noiceses. Ill think it needs more corrections but is working. I would like feedback both from other devises, mic’s and stuf like that.

How to install Auto Volume skill

msm install https://github.com/andlo/auto-volume-skill 

The skills dosnt use any external servises and do not record anything It does only get mic level readings from mycroft it self.

How to test Auto Volume skill

  • Does it install?
  • After short time he should ajust volumelevel - does he do that (there will be to log info lines when he adjust level)`
  • can you start and stop auto volume by voice - Hey mycroft, Set auto volume off
  • Is the tolerance for what he thinks is low, normal or hig level of noice good enough? (notise he do get a little bit better over time when he have messured lowest and higest noicelevels in surroudings)

Where feedback on Auto Volume skill should be directed at

Any feedback here or as an issue on githun or in Mycroft Chat will be higly aprisiated.

1 Like

Great work, @andlo!

Test parameters

  • Operating system / Device - Ubuntu Linux 18.04 LTS running Ubuntu 18.8.3 unstable branch
  • Logitech H600 USB headset

Key comments and observations

  • The auto adjust of the volume worked well - auto adjust started straight after Mycroft started
  • Starting and stopping auto volume by voice worked well
  • My experience was that the volume “jumped around” too much, and this was distracting from a user experience point of view. From a voice user experience perspective, I think a better way would be to incrementally adjust the volume in small increments over time -for instance below you can see the volume changing from 60% to 35% to 60% again - this was very “jarring”. If it changed incrementally by say 0.5% or 1% every few seconds, I think that would work a lot better.
00:43:39.681 - AutoVolume - INFO - Mic thresh: 13.63806749587457 Low level: 13.563829657921865 High level: 14.261266924139179
00:43:39.681 - AutoVolume - INFO - Setting volume to :60%
00:43:44.687 - AutoVolume - INFO - Mic thresh: 10.04427238023821 Low level: 10.474689800456023 High level: 13.91802916219853
00:43:44.687 - AutoVolume - INFO - Setting volume to :35%
00:43:54.712 - AutoVolume - INFO - Mic thresh: 9.611998459563996 Low level: 9.07557303514786 High level: 13.762571743830957
00:43:54.712 - AutoVolume - INFO - Setting volume to :60%
00:44:04.725 - AutoVolume - INFO - Mic thresh: 8.469629054483443 Low level: 9.057510807276733 High level: 13.760564829623053
00:44:04.725 - AutoVolume - INFO - Setting volume to :35%
00:44:34.788 - AutoVolume - INFO - Mic thresh: 7.481477562467834 Low level: 7.047744344250834 High level: 13.537257444842398
00:44:34.789 - AutoVolume - INFO - Setting volume to :60%
00:44:37.274 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/device/b7a4b2c3-8914-4422-84a9-35659991849f/userSkill?identifier=AutoVolume--2df863a12be7efe2c5f1b1886fa10954 HTTP/1.1" 304 0
00:48:04.663 - AutoVolume - INFO - Mic thresh: 8.402976746169657 Low level: 7.047744344250834 High level: 13.537257444842398
00:48:04.663 - AutoVolume - INFO - Setting volume to :35%
00:48:09.655 - AutoVolume - INFO - Mic thresh: 13.430712176904375 Low level: 7.047744344250834 High level: 13.537257444842398
00:48:09.655 - AutoVolume - INFO - Setting volume to :60%
00:48:24.680 - AutoVolume - INFO - Mic thresh: 13.74284679136502 Low level: 7.047744344250834 High level: 13.537257444842398
00:48:24.680 - AutoVolume - INFO - Setting volume to :75%
00:50:39.421 - AutoVolume - INFO - Mic thresh: 31.948958002875866 Low level: 9.269502292911714 High level: 33.53307898279031
00:50:39.421 - AutoVolume - INFO - Setting volume to :60%

Yah - that is what is making this skill diffucult. How to react and how fast.

Ill think if you were running over longer time, the readings for lowest and highest would differ more than what you are reporting. And then there would be easier for mycroft to know if there is no noice, normal or high.

I can see what you want about slowly change volume, but lets think about that.

If you and I were in a room whith lots of noice, we vould be talking loudly. If the sounds stops (eg. music in the room stops playing) we would lower ouer voiceses imidiatly not slowly.

But a thee skill is right now - the messured level is a avage messured over 2 minutes. so if the noice level is changing the mic readings would show that slowly. Right now i messure mic every second and changing volume every 5 sec.

I could implement that changes is only changing 10% at a time to going from 60% normal voice level to 35 low voice level would gå slowly - first agave on miclevel has to be under lowlevel an then every 5 sec. vol is lowered 10% until 35% is reached.

But again - that isnt how humans does.

By the way - the high, normal and low sound level can be set in settings on home.mycroft.ai.

The way to deside which sound level to use is calculated from
lowest messured mic level + 10% of soundrange (lowest to higest mic level messured) and same for high sound is 10 % lower than higest.

I were thinking of adding settings for that as well, but that would ake it a advanced skill to configure, and would prefear not to, and have the skill adjusting it self somehow.

I were thinking on also adding

Ohh and I see you use a headset @KathyReid. Then I actualy dont think seting audio level auto is a good idea. It iss more ment for room devises tht picks up voice and commands from the room and reply out in the room.

As audio engineering is one of my hobbies, I find this problem very interesting. What you are trying to implement here is a audio leveler / automatic gain control. While your approach is basically correct you probably want to implement a more sophisticated “transfer function” for the gain control.

Some introduction into the topic can be found here: https://www.qsl.net/va3iul/Files/Automatic_Gain_Control.pdf

2 Likes

interesting topic… Bookmarked.

Yes that looks interesting. I need to do some reading then :slight_smile:

I have made small changes - added a way to reset the messurements by “hey mycroft Clear auto volume measurements”.
Did have to use Clear and not reset, as the normal volume skill would take this and reset volume instead :frowning:

As mentioned this skill isnt for use with headsets, and mostly ment for devises in a room where soundlevels would change from time to time.

I have been using this everyday, and are quite happy about it, as mycroft nearly always replyes in a voicelevel that is suited for the situation.

It is also important that this skill has to be running for a time to make hig and low messurements.

I would like to send this skill to market, but someone has to say that it does work as expected :wink:

Hi @andlo thanks so much for all your efforts here. I’ll hopefully be onboarding some more Skill Testers this week so we can get people assisting to test.

1 Like

What a nice idea! @andlo

What is “Auto volume” doing when you play some media?

1 Like

¨That is a good question. I dont know……I will test and try.
I never play media throu mycroft. Uses Spotify and connect to snapcast player in he house.

But I can see there could be a problem if playing media localy. Then auto volume shouldnt adjust. Ill look into it right away.

Ohh I did think about that :slight_smile:

if self.autovolume and not self.audio_service.is_playing:

That says that if auto volume is active and the audio_service isnt playing, then adjust volume :slight_smile:
So if you like me are playing music on Spotify connect on other device, he will adjust volume, as surrounding sound encrese. If playing localy he will not adjust volume.

1 Like

Nice idea. I’ve installed and started testing it. Working fine so far. I’ll keep testing for few days and will give you feedback. :slight_smile:

2 Likes