Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamer not released properly on destruction #806

Open
nzqo opened this issue Nov 1, 2024 · 1 comment
Open

Streamer not released properly on destruction #806

nzqo opened this issue Nov 1, 2024 · 1 comment
Labels

Comments

@nzqo
Copy link

nzqo commented Nov 1, 2024

Issue Description

It seems that streamers are not properly released on destruction of tx_streamer::sptr.

Setup Details

I encountered this problem on:

  • x310
  • XG fpga
  • UHD_4.6.0.0+ds1-5.1ubuntu0.24.04.1
  • PCIE

Expected Behavior

I am keeping a single variable in code for a tx streamer. Basically:

struct State {
    uhd::tx_streamer::sptr tx_stream;
}

void do_things(State* state) {
    // .....
    
    // This releases the stream, as is instructed in the docs.
    if (state->tx_stream) {
        state->tx_stream.reset();
        state->tx_stream = nullptr;
    }
    
    // ....
    state->tx_stream = usrp->get_tx_stream(stream_args);
}

The docs specify that to open another stream, I need to make sure to destroy the old one. Although that is what I am doing, and I am not keeping any other references to this streamer aside from what is shown, this crashes after a few tries.

Actual Behaviour

After a few runs of this function, I always encounter the error:

Trying to allocate more DMA channels than are available

Steps to reproduce the problem

Repeatedly reset and reacquire a tx_stream and you should encounter this issue.

@mbr0wn mbr0wn added the bug label Nov 8, 2024
@mbr0wn
Copy link
Contributor

mbr0wn commented Nov 8, 2024

Oof, you're right, on destruction of streamers, we don't free up the PCIe DMA resources. I can confirm this is a bug, but I can also say that we won't have time to look at this in the near future (we don't get a lot of PCIe users).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants