Can't reliably do T/R switching with valves with UHD and RFX400

I am trying to switch a GRC transceiver between transmit and receive
using a
boolean variable that shows up on the GUI as a pair of QT radio button
or as
a checkbox. The boolean variable controls two valves, one between the
UHD
source and the rest of the receiver, and the other between the transmit
chain and the UHD sink. I am using an RFX400.

The idea is that when I’m in receive mode, the valve to the UHD sink is
open
(not passing samples), so the UHD driver turns off the transmitter, and
I
can receive.

This does not work reliably. When I start the graph, it’s in receive
mode
and all is well. When I click on the transmit button, it stops receiving
(no
audio) and it transmits just fine. When I switch back to receive,
sometimes
it works, the transmit carrier disappears (I can see it in another
physical
radio) and the receive chain starts working again, producing audio. But
at
other times, the receive chain starts up (I guess because the valve from
the
UHD source closes), but the RFX400 keeps the transmitter’s carrier on. I
can
see it in another radio. It does not appear to be modulated.

Am I doing something wrong? I thought that stopping the samples to the
UHD
sink with a valve will turn off the transmitter in the RFX400. Is there
another, more explicit way to tell the daughter board to stop and start
the
transmitter under UHD?

Thanks, Sivan T.