Author Topic: XBMC.Softmute not softmuting  (Read 8854 times)

0 Members and 1 Guest are viewing this topic.

Pudd

  • $upporter
  • Jr. Member
  • *****
  • Posts: 7
  • Karma: 0
    • View Profile
XBMC.Softmute not softmuting
« on: August 12, 2011, 10:49:59 AM »
I've got myself a nice TTS voice but I can't hear it over XBMC.  So, I looked around and excellent, there's a function that fits my needs exactly:  XBMC.SoftMute.

...  Except it isn't working.

Just to make sure I'm not being an idiot (which has been known), I've set XBMC.SoftMute with a parameter of 20 as the first action in a sequence, with XBMC.SoftUnMute as the last action.  Unfortunately, all the commands seem to be working, but the SoftMute isn't lowering the volume while the TTS is speaking.  I've tried using both TTS.Speak and TTS.SpeakSync in case it's SoftUnMuting (if that's a word?  It is now) too quickly.

The commands are as follows for one such example:
XBMC.SoftMute 20
XBMC.Send getcurrentlyplaying
Results.RegEx album:(,*)
TTS.SpeakSync The album is, {match.1}
XBMC.SoftUnMute

VoxCommando version: 0.892
Windows 7 with XBMC 10.1

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: XBMC.Softmute not softmuting
« Reply #1 on: August 12, 2011, 11:49:16 AM »
I've got myself a nice TTS voice but I can't hear it over XBMC.  So, I looked around and excellent, there's a function that fits my needs exactly:  XBMC.SoftMute.

...  Except it isn't working.

Just to make sure I'm not being an idiot (which has been known), I've set XBMC.SoftMute with a parameter of 20 as the first action in a sequence, with XBMC.SoftUnMute as the last action.  Unfortunately, all the commands seem to be working, but the SoftMute isn't lowering the volume while the TTS is speaking.  I've tried using both TTS.Speak and TTS.SpeakSync in case it's SoftUnMuting (if that's a word?  It is now) too quickly.

The commands are as follows for one such example:
XBMC.SoftMute 20
XBMC.Send getcurrentlyplaying
Results.RegEx album:(,*)
TTS.SpeakSync The album is, {match.1}
XBMC.SoftUnMute

VoxCommando version: 0.892
Windows 7 with XBMC 10.1

Hi Pudd, welcome to VC-Forum, you can take a look on the main window of VC. Here can you see executed commands. Can you tell us if all the other commands work in xbmc?

Greetings Kalle
***********  get excited and make things  **********

Pudd

  • $upporter
  • Jr. Member
  • *****
  • Posts: 7
  • Karma: 0
    • View Profile
Re: XBMC.Softmute not softmuting
« Reply #2 on: August 12, 2011, 11:50:29 AM »
Thanks for the welcome :)

Sorry, I forgot to mention that.

All other commands are working fine (that I've tested).  Even XBMC.SoftMute is green in the main window as though it was successful.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: XBMC.Softmute not softmuting
« Reply #3 on: August 12, 2011, 11:54:11 AM »
Sorry, I forgot to mention that.

All other commands are working fine (that I've tested).  Even XBMC.SoftMute is green in the main window as though it was successful.
Ok, that fine.
set the xbmc.softmute command after the results.regex command and test (i'm not sure at the moment, i'm not at home on my PC)

Kalle
***********  get excited and make things  **********

Pudd

  • $upporter
  • Jr. Member
  • *****
  • Posts: 7
  • Karma: 0
    • View Profile
Re: XBMC.Softmute not softmuting
« Reply #4 on: August 12, 2011, 12:11:01 PM »
I've given that a go, but it hasn't worked unfortunately. :(

Again, the main window log says it's successful, and the timing is correct too (it won't SoftUnMute until after the TTS has completed).

Does SoftMute rely on EventGhost by any chance?

Thank you for your time on this :)

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: XBMC.Softmute not softmuting
« Reply #5 on: August 12, 2011, 12:19:15 PM »
I've given that a go, but it hasn't worked unfortunately. :(

Again, the main window log says it's successful, and the timing is correct too (it won't SoftUnMute until after the TTS has completed).

Does SoftMute rely on EventGhost by any chance?

Thank you for your time on this :)
Order now to find a quick solution, you can also use the "set volume" command give value to -5 with a repeat 5 or 7, that reduce the volume softly over 25-35 and at the end you must set volume to 5 with a repeat of 5-7, but that is not a correct solution.

Kalle

PS: sorry for my bad english  :-\

I'm at home in 1 hour, so I can give you the correct solution  ;)  I hope
« Last Edit: August 12, 2011, 12:21:17 PM by Kalle »
***********  get excited and make things  **********

Pudd

  • $upporter
  • Jr. Member
  • *****
  • Posts: 7
  • Karma: 0
    • View Profile
Re: XBMC.Softmute not softmuting
« Reply #6 on: August 12, 2011, 12:26:20 PM »
The only other work around I was thinking of playing with (after my current movie) would be to getVol, reduce the volume, TTS, set volume back to original...  I'll have a play around and if I come up with anything, I'll be sure to post it.

Cheers for the help so far :)

Update:
Just been fiddling, I can't seen to get the volume using XBMC.Send getvolume, but that may be because I'm already using one variable (getcurrentlyplaying).  Is it possible to getcurrentlyplaying, regex the album from it, save that to one variable, get the volume, save that to a second variable, reduce the volume to 20% while TTS says "You're listening to {var.VarAlbum}" and once TTS is done, then setVolume to {var.VarVolume} ?
« Last Edit: August 12, 2011, 12:57:25 PM by Pudd »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC.Softmute not softmuting
« Reply #7 on: August 12, 2011, 01:03:56 PM »
I have never heard reports of problems with softmute before so I suspect that the command is working properly.  I think the most likely culprit is that you are sending digital (ac3 or dts) from XBMC directly to your receiver.  When this happens, neither your system volume, nor your xbmc volume will have any effect.  The digital stream is sent unmolested at 100%.

So on my system, I have no problems when listening to music (stereo signal sent to receiver), but when watching videos with 5.1 sound, I can only control the volume with my receiver volume.  In fact, in this situation, I don't hear TTS at all, and in some cases the TTS actually occurs only after I press stop (or maybe pause).

One possible solution for this (for some people, maybe) would be to send the TTS to a different output via analog sound card to your TV speakers or something like that.

Please confirm if this might be happening to you and if not we'll look deeper into the problem.

You can probably also set logging on XBMC and check to see if the volume is actually being changed by the softmute command.

by the way, what actually happens behind the scenes with xbmc.softmute is that VC queries XBMC for the current volume, then sets it to a percentage (i.e. 20%) and unmute restores it.  The nice thing with softmute is that you should still be able to set the volume in xbmc and softmute will stay muted, but restore to the new volume you set.  This is handy if you want to use softmute in combination with a "listen" button.

Oh, almost forgot.  Welcome Pudd!

edit: no actions rely on eventGhost except for the actual eventGhost action.
« Last Edit: August 12, 2011, 01:11:36 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC.Softmute not softmuting
« Reply #8 on: August 12, 2011, 01:07:38 PM »
Update:
Just been fiddling, I can't seen to get the volume using XBMC.Send getvolume, but that may be because I'm already using one variable (getcurrentlyplaying).  Is it possible to getcurrentlyplaying, regex the album from it, save that to one variable, get the volume, save that to a second variable, reduce the volume to 20% while TTS says "You're listening to {var.VarAlbum}" and once TTS is done, then setVolume to {var.VarVolume} ?

yes, something like this should be possible, but look at my previous post first.

try playing with a command that just does softmute, and then see if it works on the xbmc interface sounds.

Pudd

  • $upporter
  • Jr. Member
  • *****
  • Posts: 7
  • Karma: 0
    • View Profile
Re: XBMC.Softmute not softmuting
« Reply #9 on: August 12, 2011, 01:34:51 PM »
I like to be an awkward one :D

Thank for the welcome JitterJames, and congratulations on an excellent bit of software that's become central to my HTPC!

I've double checked my audio set up, and I'm using a standard analogue output.  The SetVolume command works perfectly, it is just the SoftMute that doesn't.  Is there any difference to the way that XBMC.Send SetVolume(20) and XBMC.SoftMute 20 work?

I've simplified what I'm trying to do just to try and get the hang on it.  New command is an edited volume change with a read back using TTS and is built like this:

XBMC.SoftMute 20
TTS.SpeakSync Volume set to {1}
XBMC.SoftUnMute
XBMC.SendSetVolume({1})

The volume changes to what it should be using the XBMC.Send method, but it doesn't SoftMute or SoftUnMute still.

If I change the softmute to a setvolume(20) it has the intended effect.  But it's only useful because I'm setting the volume in this command.

Question about error handling:  What happens if XBMC.SoftMute can't get the current volume?  Does it abandon the process?  I've noticed that I can't use XBMC.Send GetVolume, whether that's related or not, I don't know.

As for a command that just softmutes, has no effect and a cursory glance doesn't look like anything's logged by XBMC, but I'll need to copy the logs away from the HTPC at a later date to properly look through them.

Again, cheers for the help.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: XBMC.Softmute not softmuting
« Reply #10 on: August 12, 2011, 01:35:07 PM »
The only other work around I was thinking of playing with (after my current movie) would be to getVol, reduce the volume, TTS, set volume back to original...  I'll have a play around and if I come up with anything, I'll be sure to post it.

Cheers for the help so far :)

Update:
Just been fiddling, I can't seen to get the volume using XBMC.Send getvolume, but that may be because I'm already using one variable (getcurrentlyplaying).  Is it possible to getcurrentlyplaying, regex the album from it, save that to one variable, get the volume, save that to a second variable, reduce the volume to 20% while TTS says "You're listening to {var.VarAlbum}" and once TTS is done, then setVolume to {var.VarVolume} ?
Ok, I have test the softmute in the attach file, import this file from the editor window and then "drag and drop" on the left side - this is not my xml - this fueture comes with VC. Test for first "what song is this", when it work, modify the command - "What album is this" - and add a softmute command.

Kalle

PS: The xbmc.softmute without any value works
« Last Edit: August 12, 2011, 01:42:31 PM by Kalle »
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC.Softmute not softmuting
« Reply #11 on: August 12, 2011, 01:46:25 PM »
to be safe, you better update to 0.895

http://voxcommando.com/forum/index.php?topic=567.msg4030#msg4030

I have a vague recollection that there was a bug in the softmute a while back that I fixed...

can you please also export your group and attach it here so I can test it.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: XBMC.Softmute not softmuting
« Reply #12 on: August 12, 2011, 02:02:03 PM »
I've noticed that I can't use XBMC.Send GetVolume, whether that's related or not, I don't know.


yes, it would be related since softmute relies on that command, however the GetVolume command only stores a value it in {lastresult}

so to see what actually comes back you need to follow that command with

OSD.ShowText  {lastresult}

I can't imagine why that command would not work if your other xbmc.send commands are working ok...

as far as errors go, there are 2 ways that it could fail.

1 - unable to connect to xbmc at all either because xbmc not running, or bad port / username / password /firewall settings.  In this case VC should know that there is an error and show it in the history window.
2 - connects fine but xbmc returns an error, in which case you should still see the result in {lastresult} either by using the action  OSD.ShowText, or by mousing over the history window (note: VC main window needs to have focus for popup to work).  It will look something like <html><li>Error: unknown command...

Pudd

  • $upporter
  • Jr. Member
  • *****
  • Posts: 7
  • Karma: 0
    • View Profile
Re: XBMC.Softmute not softmuting
« Reply #13 on: August 12, 2011, 02:32:23 PM »
I didn't know there were updates lurking in the forums....  Just setting that up now, see if it makes a difference.

Using 0.895 and the SoftMute works :D...  Although, for whatever reason it doesn't like my previous commands so it looks like I'll have to rebuild them.  If I try and load my old Voice Commands XML it just crashes VoxCommando.  But, that's no big issue, now I'm getting my hands dirty it'll only take me a half hour to recreate those commands. :D

Thank you for all the help guys, it seems 0.895 was the answer to my problem.

When I used getvolume in 0.892 it wouldn't return anything.  But in 0.895 it returns "<html><li>XX</html>" where XX is the current volume.  Perhaps I set something up wrong or differently between the installations, but it's certainly working fine now.  :)

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: XBMC.Softmute not softmuting
« Reply #14 on: August 12, 2011, 02:39:01 PM »
I didn't know there were updates lurking in the forums....  Just setting that up now, see if it makes a difference.

Using 0.895 and the SoftMute works :D...  Although, for whatever reason it doesn't like my previous commands so it looks like I'll have to rebuild them.  If I try and load my old Voice Commands XML it just crashes VoxCommando.  But, that's no big issue, now I'm getting my hands dirty it'll only take me a half hour to recreate those commands. :D

Thank you for all the help guys, it seems 0.895 was the answer to my problem.

When I used getvolume in 0.892 it wouldn't return anything.  But in 0.895 it returns "<html><li>XX</html>" where XX is the current volume.  Perhaps I set something up wrong or differently between the installations, but it's certainly working fine now.  :)
That's good news, have Fun with this great program  ;)
***********  get excited and make things  **********