Code Monkey home page Code Monkey logo

Comments (2)

tmigone avatar tmigone commented on June 19, 2024

Raspberry Pi

snd_bcm2835 kernel module has two modes of operation:

  1. without parameters, it will create a single ALSA card (aplay -l) with two/three different "devices". You can switch between them using amixer cset numid=3 x.

  2. using parameters: snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_compat_alsa=0. It will create two/three different cards.

Considerations

  • Mode 2 allows you to have one pulse sink for each output (HDMI0/HDMI1/3.5mm) which is what we want because standarization is good! (pactl load-module alsa-sink device=hw:CARD=HDMI,DEV=0)
  • Mode 2 is not the default module configuration. So enabling it requires either editing cmdline.txt or modprobe-ing the module on startup.
  • Mode 1, pulseaudio overrides the default amixer card so amixer cset numid=3 x needs to be amixer -c 0 cset numid=3 x.
  • Mode 2 removes the need of installing alsa-utils package which can spur confusion.

Neat bash commands to get kernel module parameters:

cat /proc/modules | cut -f 1 -d " " | while read module; do \
 echo "Module: $module"; \
 if [ -d "/sys/module/$module/parameters" ]; then \
  ls /sys/module/$module/parameters/ | while read parameter; do \
   echo -n "Parameter: $parameter --> "; \
   cat /sys/module/$module/parameters/$parameter; \
  done; \
 fi; \
 echo; \
done

from audio.

tmigone avatar tmigone commented on June 19, 2024

Reopening to further evaluate in the future...

from audio.

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.