Closed EricFROL closed 8 months ago
You must use a loopback device (snd_aloop or snd-aloop) between airspy-fmradion and fldigi. The whole setup must be on ALSA level because airspy-fmradion does not use PulseAudio at all. You can find the PortAudio device number by system_info.py of PyAudio.
I guess this is not an airspy-fmradion problem because your audio output is directed to PortAudio default
device.
Any advice on how to make airspy-fmradion output to alsa instead of pulseaudio?
This is what I can select in fldigi
And these are my portaudio devices:
0 bcm2835 Headphones: - (hw:0,0), ALSA (0 in, 8 out)
1 Loopback: PCM (hw:2,0), ALSA (32 in, 32 out)
2 Loopback: PCM (hw:2,1), ALSA (32 in, 2 out)
3 sysdefault, ALSA (0 in, 128 out)
4 lavrate, ALSA (0 in, 128 out)
5 samplerate, ALSA (0 in, 128 out)
6 speexrate, ALSA (0 in, 128 out)
7 pulse, ALSA (32 in, 32 out)
8 speex, ALSA (0 in, 1 out)
9 upmix, ALSA (0 in, 8 out)
10 vdownmix, ALSA (0 in, 6 out)
11 dmix, ALSA (0 in, 2 out)
* 12 default, ALSA (32 in, 32 out)
Use hw:2,0 for airspy-fmradion output (-P 2
in your setting), and use hw:2,1 for fldigi input.
airspy-fmradion does not use PulseAudio at all.
Getting this when running with -P 2:
(...)
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2048
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2721
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2842
playing audio to PortAudio device 2: name 'Loopback: PCM (hw:2,1)'
ERROR: AudioOutput: Pa_OpenStream(): PortAudio error: (number: -9997 message: Invalid sample rate)
fldigi
Also:
-P 1
(that's my bad)Now starts audio, but same issue as before, suddenly stops. Btw airspyfmradion command continues active.
Getting this log:
Expression 'ValidateParameters( inputParameters, hostApi, StreamDirection_In )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1838
In my case, running Ubuntu 22.04.3 x86_64, airspy-fmradion 20240107-0, and fldigi 4.2.03.10 worked OK (at least the audio didn't stop). I don't think this is airspy-fmradion's general issue but rather a configuration issue. Can you tell me your fldigi's version?
I spent six hours trying to find out that this is a bug in the PortAudio of Raspberry Pi. I even tried to rebuild my own PortAudio and traced the issue, but I decided I wouldn't be able to go further. Here in my Raspberry Pi environment, the snd_aloop device is recognized by the alsa programs (such as "aplay -L"), but the snd_aloop devices are not recognized at all by PortAudio. Other than this, airspy-fmradion and fldigi (on Raspberry Pi) both worked fine.
Possible related issues:
I installed a clean-slate Raspberry Pi OS 64bit (bookworm) to a Raspberry Pi 4B 2GB RAM, and necessary libraries with no private build other than airspy-fmradion, and found that everything went fine between the installed airspy-fmradion and fldigi. So I have to conclude there is something wrong with PortAudio on bullseye.
I conclude this is not an airspy-fmradion issue, so I will close this issue.
Further discussion: #69
So what should I do?
@EricFROL I'm sorry, I can't propose any viable solution right now because it's out of the scope of airspy-fmradion. The Debian bullseye problem of being unable to handle snd_aloop of PortAudio prevented me from debugging this case. As you told me privately, I hope your problem has been solved. I would consider terminating support for Raspberry Pi bullseye, due to older CMake and the whole issue I experienced yesterday (which I could not solve even by reinstalling PortAudio).
Running on dietpi. Starts fine, and without printing any error stops the output of audio, as fldigi stops receiving data.
Log: