EzDevInfo.com

alsa interview questions

Top alsa frequently asked interview questions

Is there a way to raise/lower the volume in Linux without using a graphical tool?

Is there a way to raise/lower ALSA's volume without using a graphical tool? I am currently using MPD along with MPC mapped to hotkeys to change the volume, but I recently switched music players and I would rather not have MPD lying around just to manage the volume (in addition, mpd doesn't work well with esound which I am also using).

NOTE: I am not using a desktop environment like GNOME so DE-specific solutions are not applicable in my case.


Source: (StackOverflow)

Audio Line-In on Ubuntu/Linux Mint

I'm currently on Windows, and want to switch to Linux, but some hardware issues are preventing me. Mainly, I have a sound card that supports Line-In. On Windows, anything I plug into the line-in gets outputted to the speakers.

However, when I installed Linux, because there is not a control application that comes with the driver, I have no idea how to set this up. I tried going to the sound settings and it doesn't seem to be there.

I also want to configure it for 2.1 sound, and do not know how to do that...

Anyone here done it before?

Thanks in advance for the help!


Source: (StackOverflow)

Advertisements

How to configure ALSA?

After switching from Unity to XFCE, I ran into difficulties with my sound configuration. I have multiple sound cards on my system, the one that I want to use is the last one to be loaded by the kernel. ALSA appears to be using the first one by default.

In addition, I cannot use sound in more than one application concurrently, I get errors like "sound device in use", etc. Can anyone provide me with some insight on the ALSA architecture, the tools I need to use in order to probe the system and advice on how to structure the configuration file.


Source: (StackOverflow)

What do ALSA devices like "hw:0,0" mean? How do I figure out which to use?

I've searched over and over and can't find any explanation of what "hw:0,0" means. How do I determine the number of my USB audio card? MPD requires me to enter something like this:

audio_output {
        type                    "alsa"
        name                    "Sound Card"
        device                  "hw:0,0"     # optional
        format                  "44100:16:2" # optional
}

If I do "alsamixer -c 1" it opens the USB card's volume control, but that really doesn't help me.

Where can I find a list of device names/numbers on my system? Are they resilient to hardware changes? If I remove card 2, does card 3 become card 2? Are there other ways to identify devices? Where can I find documentation for any of this?


Source: (StackOverflow)

How to disable Auto-Mute Mode?

In alsamixer, there is an option called "Auto-Mute Mode", and it's enabled by default.

But now I want to disable it. I've tried different keys but failed.

Any idea? 0_0

enter image description here


Source: (StackOverflow)

How to make Alsa pick a preferred sound device automatically?

I bought an USB sound card. I'd like to set up my Linux desktop so that it prefers the USB device, if it is plugged in and automatically switches as the device is (un)plugged. Is it possible, and how?


Source: (StackOverflow)

How can I make Chromium use a different ALSA device?

I need one instance of Chromium on Linux to target a different sound card than the default, including Flash. Is there anyway to do this easily?


Source: (StackOverflow)

ALSA PulseAudio sound output when switching between headphones and laptop speaker

Since I installed PulseAudio on my Gentoo system I've been having no audio output from my laptop's speakers when un-plugging the headphones jack.

I suppose the problem lies in how ALSA and PulseAudio manage the audio controls. When headphones are plugged everything is perfectly ok, alsa controls for the Intel HDA PCH are configured correctly so that 'Master' and 'Headphones' volume bars are correctly configured (I can tell this by looking at alsamixer with root privileges). When I un-plug the headphone jack, volume settings automatically change in a apparently correct way. That is, the 'Headphone' bar is muted and set to 0, while the 'Speaker' bar is un-muted and maxed out (while it gets muted when plugging the headphone jack). The 'Master' is always left un-muted and with the desired volume level. I can actually make the speakers output work by manually un-mute and pump-up the headphones output with alsamixer. But I would have to do this operation every time a plug/un-plug headphones. So is there some way to fix this? Maybe somehow decouple headphones output from speaker output in the ALSA system?

My laptop is an HP Pavilion G6 from 2011.

Thanks.


Source: (StackOverflow)

Getting sound to play from the speakers on a Headless 9.04 Ubuntu Serve

