开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: SBITX v3 - Ability to use a Headset for phone modes


Paul
 

Notes for myself, series of tasks required to solve this:
  • Make whatever is sent to the radio speaker go the USB audio device as well, regardless of what it is
    • arecord -D "plughw:CARD=Loopback,DEV=1" -f cd | aplay -D "plughw:CARD=II,DEV=0? //works from terminal command line, reduced gain due to fixed gain sent to loopback interface, slightly better quality audio than from the speaker with the -f cd parameters added
  • Make the radio volume control work for both audio devices
  • Make whatever is input from USB audio device microphone go to the same input point used for the physical microphone (logically at least)
    • arecord -D "plughw:CARD=II,DEV=1" | aplay -D "plughw:CARD=Loppback_1,DEV=0" //not tested, but think it should work from a second terminal command line?
  • Make the Mic gain work for both USB and physical microphone devices
  • Identify where input/output devices are defined and then used as parameters passed to other code modules e.g. sound.h, sbitx_sound.c or within sbitx.c
    • Think this may be done in sbitx.c within void setup_audio_codec(){? ?strcpy(audio_card, "hw:0");? //rest of code snipped,
    • I have written a module for USB device which is? a copy of the one used but refers to USB device instead, 1st line is?strcpy(audio_card_usb, "hw:5"); rest of code module same but replace audio_card with audio_card_usb
  • Identify the appropriate parameters in the called modules and replace with an array to accept multiple devices
    • then replace the device parameters within the modules/subroutines to use the array name instead
  • Once the above is solved, make sure that radio speaker and microphone(s) are the default if any additional configured audio device is disconnected
  • or find a way to incorporate the command line snippets above so that they are part of the app at start rather than tying up 2 terminal sessions to run them outside the app. Volume/Gain would need to be adjusted as part of this to get satisfactory levels
  • If the code is updated and a modular approach defined then it should be possible to add Bluetooth Audio capability at some point in the distant future as the same approach used to solve the tasks above should be possible by adding the interface to the appropriate sections i.e. definition and arrays
  • further nice to have would be the ability to select from the app which device is to be used for rx audio or tx audio
The possible solution I outlined in the above message while it works is not the right answer especially now I have outlined the tasks needed to solve the problem and the problems already identified above.?
I tried a couple of software approaches to mapping the app process and calls but not been able to get them working on the pi as yet, so its the long method which takes a lot of time.?

It has been a very very long time since I had to do any real coding so any coders out there, feel free to help :-)

Paul G0KAO
?

Join [email protected] to automatically receive all group messages.