HackRF problems: ERROR Could not set priority for modulator:1; Setting up timestamp decoder with 0 offset

587 views
Skip to first unread message

AUT DAB

unread,
Apr 22, 2017, 2:42:15 PM4/22/17
to mmbtools
Hi there!

I made a new setup with an offline Mux with two DAB programmes (encoding, multiplexing, creating an ETI and mod.ini file without problems).
The first tests worked without problems on the HackRF. After the first tests I copied the configuration files to another, stronger computer, where i also made
some tests with the same configuration and an DAB+ Mux.It also worked up to I restarted my machine and then the problems began:




dab-pc@dab-pc:~$ odr-dabmod mod.ini & hackrf_transfer -t /tmp/ofdm.fifo -f 216928000 -x 47 \ -a 1 -s 4096000 -b 1750000
[6] 1505
ODR-DabMod version v1.0.0
Compiled with features: zeromq
Input
  Type: file
  Source: test.eti
Output
  Name: /tmp/ofdm.fifo
  Sampling rate: 4.096 MHz
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)
Stop with Ctrl-C
      Starting up version v1.0.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
 0.3 MiB / 1.000 sec =  0.3 MiB/second

User cancel, exiting...
Total time: 1.00022 s
hackrf_stop_tx() done
hackrf_close() done
hackrf_exit() done
fclose(fd) done
exit
dab-pc@dab-pc:~$




I got the folowing Error message: ERROR Could not set priority for modulator:1; Setting up timestamp decoder with 0 offset.
The interesting is, if I retry to start the modulator it is working sometimes (but not stable), but most of the time it isn´t.
Sometimes another there is another error: hackrf_open() failed: HACKRF_ERROR_NOT_FOUND (-5) .
But the HackRF is connected the whole time, and after pressing the reset button on the Rig, the "Hack not found" problem is gone.
The other problem still exists.
Working conditions an my side is a Intel Core2 Quad with 2.40GHz and 4GB Ram, running Debian. I also noticed, that after retry to start
odr-dabmod the computer is going to be very slow... I also tested the configuration on my other computer, but now there is also the same problem...
What did i wrong? I am already a litte bit disappointed because I tried so many different things and I could not find the problem...



2programmes.mux
mod.ini

Matthias Brändli

unread,
Apr 22, 2017, 7:27:13 PM4/22/17
to crc-mm...@googlegroups.com
Did you properly create the fifo on your second computer?

mpb

PS:
it might be interesting to switch to SoapySDR instead of
fifo+hackrf_transfer to drive the HackRF. See INSTALL for instructions,
doc/example.ini for configuration file settings.

On Saturday, 22 April 2017 20:42:15 CEST, AUT DAB wrote:
> Hi there!
>
> I made a new setup with an offline Mux with two DAB programmes (encoding,
> multiplexing, creating an ETI and mod.ini file without problems).
> The first tests worked without problems on the HackRF. After the first
> tests I copied the configuration files to another, stronger computer, where
> i also made
> some tests with the same configuration and an DAB+ Mux.It also worked up to
> I restarted my machine and then the problems began:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *dab-pc@dab-pc:~$ odr-dabmod mod.ini & hackrf_transfer -t /tmp/ofdm.fifo -f
> 216928000 -x 47 \ -a 1 -s 4096000 -b 1750000[6] 1505ODR-DabMod version
> v1.0.0Compiled with features: zeromq Input Type: file Source:
> test.etiOutput Name: /tmp/ofdm.fifo Sampling rate: 4.096 MHzcall
> 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)Stop with Ctrl-C Starting up
> version v1.0.0Input file format: rawInput file length: 30726144Input file
> nb frames: 5001ERROR Could not set priority for modulator:1 Setting up
> timestamp decoder with 0 offset 0.3 MiB / 1.000 sec = 0.3 MiB/secondUser
> cancel, exiting...Total time: 1.00022 shackrf_stop_tx() donehackrf_close()
> donehackrf_exit() donefclose(fd) doneexitdab-pc@dab-pc:~$*
>
>
>
> I got the folowing Error message:* ERROR Could not set priority for
> modulator:1; Setting up timestamp decoder with 0 offset.*
> The interesting is, if I retry to start the modulator it is working
> sometimes (but not stable), but most of the time it isn´t.
> Sometimes another there is another error:
> *hackrf_open() failed: HACKRF_ERROR_NOT_FOUND (-5) . *But the HackRF is

AUT DAB

unread,
Apr 23, 2017, 4:58:17 AM4/23/17
to mmbtools
Yes, I also created the fifo on the second computer, because at the beginning it worked it worked on the second computer too!
But I found a part solution maybe for the problem, I added the fifo with the commad mkfifo /tmp/ofdm.fifo again and now it is working. But the message
ERROR Could not set priority for modulator:1, Setting up timestamp decoder with 0 offset already exists.

I also got following message, when i stop the transmission with ctrl+c:
exit
[3]   Datenübergabe unterbrochen (broken pipe)                 odr-dabmod mod.ini


I think I should really try SoapySDR, to test it...

AUT DAB

unread,
Apr 23, 2017, 5:41:04 AM4/23/17
to mmbtools
Edit: I restarted the computer and all the problems are back again! ,-)
But at the first try with the restartet machine I got this message:
Failed to open file: /tmp/ofdm.fifo

I think it is really a problem with the pipe, or what do you mean?

Matthias Brändli

unread,
Apr 23, 2017, 11:14:03 PM4/23/17
to crc-mm...@googlegroups.com
On Sunday, 23 April 2017 11:41:04 CEST, AUT DAB wrote:
> Edit: I restarted the computer and all the problems are back again! ,-)
> But at the first try with the restartet machine I got this message:
> *Failed to open file: /tmp/ofdm.fifo*
>
> I think it is really a problem with the pipe, or what do you mean?
>

It could be that the contents of /tmp/ are not kept between reboots, and so
your pipe gets deleted.

You're not forced to have the fifo in /tmp and you could move it elsewhere.

mpb

PS:
for the issue about the real-time priority, have a look a the guide. There
is a chapter in the system environment part that explains this.

PPS:
The "broken pipe" error is an intentional consequence of using a pipe (pipe
= FIFO). If you quit the read end (hackrf_transfer) of the pipe, the write
end (odr-dabmod) receives a SIGPIPE and quits.

AUT DAB

unread,
Apr 27, 2017, 9:05:35 AM4/27/17
to mmbtools
Thanks Matthias for the hint with the real-time priority, that solved my problem with ERROR Could not set priority for modulator:1.
I also made some advanced configurations, incl. live encoding with vlc and jack and nearly everything works fine.
I have only two more problems! ;-)

If I want to start the mod I get different error messages, but after a two to three times retry it will work normaly.
Sometimes a retry brings no solution. So I deleted the ofdm.fifo file and created a new one and after that it worked again...
I also got the message WARN  ZeroMQ buffer low: 4 elements ! and sometimes the signal disappears for a few seconds.
I reduced the signal loss by adjusting the ZeroMQ buffer at my .ini file, now it its better, but not perfect...

Attached some examples of my errors, when my mod does not start at the first try: 

dab-pc@dab-pc:~$  odr-dabmod live.ini & hackrf_transfer -t /tmp/ofdm.fifo -f 174928000 -x 47 \ -a 1 -s 4096000 -b 1750000
[3] 3302

ODR-DabMod version v1.0.0
Compiled with features: zeromq
Input
  Type: zeromq
  Source: tcp://localhost:10001
Output
  Name: /tmp/ofdm.fifo
  Sampling rate:       Starting up version v1.0.04.096 MHz


[2]   Datenübergabe unterbrochen (broken pipe)                 odr-dabmod live.ini
dab-pc@dab-pc:~$




dab-pc@dab-pc:~$ odr-dabmod live.ini & hackrf_transfer -t /tmp/ofdm.fifo -f 174928000 -x 47 \ -a 1 -s 4096000 -b 1750000
[5] 3310

