If you notice spammers in the forum, please notify Bas ON5HB, so they can be removed and banned. Give a link in the chatbox or send a PM to me. Thanks.

PhantomSDRPlus driver for FiFi-SDR device?

Started by yo3gir, Feb 16, 2025, 05:18 PM

Previous topic - Next topic

yo3gir

Hi all,
I have a FiFi-SDR device that is working well with other apps, but I would like to test it with PhantomSDRPlus.
However, there is no driver for FiFi-SDR (that is a device that outputs IQ data via an integrated USB sound card (ADC).
According to the documentation, "since late 2013, the FiFi-SDR provides an USB audio device with 192 kHz sampling rate" (and that is my situation).



Some informations about FiFi-SDR could still be found here and in this link .

So, if anybody knows how to use FiFi-SDR with PhantomSDRPlus, please help me with that information!

Thank you and my best regards,
Val

Bas ON5HB

Did you try to pipe the output via APLAY into the spectrumserver?

bas@workstation:~$ aplay -h
Usage: aplay [OPTION]... [FILE]...

-h, --help              help
    --version           print current version
-l, --list-devices      list all soundcards and digital audio devices
-L, --list-pcms         list device names
-D, --device=NAME       select PCM by name
-q, --quiet             quiet mode
-t, --file-type TYPE    file type (voc, wav, raw or au)
-c, --channels=#        channels
-f, --format=FORMAT     sample format (case insensitive)
-r, --rate=#            sample rate
-d, --duration=#        interrupt after # seconds
-s, --samples=#         interrupt after # samples per channel
-M, --mmap              mmap stream
-N, --nonblock          nonblocking mode
-F, --period-time=#     distance between interrupts is # microseconds
-B, --buffer-time=#     buffer duration is # microseconds
    --period-size=#     distance between interrupts is # frames
    --buffer-size=#     buffer duration is # frames
-A, --avail-min=#       min available space for wakeup is # microseconds
-R, --start-delay=#     delay for automatic PCM start is # microseconds
                        (relative to buffer size if <= 0)
-T, --stop-delay=#      delay for automatic PCM stop is # microseconds from xrun
-v, --verbose           show PCM structure and setup (accumulative)
-V, --vumeter=TYPE      enable VU meter (TYPE: mono or stereo)
-I, --separate-channels one file for each channel
-i, --interactive       allow interactive operation from stdin
-m, --chmap=ch1,ch2,..  Give the channel map to override or follow
    --disable-resample  disable automatic rate resample
    --disable-channels  disable automatic channel conversions
    --disable-format    disable automatic format conversions
    --disable-softvol   disable software volume control (softvol)
    --test-position     test ring buffer position
    --test-coef=#       test coefficient for ring buffer position (default 8)
                        expression for validation is: coef * (buffer_size / 2)
    --test-nowait       do not wait for ring buffer - eats whole CPU
    --max-file-time=#   start another output file when the old file has recorded
                        for this many seconds
    --process-id-file   write the process ID here
    --use-strftime      apply the strftime facility to the output file name
    --dump-hw-params    dump hw_params of the device
    --fatal-errors      treat all errors as fatal
Ondersteunde geluidsindelingen zijn: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE IEC958_SUBFRAME_LE IEC958_SUBFRAME_BE MU_LAW A_LAW IMA_ADPCM MPEG GSM S20_LE S20_BE U20_LE U20_BE SPECIAL S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE U18_3BE G723_24 G723_24_1B G723_40 G723_40_1B DSD_U8 DSD_U16_LE DSD_U32_LE DSD_U16_BE DSD_U32_BE
Sommigen van deze zijn mogelijk niet beschikbaar op bepaalde hardware
The available format shortcuts are:
-f cd (16 bit little endian, 44100, stereo)
-f cdr (16 bit big endian, 44100, stereo)
-f dat (16 bit little endian, 48000, stereo)

Because it's raw-IO data that we pipe into the spectrumserver. You should be able to do it that way.
Else use Soapy.

I do not have one to test. Hopefully it helps. You just need a player like aplay to produce the samples to the spectrumserver.
Best regards,

Bas ON5HB

Ps. the Community Edition can be found here: https://github.com/ny4qphil/PhantomSDR-Plus

yo3gir

Dear Bas,
Thanks for the answer. I am not a skilled Linux user, sorry!
Please take me a little bit easy :)

You said:
>> Did you try to pipe the output via APLAY into the spectrumserver?

Well, how to do that ?
From man aplay, I saw that there are two apps: "aplay" and "arecord".

From your answer, I imagine that I have to take (capture) somehow the I/Q output of the FiFi-SDR and to pass it (through the linux pipe) to spectrumserver.
But I can't understand if I have to use aplay or arecord. Simply, I don't have enough experience.
Would you like to speculate a little bit to help me ?

I learned how to use aplay to play a WAV file into my LG monitor, using the HDMI channel:
aplay -l
**** List of PLAYBACK Hardware Devices ****
[...]
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
aplay -D hw:1,3 mus2.wav
Playing WAVE 'mus2.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

So, until here at least I tested a simple form of using aplay to play a WAV file into the HDMI sound device (hw:1,3) .

However, at FiFi-SDR, the situation is a bit different.
There is no device listed from FiFi-SDR when I use "aplay -l" to list them!

**** List of PLAYBACK Hardware Devices ****
card 0: D1 [Xonar D1], device 0: Multichannel [Multichannel]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: D1 [Xonar D1], device 1: Digital [Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 2: Generic [HD-Audio Generic], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Generic [HD-Audio Generic], device 1: ALC887-VD Digital [ALC887-VD Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

However, when I run the "arecord -l" command, I see the following FiFi-SDR devices:

**** List of CAPTURE Hardware Devices ****
[...]
card 3: FiFiSDR [FiFi-SDR], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 3: FiFiSDR [FiFi-SDR], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

So, can you guide me a little ?

Thanks a lot !
73 de Val




yo3gir

Hello,
Well, after long struggling, I managed to start PhantomSDRPlus to use the FiFi-SDR device.
However, it seems that I have a lot to work to bring it in a normal mode.
Until now, here is the line that helps me:

arecord -D hw:3,0 -f S16_LE -c 2 -r 192000 | ./build/spectrumserver --config config-fifisdr2.toml

Where config-fifisdr2.toml has the following content (without the first sections):

[input]
sps=192000 # Input Sample Rate
#
fft_size=32768 # medium
fft_threads=4
brightness_offset=-2
#frequency=7096000
signal="iq" # real or iq
accelerator="none"
audio_sps=12000 # 12000 needed for FT8 decoding!
smeter_offset=-10

[input.driver]
name="stdin" # Driver name
format="s16" # Sample format: u8, s8, u16, s16, u32, s32, f32, f64

[input.defaults]
frequency=7020000 # Default frequency to show user
modulation="LSB" # Default modulation


Well, it works, but there are some issues.
I will return tomorrow to post about those problems, in the hope that some of you will try to help to resolve them. Remember how is to be ... beginner !

73 de Val

Bas ON5HB

Yeah I meant arecord, sorry for that, I never use those.

Nice to hear you got it working.

You may need this bit of software to program the FiFi:

https://github.com/openwebrx/rockprog-linux
Best regards,

Bas ON5HB

Ps. the Community Edition can be found here: https://github.com/ny4qphil/PhantomSDR-Plus

Powered by EzPortal