Evening, all.
Recently I posted about a new hardware purchase.....a pair of SOMiC wireless 'gaming'-type headphones. I use headphones of an evening, because Mama's bedroom is right next to mine (where my rig is set up); she's a light sleeper at the best of times, and as she's getting steadily older she simply doesn't sleep as well as she used to. Out of courtesy, I try not to disturb her, given that she turns in a lot earlier than I do.
I've had a set of Logitech H340s for quite a while; although the somewhat chunky connector contains its own sound card, making use of the headset a doddle, these are wired. I don't have a whole lot of space in my room - "bijou" would be an apt description! - and although the sound quality is excellent, I keep getting tangled-up with the cable. Nearly tripped over once or twice....
---------------------------
With mice & keyboards, I've been wireless for ages. I figured it was time to go wireless with the headset as well, more for convenience than anything. So, I treated myself to the SOMiC headset, since I still wanted the convenience of the microphone as well. One the H340s, it swings up or down as & when it's needed; with the SOMiC set, it plugs into a standard 3.5 mm jack socket, so can be completely removed when not wanted.
Anyways; to the 'meat' of my missive. I know you can easily switch between multiple cards with Kirk's MultipleSoundCardWizard, but a re-boot is required before Retrovol will show the correct set of sliders. I got to thinking; there had to be a quicker way of doing this that didn't involve a re-boot. And so, I've devised a way of 'instant' card-swapping that doesn't involve re-booting, which works for me.
In /mnt/home, I created a directory called "AUDIO". Within this, two more, called "Default" & "Headphone". In each of these, I've placed a copy of /root/.retrovolrc....Retrovol's config file, respectively as it is with the system card engaged, and the other with the headset's card engaged.
In /usr/local/bin, I created 2 scripts; 'audio_default' & 'audio_head'. These read as follows (these are in jrb's Quirky64 'April' 7.0.1 'lite'):-
'audio_default':-
Code: Select all
#!/bin/sh
#
# Set Retrovol to default card...
#
yad --no-buttons --geometry=+750+30 --undecorated --image /usr/local/lib/X11/pixmaps/soundcard.png --timeout=6
#
rm /root/.retrovolrc
#
cp /mnt/home/Quirky7_64_lite/AUDIO/Default/.retrovolrc /root/.retrovolrc
#
killall retrovol
retrovol -hide
'audio_head':-
Code: Select all
#!/bin/sh
#
# Set Retrovol to headphones...
#
yad --no-buttons --geometry=+750+30 --undecorated --image /usr/local/lib/X11/pixmaps/headphones.png --timeout=6
#
rm /root/.retrovolrc
#
cp /mnt/home/Quirky7_64_lite/AUDIO/Headphone/.retrovolrc /root/.retrovolrc
#
killall retrovol
retrovol -hide
All these do is to delete the /root/.retrovolrc config file, replace it with the required one, kill retrovol & immediately restart it with the '-hide' option.....now reading from the required config file, so sliders/layout, etc, is immediately there. I don't know about the rest of you, but I don't have anything like all the soundcard's available sliders set to display.....only the ones I actually need/use.
This works because .retrovolrc also specifies the sound card to use, as well as what to display and read from.
A third script gives me a small YAD-powered GUI to choose the required set-up, along with a 3rd button to access MultipleSoundCardWizard directly:-
Code: Select all
#!/bin/sh
#
# Script to choose which audio card is required, and reset Retrovol to use it...
#
yad --center --window-icon=/usr/local/lib/X11/pixmaps/audiorecord.png --title=" AudioCardChooser " --form --text=" CHOOSE DESIRED CARD...
---------------------------------
Select required action:-" \
--field=" ~Default card~ ":fbtn "audio_default" \
--field=" ~Headphone card~ ":fbtn "audio_head" \
--field=" ~MSCWizard~ ":fbtn "Multiple-Sound-Card-Wizard" \
--no-buttons --close-on-unfocus
Which looks like this:-
Along with all this, when each of the selector scripts is run, it displays a small relevant image (again, YAD-powered), to indicate which card has been selected:-
Default:-
....and headset:-
Yeah, I know it would be simpler to just use GTKdialog.....but y'all know what a fussy sod I am when it comes to display stuff; why should simple notifcations drop below the radar?
(To activate the GUI, I've added an extra entry toward the bottom of the main Menu, between separators; like so:-
Code: Select all
<Separator/>
<Program label="AudioCardChooser" icon="/usr/local/lib/X11/pixmaps/audiorecord.png">audiocardchooser</Program>
<Separator/>
.....achieved by a simple edit of /etc/xdg/templates/_root_jwmrc.)
------------------------------------
So there you are; one Puppy user's method for instant swapping between multiple audio cards.....without the need for a reboot. Works for me, anyway..!
(The same set-up is now in all my Pups, by the simple expedient of making a .pet of those scripts that don't change. The selector scripts just need editing to point to the relevant Puppy directory in /mnt/home; the MultipleSoundCardWizard has to be run a couple of times - along with re-boots - to obtain the relevant .retrovolrc set-ups for the specific cards. A couple of short edits later, and everything's up-and-running!)
Mike.