Loading ...
Sorry, an error occurred while loading the content.

Audigy 2 and Audigy4 OSS-emulation mixer remapping

Expand Messages
  • Rick Kunath
    Because of the large number of mixer controls on the Audigy2 and Audigy4 card mixers, some of the controls needed for operation of FLdigi (and other
    Message 1 of 32 , May 7, 2007
    • 0 Attachment
      Because of the large number of mixer controls on the Audigy2 and Audigy4
      card mixers, some of the controls needed for operation of FLdigi (and
      other application) controls using ALSA-OSS emulation are not mapped to
      the correct controls in the OSS emulation layer of ALSA for the above
      sound cards.

      Remapping the controls is an easy process and allows for the proper
      operation and adjustment of these controls from inside FLdigi, using the
      built-in FLdigi mixer controls. (Rx, Tx, and PCM)

      I have tested the described modifications under Mandriva
      2006/2007.0/2007.1, but can't speak to other distros. These should work
      for other distros as well, but I'll leave it to others to comment on
      possible anomalies that are distro-specific.

      On an Audigy2 or Audigy4 card, the Rx gain control FLdigi uses (IGAIN in
      ALSA-OSS-emulation) is not mapped to the correct ALSA mixer control. The
      correct control is "Analog Mix". To apply the remapping on a one time
      basis (resets on reboot) for testing, issue the following command in a
      console as root:

      echo 'IGAIN "Analog Mix" 0' > /proc/asound/card0/oss_mixer/

      This will make a temporary change and will allow one to verify the
      change works as expected.

      One additional remapping is needed for the Audigy4 cards. The PCM
      control in ALSA-OSS-emulation is not mapped to the correct ALSA mixer
      control. In this case the emulated OSS PCM control needs to be mapped to
      the control "PCM Capture". To apply the remapping on a one time basis
      (resets on reboot) for testing, issue the following command in a console
      as root:

      echo 'PCM "PCM Capture" 0' > /proc/asound/card0/oss_mixer

      Once you are satisfied that these changes operate as expected on your
      distro, changes can be made to apply these automatically on a reboot.

      I like to have startup scripts I have added readily accessible and
      readily apparent. For this reason I made changes to the rc.local file
      which point to an external script that does the actual remapping. I
      saved the actual remapping script in /root. There are other ways to
      accomplish this, but I liked this way of handling it.

      Here is what I did:

      Modify the /etc/rc/d/rc.local file (as root) adding the below to the end
      of the file, then save it:

      #
      # Added by RSK to remap oss_mixer to correct mapping for Audigy 2/4 cards
      #
      /root/remap-oss-mixer.sh
      #End RSK modifications

      This runs the actual remapping script located in the /root directory on
      boot.

      My entire /etc/rc.d/rc.local file looks like this:

      #!/bin/shremap-oss-mixer.sh
      #
      ### BEGIN INIT INFO
      # Provides: rc.local
      # X-Mandriva-Compat-Mode
      # Default-Start: 2 3 4 5
      # Short-Description: Local initialization script
      # Description: This script will be executed *after* all the other init
      scripts.
      # You can put your own initialization stuff in here if you
      don't
      # want to do the full Sys V style init stuff.
      ### END INIT INFO

      touch /var/lock/subsys/local

      #
      # Added by RSK to remap oss_mixer to correct mapping for Audigy 2/4 cards
      #
      /root/remap-oss-mixer.sh
      #End RSK modifications

      As most know, anything on a line starting with # is a comment, so enter
      anything you need to remind yourself about any changes made to the files.

      The below is the remapping script (remap-oss-mixer.sh) that I stored in
      /root:

      #!/bin/sh
      #
      ### BEGIN INIT INFO
      #
      #Remap IGAIN to Analog Mix control for Audigy2/4 cards
      #
      echo 'IGAIN "Analog Mix" 0' > /proc/asound/card0/oss_mixer
      #
      #The below needed only for the Audigy4 card to remap PCM to PCM Capture
      #
      echo 'PCM "PCM Capture" 0' > /proc/asound/card0/oss_mixer
      #End of RSK changes

      These scripts files are actually text files, and may be edited as such.
      To create the remap-oss-mixer.sh file simply create a text file and copy
      over the script text. Name the file remap-oss-mixer.sh, and make sure
      that it is marked as executable in file permissions. The file should be
      saved in /root. If you are using an Audigy2 card either comment out
      (with a #) or delete the line:

      echo 'PCM "PCM Capture" 0' > /proc/asound/card0/oss_mixer

      This line isn't needed for the Audigy2 card, as the mapping is already
      correct for the PCM control on this card.

      These remapping changes are made to the file:

      /proc/asound/card0/oss_mixer.

      In a single sound card system, this will be card0. Refer to the above
      path. Additional cards are card1, 2, etc. Adjust the path as appropriate
      to get to the correct card configuration files.

      The oss_mixer file is not a readable file, but you can easily see it's
      contents by making a copy on the Desktop and opening that with a text
      editor.

      Here are the contents of my Audigy4 oss_mixer file:

      VOLUME "Master" 0
      BASS "Tone Control - Bass" 0
      TREBLE "Tone Control - Treble" 0
      SYNTH "Synth" 0
      PCM "PCM Capture" 0
      SPEAKER "PC Speaker" 0
      LINE "Line" 0
      MIC "Mic" 0
      CD "CD" 0
      IMIX "" 0
      ALTPCM "Wave" 0
      RECLEV "" 0
      IGAIN "Analog Mix" 0
      OGAIN "" 0
      LINE1 "Aux" 0
      LINE2 "" 0
      LINE3 "" 0
      DIGITAL1 "IEC958 Optical" 0
      DIGITAL2 "" 0
      DIGITAL3 "" 0
      PHONEIN "Phone" 0
      PHONEOUT "Phone" 0
      VIDEO "Video" 0
      RADIO "" 0
      MONITOR "" 0

      You may find this useful to compare with the current mappings in your
      own oss_mixer file.

      You'll notice that there are lots of already mapped ALSA-OSS-emulation
      mixer controls that work properly. The changes described above correct
      two controls that are not mapped correctly in OSS-emulation by default.
      The same procedure may be used to remap any control desired.

      One other issue that may come up when using multiple sound cards is
      kernel module aliasing. This is what sets the card as /dev/dsp0, and
      dev/dsp1, etc. for multiple cards.

      On a single card system you would find the below as a part of the file
      /etc/modules.conf (scroll through the file to find it):

      alias sound-service-0-0 snd-mixer-oss
      alias sound-service-0-1 snd-seq-oss
      alias sound-service-0-3 snd-pcm-oss
      alias sound-service-0-8 snd-seq-oss
      alias sound-service-0-12 snd-pcm-oss

      These aliases alias the first sound card to /dev/dsp0.

      If a second sound card is present additional aliases will have to be
      added if they aren't there already. These will alias the second card to
      /dev/dsp1, etc.

      You only need the three additional aliases for cards 1, 2, etc. as below
      (because there is only one sequencer):

      alias sound-service-1-0 snd-mixer-oss
      alias sound-service-1-3 snd-pcm-oss
      alias sound-service-1-12 snd-pcm-oss

      If you have one sound card you don't need to worry about the additional
      aliases.

      Hopefully some of this will be useful to folks using the Audigy2 and
      Audigy4 cards.

      Both of these cards have been working very nicely here on several
      machines I have available for testing.

      Rick Kunath, k9ao
    • Graham Campbell
      ... AHA. This reference makes many things clear to a non-Ubuntu user like myself. It even covers the thing that started the whole discussion - redirecting
      Message 32 of 32 , May 21, 2007
      • 0 Attachment
        On Sun, 2007-05-20 at 21:11 -0400, Stephen Brown Jr wrote:
        > If your running Ubuntu, this wiki entry might help:
        >
        > https://help.ubuntu.com/community/RootSudo
        >
        > I've enabled root on all my Ubuntu boxes by issuing sudo passwd root,
        > then I can su in a terminal and do what I need to do from there. I
        > love Ubuntu and have been happily using it for two years, but it's
        > still beyond me why they don't think a root account should be enabled
        > by default.

        AHA. This reference makes many things clear to a non-Ubuntu user like
        myself. It even covers the thing that started the whole discussion -
        redirecting output from a sudo execution. It is clear that I had a
        number of mis-conceptions about Ubuntu.

        Thanks for the clarification

        --
        Graham Campbell
        AA2WR
      Your message has been successfully submitted and would be delivered to recipients shortly.