Hi sylvain. I have to declare i as a variable but where ?. I told You I was a newbie !!. Forgive Me. Graham.
________________________________ From: "tetra-request@lists.osmocom.org" tetra-request@lists.osmocom.org To: tetra@lists.osmocom.org Sent: Sunday, 25 September 2011, 11:00 Subject: tetra Digest, Vol 9, Issue 5
Send tetra mailing list submissions to tetra@lists.osmocom.org
To subscribe or unsubscribe via the World Wide Web, visit https://lists.osmocom.org/mailman/listinfo/tetra or, via email, send a message with subject or body 'help' to tetra-request@lists.osmocom.org
You can reach the person managing the list at tetra-owner@lists.osmocom.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of tetra digest..."
Today's Topics:
1. Re: tetra Digest, Vol 9, Issue 3 (Sylvain Munaut) On Sat, Sep 24, 2011 at 8:56 PM, Graham Palmer graham.palmer69@yahoo.co.uk wrote:
Hi again. We have the etsi cdecoder and speech decoder which works fine with sample code what we need is to link it with real time bitstream from osmo tetra decode. I understood this had already been achieved with Dieter's proof of concept code. Any chance of viewing this code even if incomplete ?.
It doesn't apply anymore because of a lot of change in the code since then.
This should save the data in the bursts : 1) It's completely untested but that's where Dieters POC got the bits previously 2) It saves the data as '0' and '1' in a text file, you may need to change the etsi codec to read that 3) It will only give out garbage is there is multiple voice channel at once since it doesn't do any meta data interpretation to isolate channels and just save anything that's traffic (that was a limitation of dieter's POC as well) 4) I'm pretty sure it saves 'packet data' as well which obviously gives garbage.
diff --git a/src/lower_mac/tetra_lower_mac.c b/src/lower_mac/tetra_lower_mac.c index 7b62bb4..8a41ccb 100644 --- a/src/lower_mac/tetra_lower_mac.c +++ b/src/lower_mac/tetra_lower_mac.c @@ -184,6 +184,15 @@ void tp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned DEBUGP("%s %s type4: %s\n", tbp->name, time_str, osmo_ubit_dump(type4, tbp->type345_bits));
+ if (tms->cur_burst.is_traffic) { + FILE *f = fopen("traffic.out", "ab"); + + for(i = 0; i < 216*2; i++) + fprintf(f, "%d", bits[i]); + + fclose(f); + } + if (tbp->interleave_a) { /* Run block deinterleaving: type-3 bits */ block_deinterleave(tbp->type345_bits, tbp->interleave_a, type4, type3);
_______________________________________________ tetra mailing list tetra@lists.osmocom.org https://lists.osmocom.org/mailman/listinfo/tetra
Hi,
I have to declare i as a variable but where ?. I told You I was a newbie !!. Forgive Me.
Don't bother, I wrote that code from memory mostly as just an example of where to get tap the data, not really meant as a directly working code. So if you have trouble with a non declared variable, I doubt you'll make it working.
Just wait for Dieter to post the capture the mentionned earlier and I'll make sure to push something that can read those when they're available.
Cheers.
Sylvain
On Sun, 25 Sep 2011 19:42:37 +0200, Sylvain Munaut wrote:
Don't bother, I wrote that code from memory mostly as just an example of where to get tap the data, not really meant as a directly working code. So if you have trouble with a non declared variable, I doubt you'll make it working.
Just wait for Dieter to post the capture the mentionned earlier and I'll make sure to push something that can read those when they're available.
I managed to get some kind-of-working code out of your snippet, i can also chop it off in pieces based on the timeslot, but i can't properly convert the bitstream in the 16-bit samples which the speed decoder want as input of cdecoder. Is anybody in this list willing to share some sample captures which have audio in them? I'm going to release the code as soon as it produce something meaningful for the speech decoder. Cheers!
Ciaby
What do you need? WAV audio? Or bits? I can do some real life recordings for you.
2011/9/27, ciaby ciaby@autistici.org:
On Sun, 25 Sep 2011 19:42:37 +0200, Sylvain Munaut wrote:
Don't bother, I wrote that code from memory mostly as just an example of where to get tap the data, not really meant as a directly working code. So if you have trouble with a non declared variable, I doubt you'll make it working.
Just wait for Dieter to post the capture the mentionned earlier and I'll make sure to push something that can read those when they're available.
I managed to get some kind-of-working code out of your snippet, i can also chop it off in pieces based on the timeslot, but i can't properly convert the bitstream in the 16-bit samples which the speed decoder want as input of cdecoder. Is anybody in this list willing to share some sample captures which have audio in them? I'm going to release the code as soon as it produce something meaningful for the speech decoder. Cheers!
Ciaby
Ok, no luck in decoding the samples... I can't manage to get the bitstream out in the proper way. I compiled the fromansi and toansi utilities from the etsi samples, i can output the full frame in 16-bit format, but cdecoder never accept it as a valid input (always complaining that the frame is wrong/corrupted). What am i doing wrong? This is what i tried to so far:
if (tms->cur_burst.is_traffic) { FILE *f = fopen("traffic.out", "ab"); for(i = 0; i < 432; i++) { bit=bits[i]; fwrite(&bit,sizeof(uint8_t),1,f); fwrite(&zero,sizeof(uint8_t),1,f); } fclose(f);
Which should produce an output file with 16-bit samples, each containing one bit of information. Then use ./toansi to convert into a format which is compatible by the etsi codec, use cdecoder to decode the channel and sdecoder to convert the speech frame into a pcm file. However, it doesn't work. Ideas? :) Cheers!
Ciaby
On Tue, 27 Sep 2011 16:09:18 +0200, Pepijn van den Berkhof wrote:
What do you need? WAV audio? Or bits? I can do some real life recordings for you.
Bits, after the conversion with float_to_bits. Unencrypted speech, of course ;-) Tnx!
Ciaby
Ofcourse unencrypted :-) but there is a pretty active tetra network near me so I'll make some recordings of it when I get home.
There are some examples with te ETSI code aswell. Maybe you can use those aswell.
Regards,
Pepijn
2011/9/27, ciaby ciaby@autistici.org:
On Tue, 27 Sep 2011 16:09:18 +0200, Pepijn van den Berkhof wrote:
What do you need? WAV audio? Or bits? I can do some real life recordings for you.
Bits, after the conversion with float_to_bits. Unencrypted speech, of course ;-) Tnx!
Ciaby
Hi Ciab,
here are 100MB+ samples from different channels of our motorola tetra network, hope it will help you
http://www.assr.us/tetracapture/cpt.bits.tar.gz http://www.assr.us/tetracapture/cpt1.bits.tar.gz http://www.assr.us/tetracapture/cpt2.bits.tar.gz
I've also tried to create the bit stream with this patch
if (tms->cur_burst.is_traffic) { FILE *f = fopen("traffic.out", "ab"); fwrite(bits,sizeof(bits),216*2,f); fclose(f); }
since it's not word16 it doesn't work either :(
Good luck, Vlad.
On Wed, 2011-09-28 at 09:40 +0200, ciaby wrote:
On Tue, 27 Sep 2011 18:19:23 +0200, vladimir@suriva.sk wrote:
Hi Ciaby,
here is sample capture of local tetra network with 2000+ terminals, bits after conversion, of course. If a longer capture is useful for you, let me know, I'll upload it on my ftp.
Cheers, Vlad.
Hi Vlad, your capture is interesting, but doesn't contain any speech frames. Can you make a longer one, compress it and upload it on the ftp? I'm struggling since 2 days to get the code working, but i don't have a decent sample to work with :-) Thanks again!
Ciaby
I've also tried to create the bit stream with this patch
If I said "don't bother" earlier, there was a reason, there was quite a few things wrong with what I posted and unless you tried actually reading the specs to fix it, you had no hope whatsoever of making it work.
I now created a sylvain/tch branch with a version that creates multiple traffic_xx.out files based on the DL_USAGE value to try and demultiplex a bit. There are 2 other 'demux hack' commented in the code,one based on timeslot and one based
tetra-rx data.bits cdecoder traffic_XX.out traffic_XX.codec sdecoder traffic_XX.codec traffic_XX.pcm aplay -fS16_LE traffic_XX.pcm
Cheers,
Sylvain
On Wed, 2011-09-28 at 22:27 +0200, Sylvain Munaut wrote:
I've also tried to create the bit stream with this patch
If I said "don't bother" earlier, there was a reason, there was quite a few things wrong with what I posted and unless you tried actually reading the specs to fix it, you had no hope whatsoever of making it work.
Indeed... even thought i got the part about TPSAP_T_SCH_F right (in another piece of test code) :-P
I now created a sylvain/tch branch with a version that creates multiple traffic_xx.out files based on the DL_USAGE value to try and demultiplex a bit. There are 2 other 'demux hack' commented in the code,one based on timeslot and one based
tetra-rx data.bits cdecoder traffic_XX.out traffic_XX.codec sdecoder traffic_XX.codec traffic_XX.pcm aplay -fS16_LE traffic_XX.pcm
What can i say? It works perfectly! I'm still wondering what are the steps to convert two 216 frames into a 690 block, but that's probably for tomorrow morning... ;-) Thanks a lot for the hack, i'll try to convert it into something more "user-friendly", but at least i know what to look for. Cheers!
Ciaby
P.S. for vladimir: i tried only one of your captures, and it seems to work fine. Tried with some local captures, works as well ;-)