-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential fix for P25 encryption muting #10
base: master
Are you sure you want to change the base?
Conversation
I'd let you know if this fixed P25 encryption muting, but I cannot currently since I"m unable to build DSD (no makefile). I could also possibly upload a P25 sample, but I wouldn't know where to upload it to. |
Sample files would be a big help to the project. Simply fork the project and add the sample files to the samples directory. Then submit a pull request. Thanks! |
I'll admit to not understanding how Github works at all. With that said, is the potential fix for P25 encryption muting in the master yet, or is somebody actually wanting to test it with some P25 audio samples first? Secondly I did fork the project and am willing to add some audio samples and submit a pull request; however, I don't know the best way to capture the sound (i.e. sample rate, format, etc) Something along the lines of 'arecord -f dat -t wav p25.wav ? |
You can post the samples on Dropbox or another site and link them here. I'll add updated building instructions. |
@mbt25 yes, we'd like to test the P25 muting fix before merging it. @balr0g I agree that we don't want to fill the repo with large amounts of sample data. I would like to have a small set of sample data in the repo to use with unit testing though. These sample clips only need to be a few seconds in length. If the size gets to be a problem we can always make it a sub repo. I've also updated the README last night, it should contain better building instructions now. |
Ok. Does it matter if samples are mono or stereo? |
mono would probably be preferred. |
I lose all audio with this update. |
@mbt25: Is the sample you posted encrypted? I'm seeing a key id of 0x81 (should be 0x80 for unencrypted), and worse, if I disable the detection all I get is gibberish... |
balr0g, I don't think so. There is very little encryption on this system in my area, but it is possible that it was encrypted. I have a longer version of that sample that I'm sure has multiple agencies communicating and is guaranteed to have some unencrypted traffic. But it was a bit larger and so I did not post it. I could have swarn that I listened to the decoded audio while taking the sample and that it was all unencrypted, but I could be wrong. I'll get another sample up shortly that I'll be able to guarantee is unencrypted. |
Yep, encrypted. Sorry about that. Unencrypted will be put up shortly |
Good to know, I was getting ready to post that this fix doesn't work. |
There ya go -- I renamed the encrypted sample and added a guaranteed unencrypted sample |
All right; you did forget to resample it to 48KHz though. At some point I should implement PortAudio support as well as on-the-fly resampling.... |
I think I need to stick with .wav uploads. It was a wav converted to flac after the fact. This wasn't generated by DSD in any fashion. The DSD I have operational on Windows is a version that doesn't support any of that. |
DSD cannot generate wavs or flacs of this sort. I generally use audacity for processing. If you're using audacity, be sure the project rate is set correctly after resampling the track. |
I have a raw file right out of sdr_fm I was using for quick back to back compares of the new versions. I just pipe it right in, 1.4.1 and 1.6.0 plays audio with about the same decode rate, and this patch no audio at all. |
That unencrypted sample was a 96khz wav loaded into audacity, resampled to 48k, and then exported as a flac. Because my uploaded flac was in question, I opened it in Audacity and exported it as a .wav. Then I fed the wav into a previous incarnation of dsd 1.6 where I had commented out all of the automuting code and rebuilt it. It decoded just fine. Well, just fine as far as DSD goes -- DSD isn't anywhere near 100% on a good day. But if you aren't getting any decode at all, it's a problem with the current DSD P25 code, probably related to the automuting code. |
@dreinhold: I'm using OS X here; can you convert it into a wav file if possible? @mbt25: I'm getting a highly unintelligible decode even when automuting is fully disabled. |
@balr0g Doesn't surprise me. DSD is lousy on P25. Sometimes it works great, sometimes it doesn't. I have an application capable of decoding the very same audio at 100%. And, as I said, if I take that flac file, convert it back to a wav, and then feed that wav into DSD 1.6 (a previous incarnation of it), it decodes at probably 75-80%. Is the flac file at fault? I wouldn't know since I don't know how to feed the flac file into DSD. But I know if I take the flac file and convert it back to a .wav and feed the wav in, it decodes as I would expect in DSD. I'm of a strong mindset that there is not anything wrong with the audio I have provided. You say the audio sample is too short; Jared says audio samples should be no more than a few seconds long. I prefer to work with wav files; you guys prefer to work with flac. I'm pretty much damned if I do and damned if i don't. I'm not a programmer, but I'm not a moron either. The audio isn't the issue. Likely DSD is the issue. If you like I can record a nice long P25 file (it'll have encrypted and nonencrypted audio, strong audio and weak signal audio all combined) and upload it to my site, as a wav, and you can download it and work with it if you wish. That's the best I can do. |
@mbt25 what is the other app you use, why do you use dsd if you have something that works 100%. |
@mbt25 I've been able to read flac files directly into DSD like so here is the output of the most recent file you posted:
I had gotten better results from the original file you posted, the only problem was that it was encrypted:
|
@balr0g i will capture a new sample, i would think you could pipe it in using osx also. |
dsd has the following input/output options
|
http://www.tindorconsulting.com/dsd/audiotest note: rawmixed.wav was the source for both tests rawmixed.wav # 44 khz (16-bit mono I think) |
Thanks, Jared. I thought DSD only worked with mbe stuff. The raw_audio_fed_into_dsd.wav is the output from dsd using -r. Worked well. |
Also do keep in mind that for a while now, P25 has worked better if you force it with -f1 -mc, or at the very least -f1. The monitored signal definitely is not QPSK, but recent versions of DSD seem to think it is without forcing. |
Just uploaded a flac version of some voice traffic. I can decode voice in version previous to this patch, but not with the patch ./dsd.1.6.0 -i p25_raw.flac |
@dreinhold run dsd with '-f1 -mc' additional switches. I ran your raw audio through and it sounded significantly better when forcing. |
@mbt25 hmm when it's playing live i normally use -f1 -mq. So you get voice with my sample using this latest patch? |
@dreinhold yes indeed. -f1 -mc works fine for me. Keep in mind I'm not using a DSD 1.6 newer than 7 days ago, and the one I'm using has all automuting commented out. yes I get voice. http://www.tindorconsulting.com/dsd/audiotest -- you'll see what your wav sounds like when I pipe it through my DSD with the -f1 -mc option |
I shouldn't have "yes indeed". I dont know what the last patch is and I haven't compiled anything new in Windows in days. I'm using a binary compiled approx 7 days ago. |
At the very least, you know that if your audio isn't sounding as good as mine, when piping your raw audio wav into your version of dsd using the -f1 -mc switches, then something indeed is wrong with the dsd. |
To import a recorded wav file, use -i /path/to/wavfile.wav. @szechyjs, this probably should be added to the documentation. |
I'm looking at this whole encryption muting and I may need to get a hold of the P25 specs to get any further... Not entirely sure what's going on yet. Add the -pe switch to get output of what DSD thinks the algid/kid are (you should be seeing an algid of 0x80 for unencrypted P25). |
I've updated the README, it should now contain all the input/output options. |
@mbt25 This thread is about a patch @balr0g wanted tested. But when I apply the patch I loose all audio. |
Yeah I'm trying to figure out what's going on. It seems a lot of data is being lost. Probably it isn't helping that DSD doesn't implement the Hamming code error correction used by P25 but rather ignoring all ECC data. For unencrypted frames, mi should be zeros, algid should be 0x80, and kid should be 0.
|
@szechyjs it's also in dsd_main.c in the --help printout. |
I'd test, but I have no idea how to get this all to compile on windows because of sndfile. I don't know where it expects to find it if I do install it. And then, of course, cygWin has to be aware of it. |
@mbt25 from the cywin setup program install libsndfile-devel |
Thanks Jared. Incidentally, I really knew better. What an idiotic brain fart. Ok, I'm testing DSD just compiled from latest sources, and I get zero audio. Raw encrypted audio (right from the audio jack) isn't producing voice. But I it producing a scrolling display of information. Oddly, if I do 'cat some_unencrypted_p25.wav | ./dsd -i /dev/dsp -o /dev/dsp I can hear the decoded audio. |
I'm hearing some traffic. But can't use -f1 or -f1 -mc. And if i don't use switches, it suggests it is QPSK. |
and it appears to still be muting valid unencrypted traffic most of the time. |
Yeah comment out those two if statements that cause "encrypted" traffic to be muted. The actual issue is much bigger — it's not parsing P25 headers properly, and the fact that it discards all the header ECC bits doesn't help at all. |
@balr0g any progress on this issue? |
This may fix the erroneous muting of unencrypted P25 packets. However, I'm lacking a P25 sample and have no way to test it, so can someone please test it and report on whether it works before this is merged?