ODR-DabMod version v1.0.0
Compiled with features: zeromq
Input
  Type: zeromq
  Source: tcp://localhost:10001
Output
  Name: /tmp/ofdm.fifo
  Sampling rate:       Starting up version v1.0.04.096 MHz

hackrf_open() failed: HACKRF_ERROR_LIBUSB (-1000)
Usage:
    -r <filename> # Receive data into file.
    -t <filename> # Transmit data from file.
    -w # Receive data into file with WAV header and automatic name.
       # This is for SDR# compatibility and may not work with other software.
    [-f freq_hz] # Frequency in Hz [0MHz to 7250MHz].
    [-i if_freq_hz] # Intermediate Frequency (IF) in Hz [2150MHz to 2750MHz].
    [-o lo_freq_hz] # Front-end Local Oscillator (LO) frequency in Hz [84MHz to 5400MHz].
    [-m image_reject] # Image rejection filter selection, 0=bypass, 1=low pass, 2=high pass.
    [-a amp_enable] # RX/TX RF amplifier 1=Enable, 0=Disable.
    [-p antenna_enable] # Antenna port power, 1=Enable, 0=Disable.
    [-l gain_db] # RX LNA (IF) gain, 0-40dB, 8dB steps
    [-g gain_db] # RX VGA (baseband) gain, 0-62dB, 2dB steps
    [-x gain_db] # TX VGA (IF) gain, 0-47dB, 1dB steps
    [-s sample_rate_hz] # Sample rate in Hz (8/10/12.5/16/20MHz, default 10MHz).
    [-n num_samples] # Number of samples to transfer (default is unlimited).
    [-c amplitude] # CW signal source mode, amplitude 0-127 (DC value to DAC).
    [-b baseband_filter_bw_hz] # Set baseband filter bandwidth in MHz.
    Possible values: 1.75/2.5/3.5/5/5.5/6/7/8/9/10/12/14/15/20/24/28MHz, default < sample_rate_hz.



dab-pc@dab-pc:~$ odr-dabmod live.ini & hackrf_transfer -t /tmp/ofdm.fifo -f 174928000 -x 47 \ -a 1 -s 4096000 -b 1750000
[6] 3328

ODR-DabMod version v1.0.0
Compiled with features: zeromq
Input
  Type: zeromq
  Source: tcp://localhost:10001
Output
  Name: /tmp/ofdm.fifo
  Sampling rate:       Starting up version v1.0.04.096 MHz

call hackrf_sample_rate_set(4096000 Hz/4.096 MHz)
Input ZeroMQ:
Input ZeroMQ:
  Receiving from tcp://localhost:10001

  Receiving from tcp://localhost:10001


      Setting up timestamp decoder with 0 offset
Input ZeroMQ:
  Receiving from tcp://localhost:10001


      Setting up timestamp decoder with 0 offset
      Setting up timestamp decoder with 0 offset
Input ZeroMQ:
  Receiving from tcp://localhost:10001


      Setting up timestamp decoder with 0 offset
call hackrf_baseband_filter_bandwidth_set(1750000 Hz/1.750 MHz)
call hackrf_set_freq(174928000 Hz/174.928 MHz)
Stop with Ctrl-C
WARN  ZeroMQ buffer low: 4 elements !WARN
WARN  ZeroMQ buffer low: 4 elements !
ZeroMQ buffer low: 4 elements !
WARN  ZeroMQ buffer low: 4 elements !
 2.6 MiB / 1.000 sec =  2.6 MiB/second
 8.4 MiB / 1.000 sec =  8.4 MiB/second
WARN  ZeroMQ buffer overfull !
ERROR Exception during receive: 'ZMQ input full'WARN
 ZeroMQ buffer overfull !
ERROR Exception during receive: 'ZMQ input full'
      ZeroMQ input worker terminated
      ZeroMQ input worker terminated
      End of file reached.


Process time:
                    DabModulator:     795689 us (39.85 %)
                 FormatConverter:       7188 us (0.36 %)
      modulator stopped.
                           OutputFile:    1193670 us (59.79 %)
                           total:    1996547 us (100.00 %)
Process time:
                   PrbsGenerator:       1231 us (1.13 %)
                       FicSource:         10 us (0.01 %)
                   PrbsGenerator:         46 us (0.04 %)
                     ConvEncoder:        162 us (0.15 %)
               PuncturingEncoder:        142 us (0.13 %)
                SubchannelSource:          8 us (0.01 %)
                   PrbsGenerator:         52 us (0.05 %)
                     ConvEncoder:        229 us (0.21 %)
               PuncturingEncoder:        223 us (0.20 %)
                 TimeInterleaver:        565 us (0.52 %)
                SubchannelSource:         10 us (0.01 %)
                   PrbsGenerator:         41 us (0.04 %)
                     ConvEncoder:        158 us (0.14 %)
               PuncturingEncoder:        152 us (0.14 %)
                 TimeInterleaver:        375 us (0.34 %)
                SubchannelSource:          9 us (0.01 %)
                   PrbsGenerator:         65 us (0.06 %)
                     ConvEncoder:        341 us (0.31 %)
               PuncturingEncoder:        314 us (0.29 %)
                 TimeInterleaver:        815 us (0.75 %)
                FrameMultiplexer:         55 us (0.05 %)
                BlockPartitioner:         45 us (0.04 %)
                QpskSymbolMapper:       1573 us (1.44 %)
            FrequencyInterleaver:       2669 us (2.45 %)
                  PhaseReference:         45 us (0.04 %)
           DifferentialModulator:       8135 us (7.46 %)
                      NullSymbol:         66 us (0.06 %)
                  PhaseReference:         36 us (0.03 %)
  TII(comb:0, pattern:0, variant:new):         28 us (0.03 %)
               SignalMultiplexer:       2792 us (2.56 %)
                   OfdmGenerator:       6522 us (5.98 %)
                     GainControl:       8189 us (7.51 %)
           GuardIntervalInserter:       2844 us (2.61 %)
                       Resampler:      63927 us (58.61 %)
                    OutputMemory:       7195 us (6.60 %)
                           total:     109069 us (100.00 %)
 12 DAB frames encoded
      0.288 seconds encoded
      Terminating
WARN  ZeroMQ buffer overfull !
WARN  ZeroMQ buffer overfull !
ERROR Exception during receive: 'ZMQ input full'
      ZeroMQ input worker terminated
ERROR Exception during receive: 'ZMQ input full'
      ZeroMQ input worker terminated


Process time:


                    DabModulator:     675409 us (32.78 %)
                      FormatConverter:       7163 us (0.35 %)
 End of file reached.                      OutputFile:    1377857 us (66.87 %)

                           total:    2060429 us (100.00 %)
      modulator stopped.
      20 DAB frames encoded
      0.48 seconds encoded
Process time:
                    DabModulator:     683840 us (33.19 %)
                 FormatConverter:       6833 us (0.33 %)
                      OutputFile:    1369881 us (66.48 %)
                           total:    2060554 us (100.00 %)


Process time:
                    DabModulator:     865350 us (41.99 %)
                 FormatConverter:       5965 us (0.29 %)
                      OutputFile:    1189383 us (57.72 %)
                           total:    2060698 us (100.00 %)
      End of file reached.
      modulator stopped.
      16 DAB frames encoded
      0.384 seconds encoded
Process time:
                   PrbsGenerator:       1740 us (1.05 %)
                       FicSource:         20 us (0.01 %)
                   PrbsGenerator:         68 us (0.04 %)
                     ConvEncoder:        234 us (0.14 %)
               PuncturingEncoder:        198 us (0.12 %)
                SubchannelSource:         14 us (0.01 %)
                   PrbsGenerator:         80 us (0.05 %)
                     ConvEncoder:        336 us (0.20 %)
               PuncturingEncoder:        371 us (0.22 %)
                 TimeInterleaver:        644 us (0.39 %)
                SubchannelSource:         11 us (0.01 %)
                   PrbsGenerator:         62 us (0.04 %)
                     ConvEncoder:        230 us (0.14 %)
               PuncturingEncoder:        218 us (0.13 %)
                 TimeInterleaver:        427 us (0.26 %)
                SubchannelSource:         17 us (0.01 %)
                   PrbsGenerator:         96 us (0.06 %)
                     ConvEncoder:        503 us (0.30 %)
               PuncturingEncoder:        455 us (0.28 %)
                 TimeInterleaver:        896 us (0.54 %)
                FrameMultiplexer:         82 us (0.05 %)
                BlockPartitioner:         75 us (0.05 %)
                QpskSymbolMapper:       1751 us (1.06 %)
Process time:
            FrequencyInterleaver:       3360 us (2.04 %)
                  PhaseReference:         50 us (0.03 %)
                   PrbsGenerator:       1752 us (1.02 %)
           DifferentialModulator:      12145 us (7.36 %)
                       FicSource:         16 us (0.01 %)
                      NullSymbol:         45 us (0.03 %)
                   PrbsGenerator:         70 us (0.04 %)
Process time:
                  PhaseReference:         47 us (0.03 %)
                     ConvEncoder:        233 us (0.14 %)
                   PrbsGenerator:       1606 us (1.03 %)
               PuncturingEncoder:        201 us (0.12 %)
                       FicSource:         14 us (0.01 %)
                SubchannelSource:         13 us (0.01 %)
                   PrbsGenerator:         65 us (0.04 %)
                   PrbsGenerator:         78 us (0.05 %)
                     ConvEncoder:        214 us (0.14 %)
  TII(comb:0, pattern:0, variant:new):         36 us (0.02 %)
                     ConvEncoder:        333 us (0.19 %)
               PuncturingEncoder:        188 us (0.12 %)
               SignalMultiplexer:       2647 us (1.60 %)
               PuncturingEncoder:        316 us (0.18 %)
                SubchannelSource:         16 us (0.01 %)
                   OfdmGenerator:      10357 us (6.27 %)
                 TimeInterleaver:        626 us (0.36 %)
                   PrbsGenerator:         74 us (0.05 %)
                     GainControl:      13176 us (7.98 %)
                SubchannelSource:         14 us (0.01 %)
           GuardIntervalInserter:       4612 us (2.79 %)
                   PrbsGenerator:         59 us (0.03 %)
                     ConvEncoder:        226 us (0.13 %)
                          ConvEncoder:        310 us (0.20 %)
               PuncturingEncoder:        293 us (0.19 %)
                 TimeInterleaver:        675 us (0.43 %)
                SubchannelSource:         12 us (0.01 %)
                   PrbsGenerator:         59 us (0.04 %)
               PuncturingEncoder:        220 us (0.13 %)
                     ConvEncoder:        214 us (0.14 %)
               PuncturingEncoder:        197 us (0.13 %)
                 TimeInterleaver:        426 us (0.25 %)
                 TimeInterleaver:        482 us (0.31 %)
                SubchannelSource:         15 us (0.01 %)
                SubchannelSource:         13 us (0.01 %)
                   PrbsGenerator:         95 us (0.06 %)
                   PrbsGenerator:         88 us (0.06 %)
                     ConvEncoder:        490 us (0.28 %)
                     ConvEncoder:        455 us (0.29 %)
               PuncturingEncoder:        455 us (0.26 %)
               PuncturingEncoder:        421 us (0.27 %)
                 TimeInterleaver:        927 us (0.54 %)
                FrameMultiplexer:         82 us (0.05 %)
                 TimeInterleaver:        985 us (0.63 %)
                BlockPartitioner:         70 us (0.04 %)
                FrameMultiplexer:         76 us (0.05 %)
                QpskSymbolMapper:       1912 us (1.11 %)
                BlockPartitioner:         80 us (0.05 %)
            FrequencyInterleaver:       3557 us (2.07 %)
                QpskSymbolMapper:       1804 us (1.16 %)
                  PhaseReference:         49 us (0.03 %)
            FrequencyInterleaver:       3271 us (2.10 %)
           DifferentialModulator:      12156 us (7.06 %)
                  PhaseReference:         55 us (0.04 %)
                      NullSymbol:         47 us (0.03 %)
           DifferentialModulator:      11405 us (7.33 %)
                  PhaseReference:         50 us (0.03 %)
                      NullSymbol:         49 us (0.03 %)
                  PhaseReference:         46 us (0.03 %)
  TII(comb:0, pattern:0, variant:new):         32 us (0.02 %)
  TII(comb:0, pattern:0, variant:new):         34 us (0.02 %)
               SignalMultiplexer:       3052 us (1.77 %)
               SignalMultiplexer:       2464 us (1.58 %)
                   OfdmGenerator:      10202 us (5.93 %)
                   OfdmGenerator:       9363 us (6.02 %)
                     GainControl:      13508 us (7.85 %)
                     GainControl:      14873 us (9.56 %)
           GuardIntervalInserter:       4840 us (2.81 %)
           GuardIntervalInserter:       3774 us (2.42 %)
                       Resampler:     102576 us (59.58 %)
                       Resampler:      92075 us (59.16 %)
                    OutputMemory:      13453 us (7.81 %)
                    OutputMemory:       9896 us (6.36 %)
                           total:     172151 us (100.00 %)
                           total:     155646 us (100.00 %)
                       Resampler:      98098 us (59.43 %)
                    OutputMemory:      11954 us (7.24 %)
                           total:     165055 us (100.00 %)
      Terminating
      Terminating
 End of file reached.
      modulator stopped.
      20 DAB frames encoded
      0.48 seconds encoded
      Terminating
 2.6 MiB / 1.000 sec =  2.6 MiB/second

