Code Monkey home page Code Monkey logo

Comments (1)

okyeron avatar okyeron commented on August 21, 2024

Reposting this from the lines thread. (and adding more details as reference material)

I was able to "fix" the load order with the following:

create or edit /etc/modprobe.d/alsa-base.conf

then add

# This sets the index value of the cards but doesn't reorder.
# index of -2 instructs ALSA to never use a card as primary
options snd_usb_audio index=-2
options snd_soc_rpi_proto index=0

# Does the reordering.
options snd slots=snd_soc_rpi_proto, snd_usb_audio

Further testing just now - this "reordering" seems to happen on a base install of Buster with only my soundcard setup - in my case this is the WM8731 codec on the Fates DIY board.

I observe the problem plugging in A Waldorf Blofeld and a Teensy midi device and rebooting.

pi@raspberrypi:~ $ cat /proc/asound/cards
 0 [Blofeld        ]: USB-Audio - Blofeld
                      Waldorf Music GmbH Blofeld at usb-3f980000.usb-1.1.3, full speed
 1 [twohost        ]: USB-Audio - twohost
                      denkioto twohost at usb-3f980000.usb-1.1.2, full speed
 2 [sndrpiproto    ]: snd_rpi_proto - snd_rpi_proto
                      snd_rpi_proto

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 2: sndrpiproto [snd_rpi_proto], device 0: WM8731 HiFi wm8731-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

According to this archilinux/ALSA doc, /etc/asound.conf could be configured to the specific hardware device

This looked promising:

In most cases it is recommended to use sound card names instead of number references, which also solves boot order problem. Therefore the following would be correct for the above example.

But... the devices are still ordered dynamically, so the primary sound card can change card positions.

So using snd slots in /etc/modprobe.d/alsa-base.conf (as above) appears to have the most consistent way of ensuring which card gets assigned to primary

Found a decent ALSA reference that mentions the "slots" here

Problems with alsa.conf and udev
On modern GNU/Linux systems, udev takes care of discovering hardware and loading/unloading Alsa. There is one drawback to udev. Udev will load Alsa modules in an undefined order. After each reboot or plugging/unplugging a device, there is no guarantee that a device is renamed using the same hw:x,y numbers. For example, if you have two USB devices on your systems, for example an Audeon USB and an Edirol UA-25, after each reboot, a card can be "hw:0,0" and the other "hw:1,0", each time randomly.

from norns-image.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.