Share sound interface between ardop and VARA

57 views
Skip to first unread message

Anders Riple

unread,
Jan 12, 2025, 7:39:01 PMJan 12
to pat-users
Im unable to figure out the correct .asoundrc file to share the sound interface between thoose 2 programs.

Im able to run both ardop and VARA, but not simultanious, hope that should be possible?

Ubuntu 24.04 / x64

(Slightly off topic, but still...)

de

LB1KI

Anders


Anders Riple

unread,
Jan 13, 2025, 5:24:42 AMJan 13
to pat-users
Have tried the few setups

/etc/asound.conf
---
pcm_slave.codec {
   pcm {
      type hw
      card CODEC
   }
   period_time 0
   buffer_size 8192
}

pcm.codec-dmix {
   type dmix
   ipc_key 2023041901
   slave "codec"
   bindings.0 0
}

pcm.codec-dsnoop {
   type dsnoop
   ipc_key 2023041902
   slave "codec"
   bindings.0 0
}

pcm.codec-rx {
   type plug
   slave.pcm "codec-dsnoop"
   hint.description "codec RX audio plug"
}

pcm.codec-tx {
   type plug
   slave.pcm "codec-dmix"
   hint.description "codec TX audio plug"
}
---

Launch ardop

---
ardopcf 8515 plug:codec-rx plug:codec-tx
ardopcf Version 1.0.4.1.3_develop (https://www.github.com/pflarue/ardop)
Copyright (c) 2014-2024 Rick Muething, John Wiseman, Peter LaRue
See https://github.com/pflarue/ardop/blob/master/LICENSE for licence details including
  information about authors of external libraries used and their licenses.
ARDOPC listening on port 8515
Capture Devices

Card 0, ID `CODEC', name `USB AUDIO  CODEC'
  Device hw:0,0 ID `USB Audio', name `USB Audio', 1 subdevices (1 available)
    1..2 channels, sampling rate 8000..48000 Hz

Card 1, ID `MS2109', name `MS2109'
  Device hw:1,0 ID `USB Audio', name `USB Audio', 1 subdevices (1 available)
    2 channels,  sampling rate 48000..48000 Hz

Card 2, ID `PCH', name `HDA Intel PCH'
  Device hw:2,0 ID `ALC221 Analog', name `ALC221 Analog', 1 subdevices (1 available)
    2 channels,  sampling rate 44100..192000 Hz
  Device hw:2,2 ID `ALC221 Alt Analog', name `ALC221 Alt Analog', 1 subdevices (1 available)
    2 channels,  sampling rate 44100..192000 Hz

Card 3, ID `NVidia', name `HDA NVidia'

Playback Devices

Card 0, ID `CODEC', name `USB AUDIO  CODEC'
  Device hw:0,0 ID `USB Audio', name `USB Audio', 1 subdevices (1 available)
    1..2 channels, sampling rate 32000..48000 Hz

Card 1, ID `MS2109', name `MS2109'

Card 2, ID `PCH', name `HDA Intel PCH'
  Device hw:2,0 ID `ALC221 Analog', name `ALC221 Analog', 1 subdevices (1 available)
    2 channels,  sampling rate 44100..192000 Hz

Card 3, ID `NVidia', name `HDA NVidia'
  Device hw:3,3 ID `HDMI 0', name `HDMI 0', 1 subdevices (1 available)
    2..8 channels, sampling rate 32000..192000 Hz
  Device hw:3,7 ID `HDMI 1', name `HDMI 1', 1 subdevices (1 available)
    2..8 channels, sampling rate 32000..192000 Hz

Using Both Channels of soundcard for RX
Using Both Channels of soundcard for TX
Opening Playback Device plug:codec-tx Rate 12000
cannot set playback period size (Invalid argument)
Error in InitSound().  Stopping ardop.
---

Peter LaRue

unread,
Jan 14, 2025, 9:17:02 AMJan 14
to pat-users
Anders,

I don't use VARA, so I can't test this myself.  However, in a message to the ardop users group, K9WKJ reported that he is able to use ardopcf by specifying pulse for the ardopcf audio devices.  ardopcf does not natively support PulseAudio, but apparently PulseAudio provides compatibility with programs like ardopcf that only natively support ALSA devices.  See https://ardop.groups.io/g/users/message/5411.  That user reports also using VARA, though he doesn't explicitly say whether this setup allows him to run both at the same time.

In another discussion in that users group (https://ardop.groups.io/g/users/topic/108567735), G8BPQ provides a link to https://www.cantab.net/users/john.wiseman/Downloads/alsa-shared-ardopcf-QtSM.txt which is the ALSA configuration file that he uses to share his soundcard between multiple programs.  At some point I intend to explore the use of these ALSA configuration files further so as to better understand their use.  However, since I don't have a personal use for them, I have not done so yet.  In that discussion, I also write that I think that it may make a difference which program is started first, since that program will set the initial soundcard parameters that the other program and/or the ALSA plugin must adapt to.

Both of these are referenced in the documentation for ardopcf at https://github.com/pflarue/ardop/blob/master/docs/USAGE_linux.md.

If these references are not useful, I'd be happy to try to help you further to find another solution.  Since I see that you are running a +develop version of ardopcf, you must be compiling ardopcf from source.  I'm happy to see this because it means that you can make some minor edits to the source code and recompile.  This makes it possible to write some additional diagnostic info to the debug log which may help us to better understand exactly what is occurring, and then try to find a fix.  As I wrote later in https://ardop.groups.io/g/users/topic/108567735 I believe that adjusting one or more of the parameters used internally by ardopcf may be necessary to allow it to interact with specific other programs.  If this can be proven useful, I'm willing to either change the default parameters used or allow user adjustment via a command line option.  If you want to explore this further, please email me directly.  You can find my email address at QRZ.com.

Peter LaRue
AI7YN

Anders Riple

unread,
Jan 20, 2025, 7:12:18 AMJan 20
to pat-users
Thanks!
I will give it a new attempt...

I guess I was a bit inaccurate with my description... the old ardopc seems to work with the guides I have found.

The newer version which I now realize is your code seems to throw an error.. which is not critical as it will happily run at the default interfaces with no sharing.

I will be away for a few weeks due to work know, but I might be in contact when I return.

de
LB1KI

Peter LaRue

unread,
Jan 21, 2025, 9:50:12 AMJan 21
to pat-users
Anders,

Yes.  There was a bug in ardopc that, for some hardware (including mine), caused all transmissions to have a slight error in the symbol rate.  This made it unusable except with the slowest and most robust data frame types.  Fixing this bug was my initial motivation for creating the ardopcf fork.  Unfortunately, a side effect of this fix makes sharing the soundcard with other software more problematic. 

Since creating ardopcf, with the agreement of the prior authors, I've also released it under the well-known permissive MIT open source license rather than just the legally ambiguous 'source available' status of ardopc.  This means that even if for some reason I'm unable to continue working on it, somebody else should be able to continue maintaining it indefinitely.  It also allows me or anybody else to use any of the ardopcf code as a starting point for a new, incompatible, mode with better performance.  I'm now working to fix additional bugs, and to reorganize the code to make it easier to understand and more maintainable.  This also continues to be a learning process for me as I slowly figure out how all of the existing code works, and thus how it can be improved.  While I intend to continue to try to make ardopcf better, I also hope to eventually contribute to the development of a better open source mode to replace it.

I'm currently exploring some changes to audio read/write functions.  These changes may help your problem, but I don't know yet.  

For announcements of new releases and discussion of issues specific to Ardop, see users subgroup at https://ardop.groups.io.

Peter LaRue
AI7YN
Reply all
Reply to author
Forward
0 new messages