Can HackRF One use offline .iq file to transfer?

1,178 views
Skip to first unread message

ea...@me.com

unread,
Mar 2, 2017, 10:18:26 AM3/2/17
to mmbtools
What I want do do is transfer DAB+ by HackRF One,in the virtual machine.
I followed the mmbtools.pdf in the site:http://www.opendigitalradio.org

I used:
./toolame -b 128 prog1.wav prog1.mp2
dabplus-enc -i prog2.wav -b 88 -o prog2.dabp
(edit 2programmes.mux)
odr-dabmux 2programmes.mux

firstly,I don't know if the   .mp2  file is useful for DAB+.And if there is no mp2,can the .efi file be created?
secondly,i get the "myfirst.efi",want to creat the  .iq  file.


hackrf@ubuntu:~$ odr-dabmod myfirst.eti -f myfirst.iq
ODR-DabMod version v0.6.0
Compiled with features: zeromq 
Input
  Type: file
  Source: myfirst.eti
Output
  Name: myfirst.iq
  Sampling rate: 2.048 MHz
WARN  No Remote-Control started
      Starting up version v0.6.0
Input file format: raw
Input file length: 30726144
Input file nb frames: 5001
ERROR Could not set priority for modulator:1
      Setting up timestamp decoder with 0 offset
ERROR Could not initialise TII: TII::TII DAB mode 0 not valid!
No resampler


Process time:
                     InputMemory:       6406 us (0.07 %)
                    DabModulator:    5771599 us (59.72 %)
                      OutputFile:    3886973 us (40.22 %)
                           total:    9664978 us (100.00 %)
Process time:
                   PrbsGenerator:     261275 us (4.66 %)
                       FicSource:       1765 us (0.03 %)
                   PrbsGenerator:       9817 us (0.18 %)
                     ConvEncoder:      21835 us (0.39 %)
               PuncturingEncoder:      23873 us (0.43 %)
                SubchannelSource:       1735 us (0.03 %)
                   PrbsGenerator:      20143 us (0.36 %)
                     ConvEncoder:      78988 us (1.41 %)
               PuncturingEncoder:      65433 us (1.17 %)
                 TimeInterleaver:      51136 us (0.91 %)
                SubchannelSource:       1410 us (0.03 %)
                   PrbsGenerator:      15414 us (0.28 %)
                     ConvEncoder:      53688 us (0.96 %)
               PuncturingEncoder:      65592 us (1.17 %)
                 TimeInterleaver:     102599 us (1.83 %)
                FrameMultiplexer:       6299 us (0.11 %)
                BlockPartitioner:       5918 us (0.11 %)
                QpskSymbolMapper:     149209 us (2.66 %)
            FrequencyInterleaver:     314395 us (5.61 %)
                  PhaseReference:       3235 us (0.06 %)
           DifferentialModulator:    1709244 us (30.51 %)
                      NullSymbol:       2800 us (0.05 %)
               SignalMultiplexer:     116851 us (2.09 %)
                   OfdmGenerator:     580042 us (10.35 %)
                     GainControl:    1528952 us (27.29 %)
           GuardIntervalInserter:     207977 us (3.71 %)
                    OutputMemory:     202871 us (3.62 %)
                           total:    5602496 us (100.00 %)

Closing input file...
      End of file reached.
      modulator stopped.
      5001 DAB frames encoded
      120.024 seconds encoded
      Terminating





and the    "5.1.2 Modulation of ETI for Offline Processing"    seems to be used for USRP,so I don't if HackRF One can trensfer the .ip file.

Thirdly,in the "5.2.2 Other Hardware"

I used:

mkfifo /tmp/ofdm.fifo
odr-dabmod mod.ini & hackrf_transfer -t /tmp/ofdm.fifo -f 216928000 -x 47 -a 1 -s 4096000 -b 1750000

And i get:
hackrf@ubuntu:~$ odr-dabmod mod.ini & hackrf_transfer -t /tmp/ofdm.fifo -f 216928000 -x 47 -a 1 -s 4096000 -b 1750000
[1] 27648
ODR-DabMod version v0.6.0
Compiled with features: zeromq 
Input
  Type: file
  Source: myfirst.eti
Output
  Name: /tmp/ofdm.fifo
  Sampling rate: 4.096 MHz
      Starting up version v0.6.0
Input file format: raw
Input file length: 30726144
Input file nb frames: 5001
ERROR Could not set priority for modulator:1
      Setting up timestamp decoder with 0 offset
ERROR Could not initialise TII: TII::TII DAB mode 0 not valid!
call hackrf_sample_rate_set(4096000 Hz/4.096 MHz)
call hackrf_baseband_filter_bandwidth_set(1750000 Hz/1.750 MHz)
call hackrf_set_freq(216928000 Hz/216.928 MHz)
call hackrf_set_amp_enable(1)
Stop with Ctrl-C
FIRFilter: Reading 45 taps...
 0.0 MiB / 1.000 sec =  0.0 MiB/second

Couldn't transfer any bytes for one second.

Exiting... hackrf_is_streaming() result: HACKRF_TRUE (1)
Total time: 1.00066 s
hackrf_stop_tx() done
hackrf_close() done
hackrf_exit() done
fclose(fd) done
exit


So,I'm confuse for the DAB+ transfering by HackRF One.
Is there someone can help me?Thank you.

 

ea...@me.com

unread,
Mar 2, 2017, 11:34:42 AM3/2/17
to mmbtools
I just try to use hackrf_transfer to transfer the  .iq  file.
The first time,successed.
The second time,faild.



hackrf@ubuntu:~$ hackrf_transfer -t myfirst.iq -f 314100000
call hackrf_sample_rate_set(10000000 Hz/10.000 MHz)
call hackrf_baseband_filter_bandwidth_set(9000000 Hz/9.000 MHz)
call hackrf_set_freq(314100000 Hz/314.100 MHz)
Stop with Ctrl-C
19.9 MiB / 1.001 sec = 19.9 MiB/second
20.2 MiB / 1.001 sec = 20.2 MiB/second
19.9 MiB / 1.001 sec = 19.9 MiB/second
20.2 MiB / 1.001 sec = 20.2 MiB/second
19.9 MiB / 1.001 sec = 19.9 MiB/second
20.2 MiB / 1.001 sec = 20.2 MiB/second
20.2 MiB / 1.001 sec = 20.2 MiB/second
19.9 MiB / 1.001 sec = 19.9 MiB/second
20.2 MiB / 1.001 sec = 20.2 MiB/second
19.9 MiB / 1.000 sec = 19.9 MiB/second
20.2 MiB / 1.001 sec = 20.2 MiB/second
19.9 MiB / 1.001 sec = 19.9 MiB/second
20.2 MiB / 1.001 sec = 20.2 MiB/second
20.2 MiB / 1.000 sec = 20.2 MiB/second
19.9 MiB / 1.001 sec = 19.9 MiB/second
20.2 MiB / 1.000 sec = 20.2 MiB/second
19.9 MiB / 1.001 sec = 19.9 MiB/second
20.2 MiB / 1.000 sec = 20.2 MiB/second
19.9 MiB / 1.001 sec = 19.9 MiB/second
20.2 MiB / 1.001 sec = 20.2 MiB/second
19.9 MiB / 1.000 sec = 19.9 MiB/second
20.2 MiB / 1.907 sec = 10.6 MiB/second
19.9 MiB / 1.001 sec = 19.9 MiB/second
20.2 MiB / 1.001 sec = 20.2 MiB/second
20.2 MiB / 1.000 sec = 20.2 MiB/second
^CCaught signal 2
 4.2 MiB / 0.221 sec = 19.0 MiB/second

User cancel, exiting...
Total time: 26.14508 s
hackrf_stop_tx() done
hackrf_close() done
hackrf_exit() done
fclose(fd) done
exit

hackrf@ubuntu:~$ hackrf_transfer -t myfirst.iq -f 314100000
call hackrf_sample_rate_set(10000000 Hz/10.000 MHz)
call hackrf_baseband_filter_bandwidth_set(9000000 Hz/9.000 MHz)
call hackrf_set_freq(314100000 Hz/314.100 MHz)
Stop with Ctrl-C
 0.0 MiB / 1.001 sec =  0.0 MiB/second

Couldn't transfer any bytes for one second.

Exiting... hackrf_is_streaming() result: HACKRF_TRUE (1)
Total time: 1.00085 s

Matthias Brändli

unread,
Mar 2, 2017, 1:03:09 PM3/2/17
to crc-mm...@googlegroups.com
Hi,

you seem to have done some good progress since your first email. I'm not
going to answer all your emails separately, but I can give a few hints:

- do not follow the instructions without taking time to understand what
each tools does. Take the time to read the example configuration files
in the doc/ folders both in ODR-DabMux and ODR-DabMod and read the guide.

- using odr-dabmod to prepare an I/Q file for the hackrf will only work
with a configuration file, because you cannot set the output format to
"s8" using the command line.

- If you want to go step by step and execute the tools after each other,
you need to use files (mp2 files, dabp files, an eti file, an IQ file).
If you want to run all the tools in real-time, you need to use a fifo
between ODR-DabMod and hackrf_transfer.

- If myfirst.iq is a fifo, running hackrf_transfer once will send a
signal, but the second time your fifo will be empty and hackrf_transfer
will not work. Is that the problem you are seeing?

The next release of ODR-DabMod will be able to use SoapySDR to connect
to the HackRF, then you won't need to use hackrf_transfer anymore. Maybe
I'll do the release tomorrow (if I can finish the things I want to have
in the release), maybe next week.

mpb
> --
> You received this message because you are subscribed to the Google
> Groups "mmbtools" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to crc-mmbtools...@googlegroups.com
> <mailto:crc-mmbtools...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

ea...@me.com

unread,
Mar 4, 2017, 11:29:04 AM3/4/17
to mmbtools, matthias...@mpb.li
 I'm so grateful for your help,and feel sorry for asking without understanding the example.
After reading your hints,I did somethings.
Before use the command line "odr-dabmux 2programmes.mux",I changed little,delete the prog1.mp2.
I just want to use DAB+.

general {
    dabmode 1
    nbframes 5000
}
remotecontrol { telnetport 0 }
ensemble {
    id 0x4fff
    ecc 0xec ; Extended Country Code

    local-time-offset auto
    international-table 1
    label "mmbtools"
    shortlabel "mmbtools"
}
services {

    srv-p2 { label "Prog2" }
}
subchannels {

    sub-p2 {
        type dabplus
        inputfile "prog2.dabp"
        bitrate 88
        id 1
        protection 1
    }
}
components {

    comp-p2 {
        label Prog2
        service srv-p2
        subchannel sub-p2
    }
}
outputs { output1 "file://myfirst.eti?type=raw" }

Then,I use:odr-dabmux 2.mux

hackrf@ubuntu:~$ odr-dabmux 2.mux
Welcome to ODR-DabMux v1.2.1, compiled at Feb 28 2017, 08:21:42

Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Her Majesty the Queen in Right of Canada
(Communications Research Centre Canada) All rights reserved.

Copyright (C) 2016 Matthias P. Braendli

Input URLs supported:
 prbs udp file zmq
Inputs format supported:
 raw mpeg packet epm
Output URLs supported:
 file fifo udp tcp simul

ERROR Could not set real-time priority for thread:1
      ODR-DabMux v1.2.1 starting up
      No announcements defined in ensemble
      because No such node (announcements)
      No announcements defined in service srv-p2
