OpenBCM V1.07b12 (Linux)

Packet Radio Mailbox

IW8PGT

[Mendicino(CS)-Italy]

 Login: GUEST





  
PE1RRR > PACKET   13.06.22 02:54l 283 Lines 7098 Bytes #999 (0) @ WW
BID : 38847-PE1RRR
Read: GUEST
Subj: RPI4: VARA, FX25 & ARDOP on 1 interface
Path: IW8PGT<I3XTY<I0OJJ<EA2RCF<LU9DCE<VE3CGR<WG0A<N3HYM<IV3BVK<PE1RRR
Sent: 220613/0045Z @:PE1RRR.#NBW.NLD.EURO #:38847 [Rijen] $:38847-PE1RRR
From: PE1RRR@PE1RRR.#NBW.NLD.EURO
To  : PACKET@WW


RPI4 Trifecta: VARA, Packet & ARDOP – One Audio Interface

Up-to-date documentation, images & video demo:

https://eindhoven.space/radio-experiments/packet-radio/rpi4-trifecta-vara-packet-ardop-one-audio-interface/

Requirements

This document assumes you have already installed the VARA suite of
modems and the companion programs via the Winelink project. If not,
now is your chance-

Word of caution: installing wine is disk intensive, if you have not
yet got your home directory on a real physical disk instead of the
SD Card- now is the time to consider doing that. The SD Card is also
incredibly slow for wine applications.

To install Wine and the ARM x86 emulator system, visit the Winelink
GitHub page. (https://github.com/WheezyE/Winelink)

Or go wild and run it live from the command line:

curl -O https://raw.githubusercontent.com/WheezyE/Winelink/main/install_winelink.sh && \
bash install_winelink.sh

Resources for QtSoundModem:

https://www.cantab.net/users/john.wiseman/Documents/QtSoundModem.html

Resources for ARDOP: the piardopc binary is available from G8BPQs
website, here:

https://www.cantab.net/users/john.wiseman/Documents/ARDOPC.html





VARA: dsnoop & dmix

Physical audio interface mapping to the virtual sound devices for
playback (dsnoop) and recording (dmix), the device “hw:1,0” refers
to the audio interface ID provided by the ‘aplay -l command. Yours
may differ. E.g. hw:2,0 etc.

pcm.dsnooped0 {
type dsnoop
ipc_key 50000
ipc_key_add_uid false # let multiple users share
ipc_perm 0666 # IPC permissions for multi-user sharing (octal,default 0600)
slave {
pcm "hw:1,0"
channels 1
}
}

pcm.dmix0 {
type dmix
ipc_key 60000
ipc_key_add_uid false # let multiple users share
ipc_perm 0666 # IPC permissions for multi-user sharing (octal, default 0600)
slave {
pcm "hw:1,0"
rate 44000
}
}


Both VARA and ARDOP require 48KHz sample rate to be forced (default
is 44.1) so two new audio streams are required and this is
accomplished using the .asoundrc file configuration.

Below is a snip showing the previously configured dsnoop0 & dmix0
interfaces, were going to call them ARDOP2IN and ARDOP2OUT.

pcm.ARDOP2IN {type rate slave {pcm "plug:dsnooped0" rate 48000}}
pcm.ARDOP2OUT {type rate slave {pcm "plug:dmix0" rate 48000}}


Wine (for VARA) requires these 48KHz audio device streams, but in a
slightly different presentation to the system. Wine requires
asymmetrical streams that we currently do not have, these are
provisioned by combining the two previously configured ARDOP streams
into a new virtual device “asymwine”.

pcm.asymwine {
        type asym
        playback.pcm "ARDOP2OUT"
        capture.pcm "ARDOP2IN"
}

pcm.!default {
        type plug
        slave.pcm "asymwine"
}

pcm.dsp {
        type plug
        slave.pcm "asymwine"
}


The next bit gets hairy as we are now required to edit the Wine
Registry- what happens is that ‘winecfg enumerates (gathers) what
it can glean from the host operating system about the audio drivers,
unfortunately this process does not scrape the .asoundrc file so
this particular gotcha requires a couple of new entries in the
registry to be made by hand.

Run from the command line:

wine regedit

In the registry editor, navigate to:

HKEY_CURRENT_USER\Software\Wine\Drivers\winealsa.drv

From within winealsa.drv, create a new “Multi-string value”.

Name this key:

ALSAOutputDevices

Hit enter to save, then create another key and title it:

ALSAInputDevices

After adding the keys, double-click each newly created key to open
it in data entry mode. Insert the device name previously configured
in the .asoundrc file – asymwine, do this for BOTH ALSAOutputDevices
and ALSAInputDevices.



Close the registry editor and relax.

Now run “winecfg” again and navigate to the Audio tab, from the list
of each input/output it should now be possible to select the newly
appearing “asymwine” audio interface. If all things went to plan, be
sure to do this action for each of the 4 fields.

Apply and exit winecfg.

Open up VARA HF and navigate to sound settings to select the
asymwine interfaces.

This concludes the VARA part.





QtSoundModem (Packet)

We are assuming that QtSoundModem has already been set up using a
regular audio interface and all of your options and modem settings
are ready- if not, go do that first.

To configure QtSoundModem to use the dsnoop0/dmix0 device the INI
file has to be edited manually, any changes made with the GUI of
QtSoundModem will overwrite your manual changes and break your
setup, so consider fixing the permissions on the INI file so that it
cant write to the file using “chmod 444 QtSoundModem.ini”

Edit QtSoundModem.ini:

Find and replace the SndRX/TX lines:

SndRXDeviceName=:dsnooped0
SndTXDeviceName=:dmix0

That concludes the QtSoundModem setup.






ARDOP

Using a script to launch piardopc, tailored to your own system,
below is an example.

/home/pi/bin/piardopc 8515 ARDOP2IN ARDOP2OUT


8515 is the port ARDOP will listen for TNC connections on (as used
when configured in BPQ node suite etc).

ARDOP2IN and ARDOP2OUT are the virtual interfaces previously
configured in .asoundrc to provision the required 48KHz sample rate
streams.

This concludes the ARDOP setup.






Full disclosure

Thanks and credit due to Matt KB8UVN & Steve G7TAJ for the
dsnoop .asoundrc syntax presets to get the ball rolling.

Below is the full .asoundrc file that works for me:

@hooks [
         {
                 func load
                 files [
                         {
                                 @func concat
                                 strings [
                                         { @func datadir }
                                         "/alsa.conf.pulse/"
                                 ]
                         }
                 ]
                 errors false
         }
 ]

# Point applications to plughw:dsnooped0 for input and plug:dmix0 for output

pcm.dsnooped0 {
    type dsnoop
    ipc_key 50000
    ipc_key_add_uid false   # let multiple users share
    ipc_perm 0666           # IPC permissions for multi-user sharing
(octal, default 0600) slave {
        pcm "hw:1,0"
        channels 1
    }
}

pcm.dmix0 {
    type dmix
    ipc_key 60000
    ipc_key_add_uid false   # let multiple users share
    ipc_perm 0666           # IPC permissions for multi-user sharing
(octal, default 0600) slave {
        pcm "hw:1,0"
        rate 44000
    }
}

# Point ARDOP to ARDOP2IN and ARDOP2OUT for rate conversion

pcm.ARDOP2IN {type rate slave {pcm "plug:dsnooped0" rate 48000}}
pcm.ARDOP2OUT {type rate slave {pcm "plug:dmix0" rate 48000}}


# Wine: combine the capture and playback
pcm.asymwine {
        type asym
        playback.pcm "ARDOP2OUT"
        capture.pcm "ARDOP2IN"
}

# Wine: make a default plug for it
pcm.!default {
        type plug
        slave.pcm "asymwine"
}

# Wine: define a plug for /dev/dsp
pcm.dsp {
        type plug
        slave.pcm "asymwine"
}


73s
red  pe1r.-.r
--
PE1RRR <PE1RRR@PE1RRR.#NBW.NLD.EURO>



Read previous mail | Read next mail


 11.05.2024 17:56:59lGo back Go up