cjcliffe / CubicSDR

Cross-Platform Software-Defined Radio Application
http://www.cubicsdr.com
GNU General Public License v2.0
2.02k stars 249 forks source link

Headphone output generates errors when there are two HDMI monitors #974

Closed w0dz closed 1 year ago

w0dz commented 1 year ago

I am using the SDRPlay image, v0.7, which includes CubicSDR, on a Raspberry Pi 4B. I have found that it works fine to the headphone jack when I don't plug in the second HDMI monitor. Not sure which of the numerous ways to select the headphones actually worked - tried raspi-config, alsamixer, CubicSDR itself, and of course added dtparam=audio=on to the config.txt file. But nothing makes the audio work when I have both HDMI1 and 2 (0 and 1 on the RPi board) enabled. The output window shows scads of this error:

DemodulatorThread::run() cannot push ati into audioOutputQueue, is full !

And if I select HDMI1 or 2 from CubicSDR, I get an IO error. I can select the headphones as long as only one HDMI display is connected.

Any thoughts? I must have both monitors in use as well as headphone jack audio.

w0dz commented 1 year ago

Follow-up - It's not just Cubic SDR. A program I wrote that produces audio is also not working when the 2nd HDMI port is there, Oddly, it doesn't come out hte second HDMI monitor speakers either. And the audio to the headphone jack is much lower volume when I do remove that second HDMI cable. This worked fine on SDRPlay's v0.6 image. What changed?

dmaltsiniotis commented 1 year ago

Hi @w0dz, it sounds like this might be an issue with the SDR Play image, rather than with CubicSDR. You may want to reach out to the maintainers of that image or distribution for additional help.

I have noticed on rare occasions (on Windows) that when audio devices change dynamically (like when HDMI monitors are turned off/on) that the audio source dropdown box in CubicSDR is off by one. Meaning: it's the selection above/below the actual device you want to send audio to. I don't think that is what is going on here based on your description though, it sounds like something related to the SDR play image or Raspberry Pi itself.

w0dz commented 1 year ago

They pawned me off on you, saying they don't know anything about CubicSDR and don't offer support. And apparently they also don't support the Linux inage that they offer for download. Version v0.6 works, but v0.7 does not. They said it would be better to go get my own Debian installation and build everything from scratch. Not gonna happen. So any advice is appreciated.

w0dz commented 1 year ago

Just observed that the alsamixer has a volume setting that must be max volume. When I finally realized I could tweak that, I got normal volume out and the volume slider worked as expected. But that did not resolve the HDMI issue. I have an earlier image, v0.6, in which I was able to run both monitors and the headphone jack, so I know there's a setting somewhere that will fix it. But I can't remember what I did to get that working, and I have Googled it till I'm blue in the face and can't find anyone else who's tried it and solved it.

SDRplay commented 1 year ago

Just for the avoidance of any confusion, we don't provide support for CubicSDR because it's not something that we authored - we don't know how the audio system works inside CubicSDR and so it's not possible for us to do that. I suggested asking here because this is the only place I'm aware of where questions can be asked regarding CubicSDR.

Some time back we were asked to provide downloadable images because a lot of people didn't know how to build software from source, so the images are provided as a leg up to those people. If my memory serves me correctly, the v0.6 image is based on buster and v0.7 is based on bullseye - from what I remember buster to bullseye OS versions was a big deal at the time.

We haven't updated the images for the simple fact that it's quite a time sink and we only have one person (me) to do this work. What we do now provide are scripts that install the API, build SoapySDR, SoapySDRPlay and CubicSDR including wxWidgets - so just a few scripts to run and you end up with an up to date build of CubicSDR. Again, the scripts were something we were asked to provide.

Certainly multiple HDMI outputs wouldn't have been something we would have looked at, and again it's not possible for us to provide support for OS issues as this isn't something we have the resource for.

If you're also having issues with the audio in the software that you've written, then I guess it's most likely to be something that changed in the OS between buster and bullseye. Maybe updating to the latest bullesye version might help?

w0dz commented 1 year ago

Just found a link on RPi forums. Apparently a known problem with a workaround,

https://forums.raspberrypi.com/viewtopic.php?t=282166

w0dz commented 1 year ago

Just tried this workaround, and it works!

dmaltsiniotis commented 1 year ago

Nice find, glad it worked out.

vsonnier commented 1 year ago

Closing, since it is not a CubicSDR issue.