# Suppressing UHD prints

**URL:** <https://www.ruby-forum.com/t/suppressing-uhd-prints/242540>\
**Category:** GNU Radio\
**Created:** [July 1, 2015, 10:20am UTC](https://www.ruby-forum.com/t/suppressing-uhd-prints/242540 "2015-07-01T10:20:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [July 1, 2015, 10:20am UTC](https://www.ruby-forum.com/t/suppressing-uhd-prints/242540/1 "2015-07-01T10:20:59Z")

</div>

Hi all,

UHD host library generates prints on the stdout. For example on each  
retune I get something like:

## – Tune Request: 959.000000 MHz – The RF LO does not support the requested frequency: – Requested LO Frequency: 959.000000 MHz – RF LO Result: 958.998779 MHz – Attempted to use the DSP to reach the requested frequency: – Desired DSP Frequency: -0.001221 MHz – DSP Result: -0.001221 MHz – Successfully tuned to 959.000000 MHz

These prints are sometimes cluttering the console - especially when  
someone wants to use console to print other useful information.

There is possibility to disable them in UHD from the level of C++:  
[http://files.ettus.com/manual/page\_general.html](http://files.ettus.com/manual/page_general.html)  
(“Disabling or redirecting prints to stdout”)

Is it possible to disable the prints from GNU Radio?

Best Regards,  
Piotr K.

---

<div class="post-metadata">

**Author:** ![hibernaculus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6de8d8/32.png) [@hibernaculus](https://www.ruby-forum.com/u/hibernaculus)\
**Post date:** [July 2, 2015, 5:07pm UTC](https://www.ruby-forum.com/t/suppressing-uhd-prints/242540/2 "2015-07-02T17:07:48Z")

</div>

On 07/01/2015 10:19 AM, Piotr K. wrote:

> – Desired DSP Frequency: -0.001221 MHz  
> – DSP Result: -0.001221 MHz  
> – Successfully tuned to 959.000000 MHz  
> These prints are sometimes cluttering the console - especially when  
> someone wants to use console to print other useful information.
> 
> There is possibility to disable them in UHD from the level of C++:  
> [USRP Hardware Driver and Device Manual: General Application Notes](http://files.ettus.com/manual/page_general.html)  
> (“Disabling or redirecting prints to stdout”)
> 
> Is it possible to disable the prints from GNU Radio?

I had looked into that some time ago. In the current form it is not  
possible.

Even if ’ uhd::msg::register\_handler’ would be exposed to python, you  
still can’t drop-in your own null-handler. Swig doesn’t support  
callbacks in the target language (python). However, you can add custom  
handlers like a null\_handler in C++ and then use that. Try the attached  
patch. Works for me. Only output left is that standard version\_string.

Sebastian