I have this Ubuntu Server running in my room and i wanted to use it as an alarm clock, so i decided to make a C++ program for it (i know i could've used cron but meh). The problem is the fact that i can't get any sound to play from my speaker (i had installed Media Player Daemon(MPD) with mpc's interface). When i try to play some music over SSH, using mpc, nothing plays from the server's speaker.

I know that i am probably not furnishing enough info but i can supply more if you ask!

(my mpd is setup to use ALSA)

i have to log as root to use alsa apparently... when i try the first command it works fine, the second tells me: "Unable to find simple control 'PCM, 0" also, i tried this on Headphone, Front, but while using amixer, i noticed that it says that even at 100% these device have 0.0dB....maybe that'S not normal...

answer to your questions:

  1. i used the the server edition (with LAMP)
  2. it is not running any X stuff.
  3. only the services are started when the machine start, i never have to physically logon
  4. i login using ssh but since it doesn't have X, i cannot use the X argument.
  5. i did not try this, in fact installing X isn't really an option for me...

Source: (StackOverflow)

How to use synchronous endpoint of USB audio device?

I want to play the same sound over several USB audio devices in sync. Last time I tried something like this was about 2001 and it was successful -- and the pair of Griffin iMics I used back then still work in that usage, but I want more channels now.

I'm having trouble getting this to work with more recent USB Audio devices. I have some devices with C-Media chips, which creates a lot of crackles and pops and drift out of sync relative to the iMics; another device with a TI chip doesn't crackle but still drifts out of sync.

According to my understanding of how USB audio works, the sync problems would be consistent with the iMics using Synchronous clocking and the others using Asynchronous clock.

Now, when I do lsusb -v I see that each of my devices exposes multiple endpoints, some Synchronous, some Asynchronous, and some Adaptive. So I need some way to instruct the audio driver to use the synchronous endpoint. That's where I'm stuck.

  • How can I tell which endpoints are being used? lsof reports a /dev/snd/pcmXXXXX are in use, but I'm not sure whether that corresponds to any particular endpoint. I can see information about endpoints in /sys/bus/usb but I don't know how to tell of any of the endpoints are active.
  • How can I change which endpoint is used, by configuring ALSA or some other library? I've tried looking through the ALSA sources but haven't found any parts that tell how it selects which endpoint to use.

Source: (StackOverflow)

Restore sound configuration

After install some packages, I don't have sound! I installed Rosegarden, VMPK (piano software), Drumstick Virtual Piano and TiMidity. At the beginning, all works fine, but when I reset my PC, I don't listen anything.

I would like how can I reinstall Alsa. I want to have it completely new, all the settings by default, for example when Ubuntu is installed.


Source: (StackOverflow)

Ubuntu and XFCE: unmute sound

I've installed XFCE for Ubuntu and use it as my default X session. After this change some sound problems appeared:

I can mute sound with alsamixer or with hotkey on a keyboard. But just reenable it isn't enough to unmute sound.

In order to unmute it I need to:

  • go to alsamixer:
  • Mute master, headphone and speaker
  • Unmute one by one master headphone and speaker quickly and in this exact order

This is the only way I can make it work again.

The problem didn't appear when I use handphones.

How can it be?


Source: (StackOverflow)

Change volume from bash

I got this far (from .bashrc):

alias i="amixer -c 0 -- sset Master playback +1dB"
alias d="amixer -c 0 -- sset Master playback -1dB"
alias v4="amixer -c 0 -- sset Master playback 40%"
alias v8="amixer -c 0 -- sset Master playback 80%"

The first two rows should work, if I read the man amixer page correctly, and they don't produce an error message, but their behavior is unreliable: sometimes there's a huge change, most often nothing happens.

The last two rows work. I guess you could make like ten aliases. Still, you would like the increase/decrease functionality to bind to keyboard shortcuts.

Am I using amixer the wrong way or is there some other tool to do the trick? (alsamixer doesn't seem to have this functionality as CLI commands.)

Edit

At last, made it work. This was so long ago (how sad!), so I have lost track of who contributed what. Anyway, thanks. (Below: For bash users, put in .bashrc)

# volume
alias vol="alsamixer"
MASTER="amixer -q -c 0 sset Master playback"
alias i="$MASTER 2dB+"
alias d="$MASTER 2dB-"
alias mute="echo \" Audio muted.\"; $MASTER mute"
alias play="echo \" Audio un-muted.\"; $MASTER unmute"
alias unmute="play"
alias stop="mute"
v () {
  amixer -q sset Master playback $1%
}

Source: (StackOverflow)

Turning speaker beep off by alsamixer permanently

Debian 7, x64.

I can turn off the beep by reducing Speaker bar volume in alsamixer to 0.

However, after reboot speaker volume in alsamixer is set to 100% again.

How can I turn off speker beep permanently (or possibly save current alsamixer settings in such way that they survive reboot)?

(P.S. I'm using KDE - perhaps it's KDE that messes with it?)


Source: (StackOverflow)

Disabling built-in speaker in Linux

My workstation has a built-in speaker that, surprisingly, plays audio very well. I also have external speakers hooked up to the audio out jack which are easier to hear. Unfortunately, when I try to play some audio material, sound comes out of both the external speakers and the built-in speaker on the workstation.

I'd like to disable the speaker inside the machine, and just plug in head-phones to the external speaker so I can listen to training material at work without bothering my office mate. I'm not sure how to do this in Linux (Suse Enterprise Desktop 11). Fiddling around with the Gnome audio tools doesn't list two different audio devices on the machine.

From what I can tell, sound is played through the ALSA system. I looked in my home directory and there is no .asoundrc controlling configuration.

I should also add that I check in the BIOS for a way to disable the built-in speaker, but I could not find such a setting.


Source: (StackOverflow)