WARN  Service short label undefined, truncating label Prog2
WARN  Component short label undefined, truncating label Prog2
WARN  Primary component comp-p2 has label set. Since V2.1.1 of the specification, only secondary components are allowed to have labels.
      --- Multiplex configuration ---
      Ensemble
       id:          0x4fff (20479)
       ecc:         0xec (236)
       label:       mmbtools
       short label: mmbtools
       (0xff00)
       mode:        1
       lto:         -8.0 hours
       intl. table. 1
       No announcement clusters defined
       Linkage Sets
      --- Subchannels list ---
      Subchannel   sub-p2
       input
         URI:     prog2.dabp
       type:       audio
       id:         0x1 (1)
       bitrate:    88
       protection: EEP 1-A
        option:    0
        level:     0
       SAD:        0
       size (CU):  132
      --- Services list ---
      Service       srv-p2
       label:       Prog2
       short label: Prog2
       (0xff00)
       id:            0x33 (51)
       pty:           0x0 (0)
       language:      0x0 (0)
       announcements: 0x0
       clusters: 
      --- Components list ---
      Component     comp-p2
       service id:             0x33 (51)
       subchannel id:          0x1 (1)
       label:                  Prog2
       short label:            Prog2
       (0xff00)
       service component type: 0x3f (63)
       No app type defined
      --- Output list ---
      Output      0
        URI: file://myfirst.eti
      Start loop
      Max number of ETI frames reached: 5000
      exiting...
      ...done

Also there are some errors,But the  .efi  file has been created.\

Then,after reading your hints,I know,the command line "hackrf_transfer" can't transfer the  .iq  file by format:s8,So I read the example of ODR-DabMod.
I think I don't need the remote control,so I write "telnetport=0"

[remotecontrol]
;telnet=1
telnetport=0

[input]
transport=file
source=myfirst.eti
loop=1

[modulator]
gainmode=2
digital_gain=2.4
rate=4096000

[firfilter]
enabled=1
filtertapsfile=filtertaps.txt

[output]
output=file

[fileoutput]
format=s8
filename=/tmp/ofdm.fifo

after that,I used "ODR-DabMod/doc/fir-filter/generate-filter.py",get:

19
-0.00103475200012
0.00367798260413
-0.00847596582025
0.0117740901187
-0.00412130914629
-0.024320403114
0.0753075629473
-0.137373536825
0.188951909542
0.791228830814
0.188951909542
-0.137373536825
0.0753075629473
-0.024320403114
-0.00412130914629
0.0117740901187
-0.00847596582025
0.00367798260413
-0.00103475200012

Writing these data in the filtertaps.txt.In "cd ~"

And use  "mkfifo/tmp/ofdm.fifo"

But when I use the command line "odr-dabmod mod.ini & hackrf_transfer -t /tmp/ofdm.fifo -f 216928000 -x 47 -a 1 -s 4096000 -b 1750000"


There are some errors:

hackrf@ubuntu:~$ odr-dabmod mod.ini & hackrf_transfer -t /tmp/ofdm.fifo -f 216928000 -x 47 -a 1 -s 4096000 -b 1750000
[1] 3224
ODR-DabMod version v0.6.0
Compiled with features: zeromq 
Input
  Type: file
  Source: myfirst.eti
Output
  Name: /tmp/ofdm.fifo
  Sampling rate: 4.096 MHz
call hackrf_sample_rate_set(4096000 Hz/4.096 MHz)
WARN  No Remote-Control started
      Starting up version v0.6.0
call hackrf_baseband_filter_bandwidth_set(1750000 Hz/1.750 MHz)
call hackrf_set_freq(216928000 Hz/216.928 MHz)
call hackrf_set_amp_enable(1)
Stop with Ctrl-C
Input file format: raw
Input file length: 30726144
Input file nb frames: 5001
ERROR Could not set priority for modulator:1
      Setting up timestamp decoder with 0 offset
ERROR Could not initialise TII: TII::TII DAB mode 0 not valid!
FIRFilter: Reading 19 taps...
 0.0 MiB / 1.000 sec =  0.0 MiB/second

Couldn't transfer any bytes for one second.

Exiting... hackrf_is_streaming() result: HACKRF_TRUE (1)
Total time: 1.00057 s
hackrf_stop_tx() done
hackrf_close() done
hackrf_exit() done
fclose(fd) done
exit



So, according you help,I know the format:8 is necessary,and I must use ODR-DabMod with a configuration file.
Am I right in making every telnetport=0?Because I don't need the remote control.
And why doesn't it work?I can't google the some error.

