<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=7574&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Simple card-switcher for ALSA]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=7574</link>
		<description><![CDATA[The most recent posts in Simple card-switcher for ALSA.]]></description>
		<lastBuildDate>Wed, 26 Nov 2025 01:54:35 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=60111#p60111</link>
			<description><![CDATA[<p>Thanks! But what i&#039;m really interested in is how the cards display, i&#039;ve got the new prototype working but haven&#039;t done much testing or done my usual round of error checks yet. But it is working now on both card number and device number. I think that&#039;s as far as i&#039;m going to take it for now (baby-steps always), that should work for a huge percentage of users, anything that requires more elaborate measures is beyond the scope of this little utility at least for the time being.</p><p>Here&#039;s the new script proto, cleaned it up some too and fixed a backup bug (I think):</p><div class="codebox"><pre class="vscroll"><code>#!/bin/sh
# soundswitch – Simple utility to change soundcards, part of AlsaTune.

if [ ! -f ~/.asoundrc ]; then
    yad --error --title=&quot;Error&quot; --width=400 --center --text-align=center --window-icon=error \
        --text=&quot;\nNo config file (.asoundrc) found in user&#039;s home.\n\nChoose okay to install a generic version,\nor choose cancel to abort.&quot; \
        --button=&quot;Okay:0&quot; --button=&quot;Cancel:1&quot;
        
  if [ $? -eq 0 ]; then
    cp /usr/share/mxeq/.asoundrc ~/.asoundrc
  else
    exit 1
  fi
fi

CARDS=$(aplay -l | grep &quot;^card [0-9]&quot;)

CHOICE=$(echo &quot;$CARDS&quot; | yad --list --title=&quot;Select Sound Card&quot; \
    --column=&quot;Choose card/device&quot; --width=550 --height=300 --window-icon=info \
    --button=&quot;Apply:0&quot; --button=&quot;Cancel:1&quot;)

[ $? -ne 0 ] &amp;&amp; exit 1

# Extract both card and device number from the selected line
CARD_NUM=$(echo &quot;$CHOICE&quot; | grep -o &#039;card [0-9]&#039; | cut -d&#039; &#039; -f2)
DEV_NUM=$(echo &quot;$CHOICE&quot; | grep -o &#039;device [0-9]&#039; | head -n1 | cut -d&#039; &#039; -f2)
[ -z &quot;$DEV_NUM&quot; ] &amp;&amp; DEV_NUM=0

if [ -z &quot;$CARD_NUM&quot; ]; then
  yad --title=&quot;Error&quot; --width=300 --center --text-align=center --window-icon=error \
--text=&quot;\nNo card was selected. Exiting...&quot; --no-buttons --timeout=3
  exit 1
fi

cp ~/.asoundrc ~/.asoundrc.bak 2&gt;/dev/null || true

# Replace card/device number(s).
sed -i \
    -e &quot;s/hw:[0-9]*,[0-9]/hw:$CARD_NUM,$DEV_NUM/g&quot; \
    -e &quot;s/plughw:[0-9]*,[0-9]/plughw:$CARD_NUM,$DEV_NUM/g&quot; \
    -e &quot;s/card [0-9]/card $CARD_NUM/g&quot; \
    ~/.asoundrc

yad --title=&quot;Sound&quot; --window-icon=info --text-align=center --width=340 --center \
    --text=&quot;\nNow using Card $CARD_NUM – Device $DEV_NUM\n\nConfig backed up to ~/.asoundrc.bak&quot; \
    --button=gtk-ok:0</code></pre></div><p>The script as-is isn&#039;t what you&#039;d call precision, but there&#039;s an elegance to it in brevity of code and taking advantage of simple edits to a config file to completely change behavior.</p><p>Philosophy and methodology of use has to be taken into consideration, this little utility does not and should not work for someone with their own custom 500-line .asoundrc, if a user is that far into it then they know how to edit config files. This utility is for the garden-variety user who just wants sound to work and would be put-off by having to manually locate and edit config files that may be complete gibberish to them if they&#039;re not a nerd.</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Wed, 26 Nov 2025 01:54:35 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=60111#p60111</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=60108#p60108</link>
			<description><![CDATA[<p>@greenjeans will fake devices work for your testing ?</p><div class="codebox"><pre><code>~# modprobe snd-aloop snd-dummy</code></pre></div><div class="codebox"><pre><code>~# aplay -l 
card 3: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  Subdevices: 2/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
card 4: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
  Subdevices: 2/2
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (g4sra)]]></author>
			<pubDate>Tue, 25 Nov 2025 23:51:52 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=60108#p60108</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=60106#p60106</link>
			<description><![CDATA[<p>Well I can&#039;t help myself, working on a version of this script to extend it to sed device numbers as well as card numbers to .asoundrc. It still won&#039;t be suitable for crazy complex things like a 700 line .asoundrc, but should work like a charm for most folks.</p><p>Problem is i&#039;m working blind here as I have no machine that has multiple cards with at least one having multiple devices. So I can&#039;t fully test.</p><p>Also that script I posted above in addition to removing the legacy stuff, can also be swapped to /bin/sh as it&#039;s posix compliant, dash is quicker anyway, so that&#039;s a win.</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Tue, 25 Nov 2025 23:33:21 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=60106#p60106</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=60082#p60082</link>
			<description><![CDATA[<p>Git is worth it. I have been tweaking the kernel for decades, having git track my changes and re-apply them is a godsend.<br />I even now use it for full (small) system backups.</p>]]></description>
			<author><![CDATA[dummy@example.com (g4sra)]]></author>
			<pubDate>Tue, 25 Nov 2025 17:43:24 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=60082#p60082</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=60080#p60080</link>
			<description><![CDATA[<p>You&#039;re right of course, and I did register an account on Devuan&#039;s git a while back, I just haven&#039;t messed with it. I have never used git before so I don&#039;t know how bad the learning curve is...the thing is I already have multiple learning curves i&#039;m going through and git looks kind of like a pain in the butt, lol.</p><p>Packaging locally here using dpkg-deb is fast and uncomplicated. But again you&#039;re right that it might get some more testing if I used git.</p><p>This is the first year i&#039;ve branched out to more complex things than simple scripts, so i&#039;m still trying to get a feel for things.</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Tue, 25 Nov 2025 17:34:12 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=60080#p60080</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=60078#p60078</link>
			<description><![CDATA[<p>@greenjeans</p><div class="quotebox"><blockquote><div><p>or should I work on the next phase of this script and wait until I have it working before uploading</p></div></blockquote></div><p>I have seen someone (fsmithred ?, ralph.ronquist ?) offer someone project space on git.devuan.org.<br />Your project is quite small (no offence, small is beautiful <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" />) and therefore would not be a resource gobbler, and I am sure of interest to Devuan users even if unlikely to be qualified for packaging.<br />Uploading to git.devuan.org. you could concentrate on developing and the interested could follow your progress as (in)frequently as they choose.<br />Testing and bug reports could also be more forthcoming (at least in theory).</p>]]></description>
			<author><![CDATA[dummy@example.com (g4sra)]]></author>
			<pubDate>Tue, 25 Nov 2025 17:23:12 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=60078#p60078</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=60074#p60074</link>
			<description><![CDATA[<p>After several days of work I have a new version of AlsaTune packaged as of last night, working great for me, but as usual when I wake up the next morning there&#039;s always some little detail buzzing in my head, something that could be done better....</p><p>So I did some work on this card-switcher script as I mentioned above, enlarged the list window some, and added a check at the start of the script to check for ~/.asoundrc, and if absent it offers to install the generic one included with the package, or you can hit cancel to abort.</p><p>The script works great and fast for me and should for the vast majority of simple laptops and desktops. But going forward I want to improve detection and expand a bit, first thing I want to do is deal with sub-devices, that pesky second number, currently this script only swaps the card number.</p><p>And thus my dilemma today, should I upload the new AlsaTune as-is so hopefully it can get tested some more, or should I work on the next phase of this script and wait until I have it working before uploading a new AT....*sigh*....</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Tue, 25 Nov 2025 17:05:06 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=60074#p60074</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=59963#p59963</link>
			<description><![CDATA[<p>Yeah...so it seems there&#039;s no scroll function or auto-sizing for the yad list dialog, at least not in the old versions being used in the repo. For the moment I added a little height. arrgh.</p><p>I added an error check to look for ~/.asoundrc right at the start and exit if there isn&#039;t one. But now i&#039;m thinking in the error message to also add the ability to copy a simple .asoundrc (to be shipped with the mxeq/AT package) to the users home if there isn&#039;t one, and then continuing (or hit cancel to back out of course).</p><p>I&#039;ll be modding AT a fair bit to add a button for the card-switcher and some other functions including a button to test sound, using aplay to play a .wav file I made, just 3 seconds of a 500hz note, the idea being you can test whatever changes you made with the card-switcher right there in the gui after doing it, without having to cycle audio/video apps on and off.</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Fri, 21 Nov 2025 22:50:19 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=59963#p59963</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=59896#p59896</link>
			<description><![CDATA[<p>Hah, I love it...yep...Vuu-do Linux, handcrafted using stepwise refinement and multi-solutional iterations (hit-or-miss). <img src="https://dev1galaxy.org/img/smilies/lol.png" width="15" height="15" alt="lol" /></p><p>Thanks for the help, I really appreciate it and at some point i&#039;ll take you up on the offer to test the next version.</p><p>724 lines in asound.conf? Holy crap, that&#039;s epic! Yeah I can see where my little script probably wouldn&#039;t be good for that system, but it&#039;s a dang fine one for testing the limits of it for sure.</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Thu, 20 Nov 2025 18:02:43 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=59896#p59896</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=59844#p59844</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>a lot of trial-and-error</p></div></blockquote></div><p>With the work you put in for the benefit of others I judge that you are entitled to use the computer science term for that, <strong>stepwise refinement</strong> <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><div class="quotebox"><blockquote><div><p>i&#039;d like to pursue it and figure out all the edge-cases</p></div></blockquote></div><p>I don&#039;t mind throwing it at my workstation on occasion and reporting back, I guarantee it is an edge case, my /etc/asound.conf contains 724 lines.</p>]]></description>
			<author><![CDATA[dummy@example.com (g4sra)]]></author>
			<pubDate>Tue, 18 Nov 2025 22:45:55 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=59844#p59844</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=59840#p59840</link>
			<description><![CDATA[<p>Ahh I gotcha, and that&#039;s the kind of thing I need to know to proceed, problem is I don&#039;t have a machine around here to test, I get one line on my single-card lappy, two on the library machine...without having a complex machine with multiple outputs around to test on it&#039;s gonna make it really hard for me to extend this script. I kinda need to see what things are doing, my methods involve a lot of trial-and-error.</p><p>Basic philosophy/use-case is for Vuu-do as it already has a working alsa system, and is meant for simple everyday garden-variety use, just a quick switch for those machines that have an analog and an HDMI output as most of the time the dual-setups default to HDMI as card 0.</p><p>At least at this stage...baby steps...but i&#039;d like to pursue it and figure out all the edge-cases and sub-devices and such so I can package it with AT for general use at some point.</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Tue, 18 Nov 2025 22:20:08 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=59840#p59840</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=59815#p59815</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>Ummm, GPU?</p></div></blockquote></div><p>Outputs are capable of carrying digital sound as well as video, so consequently show up in ALSA as individual sink devices.</p><div class="codebox"><pre><code>ls -ld /proc/asound/card1/pcm*
dr-xr-xr-x 4 root root 0 Nov 18 13:07 /proc/asound/card1/pcm3p
dr-xr-xr-x 4 root root 0 Nov 18 13:07 /proc/asound/card1/pcm7p
dr-xr-xr-x 4 root root 0 Nov 18 13:07 /proc/asound/card1/pcm8p
dr-xr-xr-x 4 root root 0 Nov 18 13:07 /proc/asound/card1/pcm9p</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (g4sra)]]></author>
			<pubDate>Tue, 18 Nov 2025 13:06:23 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=59815#p59815</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=59797#p59797</link>
			<description><![CDATA[<p>Ummm, GPU? Ya lost me there somewhere...</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Tue, 18 Nov 2025 01:04:54 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=59797#p59797</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=59787#p59787</link>
			<description><![CDATA[<p>Window-size: 11 Lines (four of those are for the GPU alone)<br />So for a Twin GPU system that could be eight just to start with.<br />I suppose a scrollbar would cover all bases, don&#039;t want to push you to loose the KISS aspect though.</p>]]></description>
			<author><![CDATA[dummy@example.com (g4sra)]]></author>
			<pubDate>Mon, 17 Nov 2025 23:40:20 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=59787#p59787</guid>
		</item>
		<item>
			<title><![CDATA[Re: Simple card-switcher for ALSA]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=59781#p59781</link>
			<description><![CDATA[<p>^^Much appreciated!</p><p>No .asoundrc is a case, at the start of this endeavour I am writing this to be included in AlsaTune/Vuu-do which will already have an .asoundrc in the system, but like other things I want to also make a generic/portable version that can be used anywhere so that&#039;s the next target for functionality.</p><p>Window-size: How many cards are in your list? I had envisioned entries for just a couple, can you elaborate? Do I need a scroll function?</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Mon, 17 Nov 2025 22:30:46 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=59781#p59781</guid>
		</item>
	</channel>
</rss>
