[REQUEST/ASSISTANCE] Script to generate tone to keep speakers from going to stand-by
#1
I would like to get the Maxell SSB-1 speakers to give a low-profile audio upgrade to our tv, but the reviews all indicate that there is an automatic sleep timer that is extremely short (only duration listed said "several seconds") and that it has a 5-8 second delay when coming back. Obviously this would be an issue for pausing and even starting videos.

SSB-1 Specs:
Model: SSB-1
·Color: Black
·Speaker:
Front Subwoofer
Impedance .........3 Ω Impedance .........6 Ω
Rated Power......10W Rated Power......30W
·Power Requirements: AC120V - 60Hz
·Power Consumption: 6.5W
·Configuration: 2.1 Channel System With 7.5W x 2 + 15W
·Sensitivity: 500mv/47KΩ
·Frequency: 40Hz - 20KHz (+0 / -3dB)
·Input: Two 3.5mm Aux Jacks For MP3 Compatibility
·Item #: 193002
·Item UPC #: 0-25215-19928-8
·Item Pack Size: (LxWxH) 23"x2"x8.5"
·Item Pack Weight: 3.55 lbs
·Case Carton UPC #: 100-25215-19288-0
·Case Pk./Carton Size: (6) 25.6"x10.35"x12.48"
·Carton Cube/Weight: 1.91/14.5 lbs


So here's the plan: I would like to script/have scripted something that could generate a tone (20-40Hz) anytime that XBMC does not have the screensaver activated that could keep the speakers from sleeping. As well as possibly a system menu entry to enable/disable it and even change the frequency. I've sent Maxell's tech support a message asking about the frequency range that it recognizes and would keep it from sleeping, but I'm assuming that I'll just have to play with it until I get it right. They've told me that the amplitude has to be at least 10mV, but that's about it.

Although I have a little background in simple C++, I'm not sure where to start with a XBMC add-on so any help would be very much appreciated.

From a few quick searches, I've found a snippet of code on stackoverflow that sounds as if it could help
Code:
import math
import wave
import struct

def synthComplex(freq=[440],coef=[1], datasize=10000, fname="test.wav"):
    frate = 44100.00  
    amp=8000.0
    sine_list=[]
    for x in range(datasize):
        samp = 0
        for k in range(len(freq)):
            samp = samp + coef[k] * math.sin(2*math.pi*freq[k]*(x/frate))
        sine_list.append(samp)
    wav_file=wave.open(fname,"w")
    nchannels = 1
    sampwidth = 2
    framerate = int(frate)
    nframes=datasize
    comptype= "NONE"
    compname= "not compressed"
    wav_file.setparams((nchannels, sampwidth, framerate, nframes, comptype, compname))
    for s in sine_list:
        wav_file.writeframes(struct.pack('h', int(s*amp/2)))
    wav_file.close()

synthComplex([440,880,1200], [0.4,0.3,0.1], 30000, "tone.wav")

From here, in theory, the frequency and amplitude could be swapped for variables (can I use them as is?) and mapped to a gui. Then throw a couple if statements for a enable/disable toggle as well as if the screensaver is active or something is playing and map them to the gui as well.

GUI Settings:
Enable checkbox
Frequency
Amplitude

Again, I've only got a background in some C++ and could use some help putting the pieces together for this.

Thank you
Reply
#2
Could anyone please point me in the right direction to start this little project? I just need someone to lay it out for me and I can take care of the rest.

Thank you
Reply
#3
pre-Frodo support continues silent audio stream if i'm not mistaken. Needs to be enabled in as.xml
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#4
Very nice suggestion. Though from what I've read, it is an AudioEngine feature for Frodo.

And since I haven't bought the speaker yet, I can't test it for a bit and the explanation into how it works is pretty slim. Do you possibly know if it outputs a near-silent stream for analog devices or completely silent that technically doesn't actually produce a sound, but rather does something else to trick the soundcard?

For others searching:
Code:
<advancedsettings>
   <audio>
     <streamsilence>1</streamsilence>
   </audio>
</advancedsettings>
Reply

Logout Mark Read Team Forum Stats Members Help
[REQUEST/ASSISTANCE] Script to generate tone to keep speakers from going to stand-by1