Skip to main content
added 56 characters in body
Source Link
Thomas
  • 278
  • 2
  • 11

The above is the short answer, and solves it for programs with a dropdown that exposes the ID.

Good questions and answers on these other threads:

This solves it for programs with a dropdown that exposes the ID.

While this doesn't set a consistent ALSA sound card number, it does make it obvious which is which, from. Per aplay -l:

ToIf you want to go further and get consistent ALSA numbering you can create a set of symlinks. E.g.

Good questions and answers on these other threads:

This solves it for programs with a dropdown that exposes the ID.

While this doesn't set a consistent ALSA sound card number, it does make it obvious which is which, from aplay -l:

To get consistent ALSA numbering you can create a set of symlinks. E.g.

The above is the short answer, and solves it for programs with a dropdown that exposes the ID.

Good questions and answers on these other threads:

While this doesn't set a consistent ALSA sound card number, it does make it obvious which is which. Per aplay -l:

If you want to go further and get consistent ALSA numbering you can create a set of symlinks. E.g.

added 1030 characters in body
Source Link
Thomas
  • 278
  • 2
  • 11

The easiest solution is to overwrite the id attribute based on the USB path.

It seems that the simple solution is to place this in /etc/udev/rules.d/99-myrules.conf:

SUBSYSTEM=="sound",KERNELS=="1-1.4.4:1.0",ATTR{id}="CODEC_7300" SUBSYSTEM=="sound",KERNELS=="1-1.3.4:1.0",ATTR{id}="CODEC_9700" 

Take the KERNELS from udevadm info -ap /sys/class/sound/controlC2, where 2 is the index of the audio card.

Good questions and answers on these other threads:

This solves it for programs with a dropdown that exposes the ID.

While this doesn't set a consistent ALSA sound card number, it does make it obvious which is which, from aplay -l:

**** List of PLAYBACK Hardware Devices **** [...] card 2: CODEC_7300 [USB Audio CODEC], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 3: CODEC_9700 [USB Audio CODEC], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 

To get consistent ALSA numbering you can create a set of symlinks. E.g.

KERNEL=="controlC[0-9]*", DRIVERS=="usb", PROGRAM="/usr/bin/alsa_name.sh %k", SYMLINK+="%c" KERNEL=="hwC[D0-9]*", DRIVERS=="usb", PROGRAM="/usr/bin/alsa_name.sh %k", SYMLINK+="%c" KERNEL=="midiC[D0-9]*", DRIVERS=="usb", PROGRAM="/usr/bin/alsa_name.sh %k", SYMLINK+="%c" KERNEL=="pcmC[D0-9cp]*", DRIVERS=="usb", PROGRAM="/usr/bin/alsa_name.sh %k", SYMLINK+="%c" 

And have a script that checks the path and returns a suitable name. E.g.

#!/bin/bash NAME="$1" if echo "$DEVPATH" | grep 1-1.4; then NAME="$(echo "$NAME" | sed -r 's/(.*)C([0-9]+)(.*)/\1C11\3/')" fi if echo "$DEVPATH" | grep 1-1.3; then NAME="$(echo "$NAME" | sed -r 's/(.*)C([0-9]+)(.*)/\1C12\3/')" fi exec echo "snd/$NAME" 

You can then create a consistent PulseAudio device like so:

N=2N=11 DEV="radio-7300" pacmd load-module module-alsa-card \ device_id="${N}" name="${DEV}" \ card_name="alsa_card.platform-${DEV}_audio" \ namereg_fail=false tsched=no fixed_latency_range=no \ ignore_dB=no deferred_volume=yes use_ucm=yes \ card_properties="module-udev-detect.discovered=1" pacmd suspend-sink alsa_output.${DEV}.analog-stereo no pacmd suspend-source alsa_input.${DEV}.analog-stereo no   

The easiest solution is to overwrite the id attribute based on the USB path.

It seems that the simple solution is to place this in /etc/udev/rules.d/99-myrules.conf:

SUBSYSTEM=="sound",KERNELS=="1-1.4.4:1.0",ATTR{id}="CODEC_7300" SUBSYSTEM=="sound",KERNELS=="1-1.3.4:1.0",ATTR{id}="CODEC_9700" 

Take the KERNELS from udevadm info -ap /sys/class/sound/controlC2, where 2 is the index of the audio card.

Good questions and answers on these other threads:

This solves it for programs with a dropdown that exposes the ID.

While this doesn't set a consistent ALSA sound card number, it does make it obvious which is which, from aplay -l:

**** List of PLAYBACK Hardware Devices **** [...] card 2: CODEC_7300 [USB Audio CODEC], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 3: CODEC_9700 [USB Audio CODEC], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 

You can then create a consistent PulseAudio device like so:

N=2 DEV="radio-7300" pacmd load-module module-alsa-card \ device_id="${N}" name="${DEV}" \ card_name="alsa_card.platform-${DEV}_audio" \ namereg_fail=false tsched=no fixed_latency_range=no \ ignore_dB=no deferred_volume=yes use_ucm=yes \ card_properties="module-udev-detect.discovered=1" pacmd suspend-sink alsa_output.${DEV}.analog-stereo no pacmd suspend-source alsa_input.${DEV}.analog-stereo no 

The easiest solution is to overwrite the id attribute based on the USB path.

It seems that the simple solution is to place this in /etc/udev/rules.d/99-myrules.conf:

SUBSYSTEM=="sound",KERNELS=="1-1.4.4:1.0",ATTR{id}="CODEC_7300" SUBSYSTEM=="sound",KERNELS=="1-1.3.4:1.0",ATTR{id}="CODEC_9700" 

Take the KERNELS from udevadm info -ap /sys/class/sound/controlC2, where 2 is the index of the audio card.

Good questions and answers on these other threads:

This solves it for programs with a dropdown that exposes the ID.

While this doesn't set a consistent ALSA sound card number, it does make it obvious which is which, from aplay -l:

**** List of PLAYBACK Hardware Devices **** [...] card 2: CODEC_7300 [USB Audio CODEC], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 3: CODEC_9700 [USB Audio CODEC], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 

To get consistent ALSA numbering you can create a set of symlinks. E.g.

KERNEL=="controlC[0-9]*", DRIVERS=="usb", PROGRAM="/usr/bin/alsa_name.sh %k", SYMLINK+="%c" KERNEL=="hwC[D0-9]*", DRIVERS=="usb", PROGRAM="/usr/bin/alsa_name.sh %k", SYMLINK+="%c" KERNEL=="midiC[D0-9]*", DRIVERS=="usb", PROGRAM="/usr/bin/alsa_name.sh %k", SYMLINK+="%c" KERNEL=="pcmC[D0-9cp]*", DRIVERS=="usb", PROGRAM="/usr/bin/alsa_name.sh %k", SYMLINK+="%c" 

And have a script that checks the path and returns a suitable name. E.g.

#!/bin/bash NAME="$1" if echo "$DEVPATH" | grep 1-1.4; then NAME="$(echo "$NAME" | sed -r 's/(.*)C([0-9]+)(.*)/\1C11\3/')" fi if echo "$DEVPATH" | grep 1-1.3; then NAME="$(echo "$NAME" | sed -r 's/(.*)C([0-9]+)(.*)/\1C12\3/')" fi exec echo "snd/$NAME" 

You can then create a consistent PulseAudio device like so:

N=11 DEV="radio-7300" pacmd load-module module-alsa-card \ device_id="${N}" name="${DEV}" \ card_name="alsa_card.platform-${DEV}_audio" \ namereg_fail=false tsched=no fixed_latency_range=no \ ignore_dB=no deferred_volume=yes use_ucm=yes \ card_properties="module-udev-detect.discovered=1" pacmd suspend-sink alsa_output.${DEV}.analog-stereo no pacmd suspend-source alsa_input.${DEV}.analog-stereo no   
added 1030 characters in body
Source Link
Thomas
  • 278
  • 2
  • 11

The easiest solution is to overwrite the id attribute based on the USB path.

It seems that the simple solution is to place this in /etc/udev/rules.d/99-myrules.conf:

SUBSYSTEM=="sound",KERNELS=="1-1.4.4:1.0",ATTR{id}="CODEC_7300" SUBSYSTEM=="sound",KERNELS=="1-1.3.4:1.0",ATTR{id}="CODEC_9700" 

Take the KERNELS from udevadm info -ap /sys/class/sound/controlC2, where 2 is the index of the audio card.

Good questions and answers on these other threads:

This solves it for programs with a dropdown that exposes the ID.

While this doesn't set a consistent ALSA sound card number, it does make it obvious which is which, from aplay -l:

**** List of PLAYBACK Hardware Devices **** [...] card 2: CODEC_7300 [USB Audio CODEC], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 3: CODEC_9700 [USB Audio CODEC], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 

You can then create a consistent PulseAudio device like so:

N=2 DEV="radio-7300" pacmd load-module module-alsa-card \ device_id="${N}" name="${DEV}" \ card_name="alsa_card.platform-${DEV}_audio" \ namereg_fail=false tsched=no fixed_latency_range=no \ ignore_dB=no deferred_volume=yes use_ucm=yes \ card_properties="module-udev-detect.discovered=1" pacmd suspend-sink alsa_output.${DEV}.analog-stereo no pacmd suspend-source alsa_input.${DEV}.analog-stereo no 

It seems that the simple solution is to place this in /etc/udev/rules.d/99-myrules.conf:

SUBSYSTEM=="sound",KERNELS=="1-1.4.4:1.0",ATTR{id}="CODEC_7300" SUBSYSTEM=="sound",KERNELS=="1-1.3.4:1.0",ATTR{id}="CODEC_9700" 

Take the KERNELS from udevadm info -ap /sys/class/sound/controlC2, where 2 is the index of the audio card.

Good questions and answers on these other threads:

This solves it for programs with a dropdown that exposes the ID.

The easiest solution is to overwrite the id attribute based on the USB path.

It seems that the simple solution is to place this in /etc/udev/rules.d/99-myrules.conf:

SUBSYSTEM=="sound",KERNELS=="1-1.4.4:1.0",ATTR{id}="CODEC_7300" SUBSYSTEM=="sound",KERNELS=="1-1.3.4:1.0",ATTR{id}="CODEC_9700" 

Take the KERNELS from udevadm info -ap /sys/class/sound/controlC2, where 2 is the index of the audio card.

Good questions and answers on these other threads:

This solves it for programs with a dropdown that exposes the ID.

While this doesn't set a consistent ALSA sound card number, it does make it obvious which is which, from aplay -l:

**** List of PLAYBACK Hardware Devices **** [...] card 2: CODEC_7300 [USB Audio CODEC], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 3: CODEC_9700 [USB Audio CODEC], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 

You can then create a consistent PulseAudio device like so:

N=2 DEV="radio-7300" pacmd load-module module-alsa-card \ device_id="${N}" name="${DEV}" \ card_name="alsa_card.platform-${DEV}_audio" \ namereg_fail=false tsched=no fixed_latency_range=no \ ignore_dB=no deferred_volume=yes use_ucm=yes \ card_properties="module-udev-detect.discovered=1" pacmd suspend-sink alsa_output.${DEV}.analog-stereo no pacmd suspend-source alsa_input.${DEV}.analog-stereo no 
Source Link
Thomas
  • 278
  • 2
  • 11
Loading