User cancel, exiting...
Total time: 3.00032 s

hackrf_stop_tx() done
hackrf_close() done
hackrf_exit() done
fclose(fd) done
exit
[3]   Fertig                  odr-dabmod live.ini
[4]   Fertig                  odr-dabmod live.ini
[5]-  Fertig                  odr-dabmod live.ini
[6]+  Fertig                  odr-dabmod live.ini

Matthias Brändli

unread,
Apr 30, 2017, 4:54:44 AM4/30/17
to crc-mm...@googlegroups.com
The backslash in the hackrf_transfer command line is not part of the
options for hackrf_transfer, it just means "the options continue on the
next line". Don't put it if you have everything on one line.

For errors that are generated by hackrf_transfer itself, I cannot help
you much, you have to ask the HackRF people.

mpb

On 27/04/17 15:05, AUT DAB wrote:
> Thanks Matthias for the hint with the real-time priority, that solved my
> problem with /ERROR Could not set priority for modulator:1.
> /I also made some advanced configurations, incl. live encoding with vlc
> and jack and nearly everything works fine.
> I have only two more problems! ;-)
>
> If I want to start the mod I get different error messages, but after a
> two to three times retry it will work normaly.
> Sometimes a retry brings no solution. So I deleted the ofdm.fifo file
> and created a new one and after that it worked again...
> I also got the message /WARN ZeroMQ buffer low: 4 elements ! /and
> sometimes the signal disappears for a few seconds.
> I reduced the signal loss by adjusting the ZeroMQ buffer at my .ini
> file, now it its better, but not perfect...
>
> Attached some examples of my errors, when my mod does not start at the
> first try:
>
> /dab-pc@dab-pc:~$ odr-dabmod live.ini & hackrf_transfer -t
> /
>
> --
> 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.

mike....@gmail.com

unread,
May 21, 2017, 4:47:56 PM5/21/17
to mmbtools
I made that command into a script file and found it advantageous to add two extra lines at the start 'rm /tmp/odfm.fifo' and 'mkfifo /tmp/odfm.fifo'. This ensures that odr-dabmod starts filling an empty file every time the test script is run. If the fifo file doesn't exist, e.g. on a new system, it's no big deal to get the warning message from the first 'rm' command.
Reply all
Reply to author
Forward
0 new messages