That's very important for me,I hope you can give me some hints,Thank you.



在 2017年3月3日星期五 UTC+8上午2:03:09,Matthias Brändli写道:

ea...@me.com

unread,
Mar 4, 2017, 11:37:20 AM3/4/17
to mmbtools, matthias...@mpb.li
ERROR Could not set priority for modulator:1 Setting up timestamp decoder with 0 offset 
ERROR Could not initialise TII: TII::TII DAB mode 0 not valid!

For these two Errors,What should I do?

在 2017年3月3日星期五 UTC+8上午2:03:09,Matthias Brändli写道:
Hi,

Matthias Brändli

unread,
Mar 9, 2017, 1:36:46 PM3/9/17
to crc-mm...@googlegroups.com
I don't think these two errors should crash the modulator.

Could you force the mode to 1 in the ODR-DabMod configuration just to
make sure?

Since you've been able to create IQ data I suspect this is not really
the issue though...

mpb

On 04/03/17 17:37, ea...@me.com wrote:
> ERROR Could not set priority for modulator:1 Setting up timestamp
> decoder with 0 offset
> ERROR Could not initialise TII: TII::TII DAB mode 0 not valid!
>
> For these two Errors,What should I do?
>
> 在 2017年3月3日星期五 UTC+8上午2:03:09,Matthias Brändli写道:
>
> Hi,
>
> you seem to have done some good progress since your first email. I'm
> not
> going to answer all your emails separately, but I can give a few hints:
>
> - do not follow the instructions without taking time to understand what
> each tools does. Take the time to read the example configuration files
> in the doc/ folders both in ODR-DabMux and ODR-DabMod and read the
> guide.
>
> - using odr-dabmod to prepare an I/Q file for the hackrf will only work
> with a configuration file, because you cannot set the output format to
> "s8" using the command line.
>
> - If you want to go step by step and execute the tools after each
> other,
> you need to use files (mp2 files, dabp files, an eti file, an IQ file).
> If you want to run all the tools in real-time, you need to use a fifo
> between ODR-DabMod and hackrf_transfer.
>
> - If myfirst.iq <http://myfirst.iq> is a fifo, running
> hackrf_transfer once will send a
> signal, but the second time your fifo will be empty and hackrf_transfer
> will not work. Is that the problem you are seeing?
>
> The next release of ODR-DabMod will be able to use SoapySDR to connect
> to the HackRF, then you won't need to use hackrf_transfer anymore.
> Maybe
> I'll do the release tomorrow (if I can finish the things I want to have
> in the release), maybe next week.
>
> mpb
>
> On 02/03/17 17:34, ea...@me.com <javascript:> wrote:
> > I just try to use hackrf_transfer to transfer the .iq file.
> > The first time,successed.
> > The second time,faild.
> >
> >
> >
> > hackrf@ubuntu:~$ hackrf_transfer -t myfirst.iq <http://myfirst.iq> -f 314100000
> > hackrf@ubuntu:~$ hackrf_transfer -t myfirst.iq <http://myfirst.iq> -f 314100000
> > call hackrf_sample_rate_set(10000000 Hz/10.000 MHz)
> > call hackrf_baseband_filter_bandwidth_set(9000000 Hz/9.000 MHz)
> > call hackrf_set_freq(314100000 Hz/314.100 MHz)
> > Stop with Ctrl-C
> > 0.0 MiB / 1.001 sec = 0.0 MiB/second
> >
> > Couldn't transfer any bytes for one second.
> >
> > Exiting... hackrf_is_streaming() result: HACKRF_TRUE (1)
> > Total time: 1.00085 s
> > hackrf_stop_tx() done
> > hackrf_close() done
> > hackrf_exit() done
> > fclose(fd) done
> > exit
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "mmbtools" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> > an email to crc-mmbtools...@googlegroups.com <javascript:>
> > <mailto:crc-mmbtools...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "mmbtools" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to crc-mmbtools...@googlegroups.com
> <mailto:crc-mmbtools...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages