DSD-FME - Wav files recording for Tier II DMR

dolman

Member
Joined
Jul 12, 2024
Messages
6
Dear All,

I am attempting to establish a headless, Linux-based "ultimate radio scanning centre". For frequency monitoring, I am utilising RTLSDR-Airband, which performs admirably, and rdio-scanner for the user interface. In my vicinity, there are some single-channel Tier II DMR frequencies that I would like to incorporate, so I need middleware between RTLSDR-Airband and rdio-scanner to decode speech. I've managed to route audio from RTLSDR-Airband to DSD-FME, but I find myself at an impasse. My setup for DSD-FME appears straightforward: I aim to decode the audio sent from RTLSDR-Airband and save the decoded speech as mp3 or wav files in a designated folder with predefined names for rdio-scanner. However, I cannot locate a relevant use case in the DSD-FME documentation.

Is it possible to export decoded audio from DSD-FME per call to a specific directory using a predefined filename template? If not, are there any lightweight, Linux-based solutions that could accomplish this?
 

ki4hyf

Member
Premium Subscriber
Joined
Mar 2, 2005
Messages
177
Location
Jackson, TN
Is it possible to export decoded audio from DSD-FME per call to a specific directory using a predefined filename template? If not, are there any lightweight, Linux-based solutions that could accomplish this?
Yes, but it's hard coded in the source. How comfortable are you with editing the source code, re-compiling and stashing/committing? An example would be:
Code:
sprintf (opts->wav_out_file, "%s/%s %s MS - CC %d - %s - DST %d - SRC %d.wav",  opts->wav_out_dir, datestr, timestr, dcc, cs, tg, rd);
 

dolman

Member
Joined
Jul 12, 2024
Messages
6
Unfortunately, programming is not my strongest suit. I could make changes to the source code if someone were to explain what needs modifying and how to do it. To be more precise, I would need a step-by-step guide for editing the code, though I believe that recompiling it under Linux using Make should be fairly straightforward.
 

ki4hyf

Member
Premium Subscriber
Joined
Mar 2, 2005
Messages
177
Location
Jackson, TN
Unfortunately, programming is not my strongest suit. I could make changes to the source code if someone were to explain what needs modifying and how to do it. To be more precise, I would need a step-by-step guide for editing the code, though I believe that recompiling it under Linux using Make should be fairly straightforward.
If you could let me know what filename you'd like to use, and be sure to point out any variables, I'd be happy to help. Also, be sure to specify a location where the files should be created.
 

dolman

Member
Joined
Jul 12, 2024
Messages
6
It would be great if I could pass variables from the command line when starting DSD-FME to keep things flexible. The -wd option (for wav directory) should set the directory where the files will be saved. The -wp option (for wav prefix) should set the prefix for the filenames. DSD-FME should automatically add the date and time to the filename in DDMMYYYY and HHMMSS format. Everything should be joined with an underscore (_), so the final filename looks like PREFIX_DDMMYYYY_HHMMSS.wav.

Really appreciate your help. Thanks a lot!
 

ki4hyf

Member
Premium Subscriber
Joined
Mar 2, 2005
Messages
177
Location
Jackson, TN
It would be great if I could pass variables from the command line when starting DSD-FME to keep things flexible. The -wd option (for wav directory) should set the directory where the files will be saved. The -wp option (for wav prefix) should set the prefix for the filenames. DSD-FME should automatically add the date and time to the filename in DDMMYYYY and HHMMSS format. Everything should be joined with an underscore (_), so the final filename looks like PREFIX_DDMMYYYY_HHMMSS.wav.
Well, most of it is quite doable, but as for the command-line variables, I consider those to be feature requests, and I don't want to try to implement that. It already adds the time in the requested format and I don't feel comfortable changing the format of the date string because of the way it's coded, but adding underscores is easy. So, I need a static directory and a static prefix.

By default it looks like: "./WAV/20240711_094855 CC 674 - Group - DST 47014 - SRC 4024484.wav".
After the changes it should look like: "./YOUR_DIRECTORY/YOUR_PREFIX_20240711_094855.wav".

Really appreciate your help. Thanks a lot!
Happy to help.
 

ki4hyf

Member
Premium Subscriber
Joined
Mar 2, 2005
Messages
177
Location
Jackson, TN
I've attached a patch file that creates (if it doesn't already exist) and uses a dynamic directory using the date (YYYYMMDD) for the name and the per call wav uses the protocol, date and time (NXDN_YYYYMMDD_HHMMSS.wav) for a filename. It may not work, I haven't really tested it. Apply the patch by unzipping into dsd-fme directory and run:
Code:
git apply per-call.patch
 

Attachments

  • per-call.patch.zip
    848 bytes · Views: 4

dolman

Member
Joined
Jul 12, 2024
Messages
6
Thanks a lot for this. I haven't had the chance to test it for a few days. It seems that just applying the patch and starting DSD-FME with dsd-fme -i rtl:0:144000000000:10:::: isn't working. The directories aren't being created. Maybe a silly question, but do I need to "activate" recording in the command line somehow when starting DSD-FME?
 

ki4hyf

Member
Premium Subscriber
Joined
Mar 2, 2005
Messages
177
Location
Jackson, TN
do I need to "activate" recording in the command line somehow when starting DSD-FME?
Yes, either by adding "-P" (along with "-N 2> log.ans") on the command line, or by typing capital "P" (lower-case "p" stops recording) when in NCurses, because Per Call Recording can only be used with NCurses. Also, I'd leave off any colon that isn't preceding an option or argument, and I'm sure it's a typo, but you are asking DSD-FME to tune your RTL device to 144 ghz. I always do something like "144M" to avoid confusion.

Just a note in general, but if you aren't interested in generating a log file, use "2> nul" for windows or "2> /dev/null" for Linux.
 

dolman

Member
Joined
Jul 12, 2024
Messages
6
OK, now it works. Partially. :) The WAV directory is created, but when run with "-P -N 2> log.ans" it opens in NCurses and creates a wav file that is constantly open for writing. All calls are appended to this file. It is closed and listenable after DSD-FME is closed. A new session opens another file for writing. So, it seems that there is no difference between DSD-FME with and without the patch, and here is another silly question - do I need to recompile it after applying the patch?
 
Last edited:

ki4hyf

Member
Premium Subscriber
Joined
Mar 2, 2005
Messages
177
Location
Jackson, TN
Try leaving the "-P" off the command line and just press "P" when in NCurses. Yes, you must re-compile after applying the patch. Just cd to dsd-fme/build and run make -j then sudo make install. That should do it.
 

dolman

Member
Joined
Jul 12, 2024
Messages
6
Got your point. I've finally had a chance to test it. A folder is created, but DSD-FME creates two wav files (I assume for both time slots), which are opened for writing and closed after exit. I tried both options - with and without "-P" in the command line, and activating per-call recording with "P" later. The only difference is the filename used by DSD-FME. Have a look at the attached screenshots. Of course, only those two files are created and calls are appended to one of them.

With "-P" in command line:
with_P.JPG

Per-call activated later with "P":
without_P.JPG
 

ki4hyf

Member
Premium Subscriber
Joined
Mar 2, 2005
Messages
177
Location
Jackson, TN
Those are "placeholder" files, but new files should be created when a new call starts, written to then closed when the call ends. Like:
Code:
-rw-rw-r-- 1 user user 126K Jul 15 09:48 20240715_094847_CC_674_-_Group_-_DST_47014_-_SRC_4143787.wav
-rw-rw-r-- 1 user user  11K Jul 15 09:48 20240715_094855_CC_674_-_Group_-_DST_47014_-_SRC_4024484.wav
-rw-rw-r-- 1 user user   44 Jul 15 09:47 DSD-FME-T1.wav
-rw-rw-r-- 1 user user 125K Jul 15 09:47 DSD-FME-T2.wav
The file "DSD-FME-T2.wav" was written to because there was an active call when I hit "P". When a new call occurs, it should look like this in NCurses:
 

Attachments

  • per-call.jpg
    per-call.jpg
    33.9 KB · Views: 4
Top