[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r6322 - gnuradio/branches/developers/gnychis/inband/us
From: |
gnychis |
Subject: |
[Commit-gnuradio] r6322 - gnuradio/branches/developers/gnychis/inband/usrp/host/apps |
Date: |
Wed, 5 Sep 2007 15:01:50 -0600 (MDT) |
Author: gnychis
Date: 2007-09-05 15:01:50 -0600 (Wed, 05 Sep 2007)
New Revision: 6322
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/read_packets.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_underrun.cc
Log:
Committing work in progress for detecting underruns
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/read_packets.cc
===================================================================
--- gnuradio/branches/developers/gnychis/inband/usrp/host/apps/read_packets.cc
2007-09-05 20:18:28 UTC (rev 6321)
+++ gnuradio/branches/developers/gnychis/inband/usrp/host/apps/read_packets.cc
2007-09-05 21:01:50 UTC (rev 6322)
@@ -73,6 +73,12 @@
// if(pkt->carrier_sense())
// printf("\tcarrier sense\n");
+ if(pkt->underrun())
+ printf("\tunderrun\n");
+
+ if(pkt->overrun())
+ printf("\toverrun\n");
+
printf("\tchannel: \t0x%x\n", pkt->chan());
printf("\ttimestamp: \t0x%x\n", pkt->timestamp());
//printf("\ttimestamp: \t%u\n", pkt->timestamp());
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_underrun.cc
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_underrun.cc
2007-09-05 20:18:28 UTC (rev 6321)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_underrun.cc
2007-09-05 21:01:50 UTC (rev 6322)
@@ -129,7 +129,7 @@
d_rx_chan(PMT_NIL),
d_which_usrp(pmt_from_long(0)),
d_state(INIT),
- d_nsamples_to_send((long) 5e6),
+ d_nsamples_to_send((long) 50e6),
d_nsamples_xmitted(0),
d_nframes_xmitted(0),
d_samples_per_frame(d_nsamples_to_send), // full packet
@@ -145,12 +145,12 @@
// Specify the RBF to use
pmt_dict_set(usrp_dict,
pmt_intern("rbf"),
- pmt_intern("boe2.rbf"));
+ pmt_intern("merge4.rbf"));
// Set TX and RX interpolations
pmt_dict_set(usrp_dict,
pmt_intern("interp-tx"),
- pmt_from_long(128));
+ pmt_from_long(16));
pmt_dict_set(usrp_dict,
pmt_intern("interp-rx"),
@@ -197,7 +197,24 @@
pmt_t status = PMT_F;
pmt_t dict = PMT_NIL;
std::string error_msg;
+
+ // Check the recv sample responses for underruns and count
+ if(pmt_eq(event, s_response_recv_raw_samples)) {
+ handle = pmt_nth(0, data);
+ status = pmt_nth(1, data);
+ dict = pmt_nth(4, data);
+ if(pmt_eq(status, PMT_T)) {
+ handle_recv_response(dict);
+ return;
+ }
+ else {
+ error_msg = "error while receiving samples:";
+ goto bail;
+ }
+ }
+
+
// Dispatch based on state
switch(d_state) {
@@ -248,7 +265,7 @@
// If the RX has also been allocated already, we can continue
if(!pmt_eqv(d_rx_chan, PMT_NIL)) {
enter_receiving();
- enter_transmitting();
+ //enter_transmitting();
}
return;
@@ -277,7 +294,7 @@
// If the TX has also been allocated already, we can continue
if(!pmt_eqv(d_tx_chan, PMT_NIL)) {
enter_receiving();
- enter_transmitting();
+ //enter_transmitting();
}
return;
@@ -316,22 +333,6 @@
}
}
- // Check the recv sample responses for underruns and count
- if(pmt_eq(event, s_response_recv_raw_samples)) {
- handle = pmt_nth(0, data);
- status = pmt_nth(1, data);
- dict = pmt_nth(4, data);
-
- if(pmt_eq(status, PMT_T)) {
- handle_recv_response(dict);
- return;
- }
- else {
- error_msg = "error while receiving samples:";
- goto bail;
- }
- }
-
goto unhandled;
//------------------------- CLOSING CHANNELS ----------------------------//
@@ -535,6 +536,9 @@
d_rx->send(s_cmd_start_recv_raw_samples,
pmt_list2(PMT_F,
d_rx_chan));
+
+ if(verbose)
+ std::cout << "[TEST_USRP_INBAND_UNDERRUN] Started RX sample stream\n";
}
void
@@ -590,6 +594,9 @@
}
}
+ if(verbose)
+ std::cout << "[TEST_USRP_INBAND_TX] Transmitting frame...\n";
+
pmt_t timestamp = pmt_from_long(0xffffffff); // NOW
d_tx->send(s_cmd_xmit_raw_frame,
pmt_list4(pmt_from_long(d_nframes_xmitted), // invocation-handle
@@ -600,8 +607,9 @@
d_nsamples_xmitted += nsamples_this_frame;
d_nframes_xmitted++;
- if(verbose && 0)
+ if(verbose)
std::cout << "[TEST_USRP_INBAND_TX] Transmitted frame\n";
+
}
void
@@ -610,7 +618,8 @@
if (d_done_sending &&
pmt_to_long(handle) == (d_nframes_xmitted - 1)){
// We're done sending and have received all responses
- closing_channels();
+ //closing_channels();
+ return;
}
build_and_send_next_frame();
@@ -630,6 +639,13 @@
PMT_NIL)) {
if(pmt_eqv(underrun, PMT_T))
d_n_underruns++;
+
+ if(verbose)
+ std::cout << "[TEST_USRP_INBAND_UNDERRUN] Underrun\n";
+ } else {
+
+ if(verbose)
+ std::cout << "[TEST_USRP_INBAND_UNDERRUN] No underrun\n";
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r6322 - gnuradio/branches/developers/gnychis/inband/usrp/host/apps,
gnychis <=