Jump to content
  • 0
Sign in to follow this  
Jacob R

gr-osmocom adding a new block under WBT

Question

Is there a way to add a WBT block to gr-osmocom under the WBT component using gr_modtool? Otherwise is the only option to manually add the block to the CMakeLists.txt?

    Jacob

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

That is correct. I have figured out a way to add functionality to the gr-osmocom project (I will call it gr-osmoWBT).

Because the blocks are based off the the gr-osmocom blocks (virtual declared libraries), all the virtual methods for the block it is derived from must be defined (implementation not required, it can simply return 0 and nothing else). Some functions were adding in the wbt_source block that are specific to that block. Those functions will be removed or modified to work for the new block.

 

The process goes like this:

  Copy /lib/wbt/wbt_source_c.cc to /lib/wbt/wbt_BLOCKNAME_source_.cc  ( As i am currently adding sources, you can use a sink.cc as a starting point otherwise.)

Do the same for the header file. Open both files and do a "Find and Replace" with wbt_sink to wbt_BLOCKNAME_sink.

 Go to the CmakeLists.txt file in the /lib/wbt/ directory and add the new header and source files like this:

set(wbt_srcs
    ${CMAKE_CURRENT_SOURCE_DIR}/wbt_source_c.cc
    ${CMAKE_CURRENT_SOURCE_DIR}/wbt_qvrt_source_c.cc
    ${CMAKE_CURRENT_SOURCE_DIR}/wbt_qvrt_sink_c.cc
    ${CMAKE_CURRENT_SOURCE_DIR}/wbt_sink_c.cc
    ${CMAKE_CURRENT_SOURCE_DIR}/wbt_BLOCKNAME_source_c.cc
)

Now edit device.cc in /lib/ and every place there is something that says "wbt" there will be two entries. Copy the entry for the wbt_source and make it wbt_BLOCKNAME_source . Check the entire file, there are several things to add (copy and paste, change the namespace and obj.)

Lastly edit the source_impl.cc in /lib/ and once again everywhere it says "wbt" there will be two entries. Copy, paste, and replace.

****** That is all. Run clean project, cmake, and build. *****

 If you need to see the source for source_impl.cc or device.cc let me know I will post it.


 

Share this post


Link to post
Share on other sites
  • 0

WBT has already be added to the gr-osmosdr project. So far, it supports the 'Source' functionality for tuners A/B. Are you trying to add additional functionality?

Share this post


Link to post
Share on other sites
  • 0

I'd like to see any code you can share, I'm still working on a few more fixes and additional features for the WBT modifications in the gr-osmocom project. What you described above is pretty much what I did as well. Make sure that you edit the device.cc and source_impl.cc files correctly to correctly instantiate any new blocks.

Share this post


Link to post
Share on other sites
  • 0

I cannot share my code as i am bound by a NDA. However, i can help you with any code you may have.

 

Have you been able to figure out a way to record and transmit a file from a GRC block?

 

Share this post


Link to post
Share on other sites
  • 0
14 hours ago, rameyjm said:

I cannot share my code as i am bound by a NDA. However, i can help you with any code you may have.

Have you been able to figure out a way to record and transmit a file from a GRC block?

 

 

Yes, I have an updated version of the gr-osmosdr 'Source' block that can playback IQ data from QVRT files, as well as a 'Sink' block that can save data to a QVRT file. The next step in this is to get live TX working correctly. Currently, TX is a 2-step process, recording to a QVRT file, then selecting the file and playing it back. I've tested it by setting up an FM transmitter and transcoding WAV and MP3 files.

Share this post


Link to post
Share on other sites
  • 0

I'm working on similar  stuff. I have taken upon the task of directly streaming. I have gotten it to record and transmit using GRC but only from a file. I want to follow the steps detailed in the forum that tell how to directly stream to the radios.

You should be able to see the question about API for directly transmitting. It is possible, but it should also become easier in an upcoming API release. I am told it's very close to coming out. 

  Have you accomplished direct streaming in QT yet? I feel if I can only it there then in GRC is just another step.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×