Closed Astriel closed 6 years ago
Hi,
Sorry to hear it isn't working, but no, quiet.js is presently working fine, so the issue will be specific to your setup.
For actually transmitting data, I do recommend the ultrasonic mode as it works much better.
How far apart are the speaker and mic? How are they oriented? Have you tried having a laptop receive itself, just as a starting point?
A lot of this varies with hardware. It's hard to guess how quiet will behave in a new environment. I do know that quiet works quite well on macbook pros, but not sure if that's what your setup is
Hello Brian,
I sent you an email in parallal of that issue on Github. First of all, thanks a lot for the answer, it's good to see that this project is still active, not like some others plugins I've already seen.
I saw that indeed there is not that many issues open so I'm sure that it's comming from my setup / hardware because I don't have any error in the console.
I made some new tests with only ultrasonic mode. It seems to work because my dog can hear it. It's less aggressive than another plugin I already found.
For the test I did this morning the two computers were really close to each others with no noise in the background. They were stucked to eachothers, not one in front of the other. Mics seem to be on, and speakers were at full strenght.
So to give you more information :
It seems to appear when I do that with two different machines.
Do you have any tips or advices ? This is for a startup project and I'm really interested in that technology. I sent you by the way an email yesterday to know more about it.
Thanks for your answer !
@Astriel Are the lids on the laptops open or closed? I know for my laptop, it can receive itself with lid closed but its mic cannot hear other speakers like that
@Astriel One other thing I'm curious about is whether there might be sample rate issues at play. An interesting test to try here would be to record the tones emitted on the receiving computer with Audacity, then select the part where the data was being transmitted (should be pretty easy to see) and do a frequency plot (Analyze > Plot Spectrum). If the energy doesn't appear in the same frequency range on both computers then something is likely wrong.
Sorry to hear it isn't working for you right away. From what I can tell, people generally have had good success with quiet.js but I don't have a lot of testing on various hardware
This is really funny because I faced some technical issues also with a similar library not maintaned anymore called : sonicnet.js. I decided to give up this one so that's where I discovered yours !
First of all, you don't have to be sorry, this is the life of a technical guy ! Try, find new solution until the good one is found. And I'm pretty sure QuietJS can help me a lot to solve my technical challenge that's why I'll try to give as much information as possible for other people who will use it but also to help you with more tests.
On the laptops, lids were open on both my computer and the macbook pro. They were both opened and vertical.
I'm glad that other people made it work, I'm sure I'll succeed. I can give you information about my hardware to create different tests case. I have so far :
I can try with as many combination as possible and provide you with my results.
It's 11 PM here I only have the macbook pro and my computer but I can try and provide you with results if you want ?
Bad news, I wanted to try it again today on both Windows computer. But impossible to make it work even on only one computer with one tab to emit and another tab to receive. When I check on Audacity, frequencies never go higher than 7000 HZ ... Something is likely wrong am I right ?
Furthermore my dog is not making any reactions anymore ... So I guess something is wrong. I had a Windows 10 update today not sure it's because of that ...
Hm, I've never heard of anything like this happening. I wonder if something else has taken over the sound card and set it to a lower sampling rate. I'm not sure how you would check that in Windows though
It happens on both my computer. And it's also not working on my cellphone when I open two tabs ... Is it comming from Google Chrome ? Is there anything special to do to make it work ? By the way I'm using this link : https://quiet.github.io/quiet-js/
Should I try the local version ?
I tried on FireFox. Still the same issue. I tried on the other computer, still the same, and same for my cellphone.
Here is a link of the recording of the sound emiting by my computer on UltraSound mode : https://www.dropbox.com/s/nrg78jrn41xw466/QuietJS.aup?dl=0
It's really weird because my dog has no reaction ... And the noise emittied from my computer is more like a : Phssssssst, and no ultrasounds.
Do you have any ideas where it can comes from ?
PS : You can hear me click on Audacity, but the : PHSSSSST at the end of the file is what's emitting from my computer.
Hello @brian-armstrong, did you have the time to check out the sample I sent you ? I would be interested to deepdive in the plugin with you. This is something that can make me reach my startup goals.
Hi @Astriel
I tried your download but it seems to just be the Audacity project metadata without the actual sound, so I can't check anything with it.
Just to give you some idea of what it looks like when it works, here's some example data running through ultrasonic-experimental. This is encoded directly to a file so there's no background noise. Note the high energy around the 19kHz part of the spectrum http://i.imgur.com/Y9wc89W.jpg
Well actually I recorded everything that went through my computer, but not high pitch of frequence at all which is really weird. Can I use the https://quiet.github.io/quiet-js/lab.html to make some tests ?
Should I select in the list : ultrasonic-experimental ? This is what I tried this morning.
Here is an example of what it looks like on my computer with volume to 20%, and the ultrasonic experimental. It's the same on my mobile :
Like you see, 0 frame received, and 0 frame lost which is very weird, and no ultrasounds are shown on the graph at all.
Yeah, the lab is a good place to start. It's running an outdated version of quiet that doesn't support ultrasonic-experimental but does support other ultrasonic modes
When you tried it, did you see the modem energy in the spectrograph?
Looks like I responded to the pre-edited version. Do you see the energy show up on the audible profile? Is there some point where it disappears as you shift the center frequency up?
No problem for the answer, I think the lab will be better to help me reach the goal to understand why it can't work on my work labtop. I'll do my test with 'ultrasonic' mod from now.
I see the energy showing up on the audible profile. Here is the picture : seems to be between 2K and 4K. My volume is up to 20%. It's a "PHSSSST" for the noise. Here is the audible result :
Still no frames received or sent. Same on my cellphone.
Can you run the code shown in https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/sampleRate in your console on that page and tell me what it reports for sample rate?
As for why you don't see any frames lost, I suspect this is just the long timeout it gives. The frame counters are reset every time one of the controls is changed. You'll likely see frames lost increasing after letting the lab sit for a minute or so, though if you don't that is definitely a bug
If I execute this code on either Google Chrome or Firefox (on my computer with Windows 10), and with : audible mod, and the default profile values :
var AudioContext = window.AudioContext || window.webkitAudioContext; var audioCtx = new AudioContext(); // Older webkit/blink browsers require a prefix console.log(audioCtx.sampleRate);
This code gives me the same thing :
var audioCtx = new AudioContext(); var mySampleRate = audioCtx.sampleRate;
I got undefined on each case. Which seems to say that the AudioContext can't be found ?
And indeed I can't see any frames lost which is weird.
I got the frames lost after 20 seconds more or less !
Well, audioctx has to exist since you are seeing the speaker and mic work. I'm not sure why those examples return undefined. Maybe try it in a new/empty tab?
The error youre seeing sounds like some program you have running is setting your soundcard sample rate to 16kHz. It might be the soundcard itself, but you said it worked previously.
One thing you might try is going to Sound properties (in Windows) and adjusting default sample rate to 44100 Hz for speakers and microphone. I believe you get there by right clicking the speaker icon in tray > Recording devices > Right click your default microphone > Properties > Advanced tab.
I agree that it has to exists, because at least my computer is able to go up to 8 KhZ but on an empty tab / private nagivation still the same problem, it's returning me undefined.
So I went into the parameters like you advised me. And I think that a sound component of my computer was desactivated which can explain why it was not working fine. So I activated back and now on the lab it seems to work : http://imgur.com/a/6wCjC
Still the code you gave me is returning me undefined in the console of the browser even if it works fine now. Which is still weird.
So now from the demo I'm able on the same computer and browser to make it work. So I know that my computer can receive and send ultrasounds.
I've made some tests on my cellphone : ASUS, Android with Google Chrome and I launched the lab in ultrasonic mod, same problem, the cellphone can't emit ultrasounds. And when my computer is sending a message, seems like my phone is not able to "hear" it because it's not showing at all on the graph of the lab (no peak of energy between 18KhZ and 20KhZ).
I tried with my cellphone mic stucked to my labtop sound part but still nothing. Is there anything I need to configure on my cellphone to make it work ?
@Astriel
Just to confirm, have you tried audible mode on your phone? Can you hear that at all?
Also, what model is the phone specifically?
I've tried the audible mode on my phone.
For the ultrasonic mod, I tried with the same test case, but it's not working. I also tried with volume at 20% on the cellphone when emitting, and same on the computer with emitting.
When you did your test, was the distance like this ? Do you know what can be wrong with the ultrasonic mod on the cellphone ? Maybe the speakers are not "high" enough to transmit it ?
The model of my phone is a : Asus zenfone 2 ZE550ML. And I was using Chrome for all my tests.
I'm gave you details by mail a time ago to describe you what I'm going to achieve for my startup and I'm sure it can help me reach my goal.
Maybe I need to "create" a new profile to increase intensity of the signal if it's possible ? I tried the lab on the cellphone, It seems that it's not possible to emit ultrasounds with it which is weird ...
Making it louder will typically make it less likely to be received. Playing louder will usually just introduce more distortion. Generally you want cleaner, not louder.
You'll have better luck with the ultrasonic-experimental profile if you can get it working. It does some things dfferently that the other profiles don't which makes it work better, usually good to 1m or so in my testing. But it seems like you're facing some difficulties in getting your phone to play frequencies that high for whatever reason, my guess being that your sampling rate is set low. I don't know of any way to adjust how this works om Android and every Android phone is a little different unfortunately.
If you were going to try making another profile, I'd recommend cloning ultrasonic-experimental, and then just change the center frequency to something lower, maybe 10000 or so. Make sure that you have the same profile on both devices. You can move center frequency around to try to figure out what works on your phone.
This is logical for the ultrasound mod. I'll do my tests now with a volume around 20% which seems a good value to start. I'll try to transmit first from my computer to the mobile.
For the ultrasonic-experimental, is it what's used on the demo page ? (Not the lab one). If the distance is up to 1 meter this is a really good start ! I'll try to reach that goal and keep you in touch. Indeed I think it comes from my phone to play high frequencies, I'll try to modify the sampling rate.
Best to test and modify frequencies is to download the demo and make it work locally to change the profile ?
Yep, that's the mode used by that demo
There's an example you can try, it's like a stripped down version of the demo page. Should be enough to test it with your own profile. I believe there's a data- attribute in the html files that configures which profile it uses https://github.com/quiet/quiet-js/tree/master/examples/text
Is it possible to make some test from the online demo page : github.com/quiet/quiet-js and to change the profile from here or do I have to download the project and execute it locally ?
Indeed there is a data attribute there to change the profile, so I think I need to change it to : ultrasonic-experimental mod.
<div class="hidden" data-quiet-profile-name="audible"></div>
I deployed the example page on my server : https://phpstack-97645-276769.cloudwaysapps.com/examples/ultrasonic/sendtext.html https://phpstack-97645-276769.cloudwaysapps.com/examples/ultrasonic/receivetext.html
But unfortunatly, each time I'm trying to send a message on a tab, to receive it on another one on my own computer, it makes Google Chrome crash because of a lost of memory. I'll try to investigate on that.
Ack! Sorry about that, it's a bug I've known about for a while and need to fix
When you do .init() in the Transmitter, add clampFrame: false to the options. That should get your setup working
Don't worry that's okay ! I was just surprised ahah !
The code has to be like this in sendtext.js ?
Quiet.init({ profilesPrefix: "/", memoryInitializerPrefix: "/", libfecPrefix: "/", clampFrame: false });
Ah sorry I just remembered, it's actually part of creating the transmitter, on line 37 in the example sendtext.js. You'll want to add it as a key/value there
Perfect ! Works like a charm now ! Good game dude !
So, with this profile in ultrasonic-experimental mod which I kept the one by default, my computer on Chrome is able to send an ulstrasound and hearing himself which is good with the volume at 20%.
Now I tried with my cellphone on Chrome, to my labtop on Chrome :
` "ultrasonic-experimental": { "mod_scheme": "bpsk", "checksum_scheme": "crc32", "inner_fec_scheme": "rs8", "outer_fec_scheme": "v29", "frame_length": 100, "modulation": { "center_frequency": 19000, "gain": 0.2 },
"interpolation": {
"shape": "kaiser",
"samples_per_symbol": 10,
"symbol_delay": 4,
"excess_bandwidth": 0.31
},
"encoder_filters": {
"dc_filter_alpha": 0.01
},
"resampler": {
"delay": 13,
"bandwidth": 0.45,
"attenuation": 60,
"filter_bank_size": 64
},`
So now I guess I have to try with another frequency like 10000 ? If it was like on my labtop, it was not able to hear or emit after 8000, so maybe I should try that at first ?
Awesome stuff!
Yeah, starting low might be the way to go. That profile is about 2kHz wide, meaning if it's centered at 8000 then it will run 7000-9000. So if you're limited to 8k then you might need to go a little lower
I'd recommend trying to stay as high as you can, since ambient noise is generally low frequency. But you'll have to go as low as you need to to get around sample rate limitations (if that is indeed the issue)
@Astriel
Any luck with that? I'd love to know what you found out
@brian-armstrong
Hey there ! I was pretty busy with other code, I put on the side testing for now, but I'll start again soon and keep you in touch. I really like this library but struggling to make it work especially with mobiles.
@brian-armstrong,
I'm sorry for that silence period. To be honest, I've been studying another library called CHIRP.IO. Which is working simiary than yours, but of course, not for free and with huge limitations about the protocols your technology doesn't have. And if I would have the choice I would still go for yours.
But I was very unlucky to make it work which is very weird if you tell me it still works on your side, and same for other people. I'll try to make new tests, but I have to admit I don't know where to start again.
I really need it for my proof of concept but this is really time consuming, and all the time I'm invested to make it work is less time for the rest of the platform I could focus on.
I found it still very weird it's not working for my cellphone and my labtop.
If you go to their page and try the demo, the sounds is emiting well and my cellphone can even receive the signal.
Their standard SDKs use frequencies between around 2kHz and 12kHz. Their ultrasonic SDKs operate in the region of 19kHz.
So it means it's not tally coming from my side.
Hey @Astriel , I'd be happy to help, possibly we could try one of the suggestions I've already provided. As I commented before, if you can get a recording from either the laptop or phone (or both) and provide those here, that would be a good start. Also, my suggestion from June 7 about moving ultrasonic-experimental into the audible range might be interesting to try as well
@brian-armstrong ,
I'll this week reinstall the project on my server and try the different approaches we talked about. That could help solving some issues maybe ! I'll keep you in touch depending on my tests.
@brian-armstrong,
Does the mobile version accept audible approach to transfer data?
Hello there,
I tried the online example here from two computers, mine and the one of my girlfriend. Both are on Windows 10. I used Chrome for the test. Both speakers and microphone were ON. No error on the console, but it was impossible to receive any data either from mine or her.
When I send with audible mode, I can hear something, not with ultrasounds, so hard to check if it works.
Did someone had a problem to make it work or do you know if there is an issue at the moment ?
All the best.