I have a Schiit Modi USB DAC. I cannot get it to play audio.
Active1 year, 3 months ago
I had the misfortune of buying a Sabrent USB Wi-Fi adapter. The box says itβs good for Linux but no instructions inside, not instructions on disk and the person who picks up their support line chee.
Ubuntu has started to support USB audio. When I plug in a USB speaker or headset, it gets recognized and installed automatically. However there are some. As long as you have the necessary hardware connected, OpenWrt can play audio, as can any other GNU/Linux distribution. Any USB Audio device supported by GNU/Linux should work with OpenWrt as well. But, because of it's lightbuild structure OpenWrt does not come with audio support. You have to install. Install Usb Dac Linux DistributionsDownload and Install Teensy support into the Arduino IDE. Teensyduino is a software add on for the Arduino software.
What should I configure to get this DAC working?
What other relevant info should I provide? The DAC is known to be working (works fine in OSX and Windows).
Eliah Kagan
90.4k2323 gold badges250250 silver badges395395 bronze badges
MatildaMatilda
2 Answers
I recently got mine working but I could only do so easily using pulseaudio. Use something like pavucontrol (sudo apt-get install pavucontrol) to control which soundcard to use by default.
In pavu, under the output devices tab, click on the green checkmark button lined up with Schiit USB Audio Device Analog Stereo. Now play some music and enjoy.
ManuManu
Like the OP, I also could not get the Schiit Modi DAC working with Ubuntu (12.04). Specifically, the device was not listed in pavucontrol. Here's what worked for me:
Hope that helps.
Eric Carvalho
44k1717 gold badges120120 silver badges150150 bronze badges
itISiBOWMANitISiBOWMAN
Not the answer you're looking for? Browse other questions tagged soundusb or ask your own question.
The Advanced Linux Sound Architecture (ALSA) provides kernel driven sound card drivers. It replaces the original Open Sound System (OSS).
Besides the sound device drivers, ALSA also bundles a user space driven library for application developers. They can then use those ALSA drivers for high level API development. This enables direct (kernel) interaction with sound devices through ALSA libraries.
Installation
ALSA is a set of built-in GNU/Linux kernel modules. Therefore, manual installation is not necessary.
udev will automatically detect your hardware and select needed drivers at boot time, therefore, your sound should already be working. However, your sound may be initially muted. If it is, see Unmuting the channels.
User privileges
Usually, local users have permission to play audio and change mixer levels.
To allow remote users to use ALSA, you need to add those users to the
audio group, however this is not recommended by default (see note below).
Note: Adding users to the
audio group allows direct access to devices. Keep in mind, that this allows applications to exclusively reserve output devices. This may break software mixing or fast-user-switching on multi-seat systems. Therefore, adding a user to the audio group is not recommended by default; unless you specifically need to [1].
ALSA Utilities
Install the alsa-utils package. This contains (among other utilities) the
alsamixer and amixer utilities. amixer is a shell command to change audio settings, while alsamixer provides a more intuitive ncurses based interface for audio device configuration.
If you need high quality resampling install the alsa-plugins package to enable upmixing/downmixing and other advanced features.
OSS compatibility
Note: This is important if your application complains about missing
/dev/dsp or /dev/snd/seq .
ALSA has some ability to intercept OSS calls and re-route them through ALSA instead. This emulation layer is useful e.g. for legacy applications which try to open
/dev/dsp and write sound data to them directly. Without OSS or the emulation library, /dev/dsp will be missing, and the application will not produce any sound.
If you want OSS applications to work with dmix, install the alsa-oss package as well. Then load the
snd-seq-oss , snd-pcm-oss and snd-mixer-oss kernel modules to enable OSS emulation.
PulseAudio compatibility
apulseAUR lets you use ALSA for applications that support only PulseAudio for sound. Usage is simply
$ apulse yourapplication .
ALSA and Systemd
The alsa-utils package comes with systemd unit configuration files
alsa-restore.service and alsa-state.service by default.
These are automatically installed and activated during installation (via package provided symlink to sound.target). Neither will run by default, as they rely on some conscious decisions by the user to know which method should be preferred. The options are as follows:
Both methods are mutually exclusive and you can decide for one of the two approaches depending on your requirements, for further information see alsactl(1)
You can check their status using
systemctl .
ALSA Firmware
The alsa-firmware package contains firmware that may be required for certain sound cards (e.g. Creative SB0400 Audigy2).
Unmuting the channels
By default ALSA has all channels muted. Those have to be unmuted manually.
Unmute with amixer
Unmuting the sound card's master volume can be done by using amixer:
Unmute with alsamixer
Unmuting the sound card can be done using alsamixer:
The
MM label below a channel indicates that the channel is muted, and 00 indicates that it is open.
Scroll to the
Master and PCM channels with the β and β keys and unmute them by pressing the m key.
Use the
β key to increase the volume and obtain a value of 0 dB gain. The gain can be found in the upper left next to the Item: field.
Note: If gain is set above 0 dB audible distortion can become present.
Unmute 5.1/7.1 sound
To get full 5.1 or 7.1 surround sound you will likely need to unmute other channels such as
Front , Surround , Center , LFE (subwoofer) and Side . (Those are channel names with Intel HD Audio, they may vary with different hardware)
Note: Please take note that this will not automatically upmix stereo sources (like most music). In order to accomplish that, see #Upmixing/downmixing.
Enable the microphone
To enable your microphone, switch to the Capture tab with
F4 and enable a channel with Space . See /Troubleshooting#Microphone if microphone does not work.
Test your changes
Next, test to see if sound works:
Change
-c to fit your speaker setup. Use -c 8 for 7.1, for instance:
If audio is being outputted to the wrong device, try manually specifying it with the argument
-D .
-D accepts PCM channel names as values, which can be retrieved by running the following:
If that does not work, consult the #Configuration section or the /Troubleshooting page.
Additional notes
Configuration
The system configuration file is
/etc/asound.conf , and the per-user configuration file is ~/.asoundrc .
Basic syntax
ALSA configuration files follow a simple syntax consisting of hierarchical value to parameter (key) assignments. Below are (modified) excerpts from asoundrc.txt, which is usually found in alsa-lib package but can be also reached here.
Assignments and Separators
Assignments define a value of a given key. There are different assignment types and styles available.
Separators are used to indicate the start and end of an assignment, but using commas or whitespace is also possible.
Compound assignments use braces as separators. Download software desain baju bola nike.
For easier reading, it is recommended to use first style for definitions including more than three keys.
Array definitions use brackets as separators.
Everything depends on user preferences when it comes to different styles of configuration, however one should avoid mixing different styles. Further information on basic configuration can be found here.
Data types
ALSA uses different data types for parameter values, which must be set in the users respective configuration file. Some keys accept multiple data types, while most do not. A list of configuration options and their respective type requirements for PCM plugins can be found here
Operation modes
There are different operation modes for parsing nodes, the default mode is merge and create. If operation mode is either merge/create or merge type checking is done. Only same type assignments can be merged, so strings cannot be merged with integers. Trying to define a simple assignment in default operation mode to a compound (and vice versa) will also not work.
Prefixes of operation modes:
Using override operation mode, when done correctly, is usually safe, however one should bear in mind, that there might be other necessary keys in a node for proper functioning.
Warning: Overriding pcm node itself will most definitely make alsa unusable, since every plugin definition will be deleted. Therefore do not use !pcm.key unless you are making a configuration from scratch.
An example of setting default device using 'defaults' node
Assuming that 'defaults' node is set in
/usr/share/alsa/alsa.conf , where 'defaults.pcm.card' and its 'ctl' counterpart have assignment values '0' (type integer), user wants to set default pcm and control device to (third) sound card '2' or 'SB' for an Azalia sound card.
Using double quotes here automatically sets values data type to string, so in the above example setting defaults.pcm.!card '2' would result in retaining last default device, in this case card 0. Using double quotes for strings is not mandatory as long as no special characters are used, which ideally should never be the case. This may be irrelevant in other assignments.
Note: From a configuration point of view those are not equivalent to setting a compound 'default' pcm device, since most users specify addressing type in there also, which actually may be the same, but the assignment itself still differs. Also defaults.pcm.card is referred to multiple times in alsa configuration files, usually as a fallback assignment, where different environment variables take precedence.
Nesting
Sometimes it may be useful and even easier to read using nesting in configuration.
Including configuration filesSet the default sound card
This article or section needs expansion.
Reason: Explain the difference between a 'card' and a 'device.'
amixer --help suggests the two are not synonymous (Discuss in Talk:Advanced Linux Sound Architecture#)
This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.
Reason: There is no previous instruction regarding
defaults.pcm.device . (Discuss in Talk:Advanced Linux Sound Architecture#)
In addition to the previous instruction regarding
defaults.pcm.card and defaults.pcm.device , if your sound card order changes on boot, you can specify their order in any file ending with .conf in /etc/modprobe.d (/etc/modprobe.d/alsa-base.conf is suggested).For example, if you want your mia sound card to be #0:
Use
$ cat /proc/asound/modules to get the loaded sound modules and their order. This list is usually all that is needed for the loading order. Use $ lsmod | grep snd to get a devices & modules list. This configuration assumes you have one mia sound card using snd_mia and one (e.g. onboard) card using snd_hda_intel .
You can also provide an index of
-2 to instruct ALSA to never use a card as the primary one. Distributions such as Linux Mint and Ubuntu use the following settings to avoid USB and other 'abnormal' drivers from getting index 0 :
These changes require a system reboot.
See also [2]
Select the default PCM via environment variable
Tip: An explanation of the terminology of a 'card', 'device', 'subdevice' (a 'card' is not a 'device') and 'PCM' can be found on wikipedia:Advanced Linux Sound Architecture#Concepts.
Probably it is enough to set ALSA_CARD to the name of the device. First, get the names with
aplay -l , then set ALSA_CARD to the name which comes after the colon and before the bracket; e.g. if you have
card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
Install Usb Dac Linux Ubuntu
then set ALSA_CARD=HDMI.
Other variables are also checked in the default global configuration:
Alternatively, you can override the behavior in your own configuration file, preferably the global one (/etc/asound.conf). Add:
In this case as well, replace
Audigy2 with the name of your device. You can get the names with aplay -l or you can also use PCMs like surround51. But if you need to use the microphone it is a good idea to select full-duplex PCM as default.
Now you can select the sound card when starting programs by just changing the environment variable
ALSAPCM . It works fine for all program that do not allow to select the card, for the others ensure you keep the default card.For example, assuming you wrote a downmix PCM called mix51to20 you can use it with mplayer using the commandline ALSAPCM=mix51to20 mplayer example_6_channel.wav
Alternative method
Tip: This process can be partly automated using asoundconf.
First you will have to find out the card and device id that you want to set as the default:
Warning: Simply setting a
type hw as default card is equivalent to addressing hardware directly, which leaves the device unavailable to other applications. This method is only recommended if it is a part of a more sophisticated setup ~/.asoundrc or if user deliberately wants to address sound card directly (digital output through eic958 or dedicated music server for example).
For example, the last entry in this list has the card ID 2 and the device ID 0. To set this card as the default, you can either use the system-wide file
/etc/asound.conf or the user-specific file ~/.asoundrc . You may have to create the file if it does not exist. Then insert the following options with the corresponding card.
Note: For the Asus U32U series it seems that card should be set to 1 for both pcm and ctl.
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.
To get valid ALSA card names, use aplay:
Alternatively use cat, which might return unused devices:
Note: This method could be problematic if your system has several cards of the same (ALSA)name.
The 'pcm' options affect which card and device will be used for audio playback while the 'ctl' option affects which card is used by control utilities like alsamixer .
The changes should take effect as soon as you (re-)start an application (MPlayer etc.). You can also test with a command like aplay.
If you receive an error regarding your asound configuration, check the upstream documentation for possible changes to the configuration file format.
Verifying correct sound modules are loaded
You can assume that udev will autodetect your sound properly. You can check this with the command:
If the output looks similar, your sound drivers have been successfully autodetected.
Note: Since
udev>=171 , the OSS emulation modules (snd_seq_oss, snd_pcm_oss, snd_mixer_oss ) are not loaded by default: Load them manually, if they are needed.
You might also want to check the directory
/dev/snd/ for the right device files:
Note: If requesting help on IRC or the forums, please post the output of the above commands, if requested.
If you have at least the devices controlC0 and pcmC0D0p or similar, then your sound modules have been detected and loaded properly.
If this is not the case, your sound modules have not been detected properly. To solve this, you can try loading the modules manually:
Getting S/PDIF output
S/PDIF is a digital audio interface often used to connect a computer to a digital amplifier (such as a home theatre with 5.1/7.1 surround sound).
Note: With some soundcards this disables analog sound output (eg. Sound Blaster Audigy 2).
Depending on what shell you use, add the following line to your shell's configuration file:
You can see the name of your card's digital output with:
System-wide equalizerUsing ALSAEqual (provides UI)
Install the alsaequalAUR package. Also install lib32-alsaequalAUR for 32-bit application support.
After installing the package, add the following to your ALSA configuration file:
And you are ready to change your equalizer using command
Note that configuration file is different for each user (until not specified else) it is saved in
~/.alsaequal.bin .so if you want to use ALSAEqual with mpd or another software running under different user, you can configure it using
or for example, you can make a symlink to your
.alsaequal.bin in his home..
Managing ALSAEqual states
Install the alsaequal-mgrAUR package.
Configure the equalizer as usual with
When you are satisfied with the state, you may give it a name ('foo' in this example) and save it:
The state 'foo' can then be restored at a later time with
You can thus create different equalizer states for games, movies, music genres, VoIP apps, etc. and reload them as necessary. Bayerisches kochbuch pdf.
See the project page and the help message for more options.
Using mbeq
Note: This method requires the use of a LADSPA plugin which might be CPU intensive during playback. In addition, this was made with stereophonic sound (e.g. headphones) in mind.
Install the alsa-plugins, ladspa and swh-plugins packages if you do not already have them.
If you have not already created either an
~/.asoundrc or a /etc/asound.conf file, then create either one and insert the following:
High quality resampling
When software mixing is enabled, ALSA is forced to resample everything to the same frequency (48 kHz by default when supported). By default, it will try to use the speexrate converter to do so, and fallback to low-quality linear interpolation if it is not available[3].Thus, if you are getting poor sound quality due to bad resampling, the problem can be solved by simply installing the alsa-plugins package.
For even higher quality resampling, you can change the default rate converter to
speexrate_medium or speexrate_best . Both perform well enough that in practice it does not matter which one you choose, so using the best converter is usually not worth the extra CPU cycles it requires.
To change the default converter place the following contents in your
~/.asoundrc or /etc/asound.conf :
Note: It is also possible to use libsamplerate converters, which are only about half as fast as the speexrate converters but do not achieve much higher quality. See discussion.
Note: It is also possible to use lavcrate resamplers that use ffmpeg With filter sizes of lavcrate_faster:4 lavcrate_fast:8 lavcrate:16 lavcrate_high:32 lavcrate_higher:64 With the last 2 options being equal to Kodi low and medium quality resamplers respectively
Note: Some applications (like MPlayer and its forks) do their own resampling by default because some ALSA drivers have incorrect delay reporting when resampling is enabled (hence leading to AV desynchronization), so changing this setting will not have any effect unless you configure them to use ALSA resampling.
Upmixing/downmixingUpmixing
In order for stereo sources like music to be able to saturate a 5.1 or 7.1 sound system, you need to use upmixing. In darker days this used to be tricky and error prone but nowadays plugins exist to easily take care of this task. We will use the
upmix plugin, included in the alsa-plugins package.
Then add the following to your ALSA configuration file of choice (either
/etc/asound.conf or ~/.asoundrc ):
You can easily change this example for 7.1 upmixing to 5.1 or 4.0.
The following example adds a new PCM channel that you can use for upmixing. If you want all sound sources to go through this channel, add it as a default below the previous definition like so:
The plugin automatically allows multiple sources to play through it without problems so setting is as a default is actually a safe choice.If this is not working, you have to setup your own dmixer for the upmixing PCM like this:
and use 'dmix6' instead of 'surround71'.If you experience skipping or distorted sound, consider increasing the buffer_size (to 32768, for example) or use a high quality resampler.
Downmixing
If you want to downmix sources to stereo because you, for instance, want to watch a movie with 5.1 sound on a stereo system, use the
vdownmix plugin, included in the alsa-plugins package.
Again, in your configuration file, add this:
Note: This might not be enough to make downmixing working, see [4]. So, you might also need to add
pcm.!default 'plug:surround51' or pcm.!default 'plug:surround40' . Only one vdownmix plug can be used; if you have 7.1 channels, you will need to use surround71 instead the configuration above. A good example, which includes a configuration that makes both vdownmix and dmix working, can be found here.
Dmix
Mixing enables multiple applications to output sound at the same time. Most discrete sound cards support hardware mixing, which is enabled by default if available. Integrated motherboard sound cards (such as Intel HD Audio), usually do not support hardware mixing. On such cards, software mixing is done by an ALSA plugin called
dmix . This feature is enabled automatically if hardware mixing is unavailable.
Note: Dmix is enabled by default for soundcards which do not support hardware mixing. Dmix is not enabled by default for digital output (S/PDIF) and will require the configuration snippet below.
To manually enable dmix, add the following to your ALSA configuration file:
Tips and tricksDisabling auto mute on startup
Auto-Mute Mode can be configured on startup with
amixer . For example, to disable it:
Alternatively, the graphical interface can be utilized through
alsamixer . In order to save any modifications, use:
Hot-plugging a USB sound card
See Writing Udev rules for ALSA.
Simultaneous output
You might want to play music via external speakers connected via mini jack and internal speakers simultaneously. This can be done by unmuting Auto-Mute item using
alsamixer or amixer :
and then unmuting other required items, such as Headphones, Speaker, Bass Speaker..
Note: If you have a crackling sound through headphones connector (mini-jack) after, see here.
Keyboard volume control
Map the following commands to your volume keys:
XF86AudioRaiseVolume , XF86AudioLowerVolume , XF86AudioMute
To raise the volume:
To lower the volume:
To toggle mute/unmute of the volume:
Virtual sound device using snd-aloop
You might want a jack alternative to create a virtual recording or play device in order to mix different sources, using the snd-aloop module:
List your new virtual devices using:
now you can for example using ffmpeg:
In the hw:R,W,N format R is your virtual card device number, W 1 recording devices 0 for writing, N is your sub device you can use all the virtual devices available and play/stop using applications like mplayer:
Another thing you could do with this approach, is using festival to generate a voice into a recording stream using an script like this:
Debugging ALSARetrieving the driver state
The alsa-utils package also contains the
alsa-info.sh command, which can be used to gather detailed data on the ALSA driver and user-space state.
See ALSA bug tracking for more info.
Reconfiguring input/output ports
The alsa-tools package contains the
hdajackretask tool, which can be used (on Intel HDA cards) to reconfigure the sound card input/output ports; for instance, to turn a microphone jack into a headphone jack.
Resetting codecs
The ALSA driver can fully reconfigure attached codecs (the parts of the sound system that actually process audio streams), by doing:
Before doing this, all processes using the ALSA driver (such as Pulseaudio or JACK) must be stopped.
Correctly detect microphone plugged in a 4-pin 3.5mm (TRRS) jack
On some modern laptops you may have a combined 3.5mm headset jack, instead of two separated ones, which may not be correctly detected by default.To make ALSA correctly detect plug-in status on your 3.5mm jack, you could put the following line into your
/etc/modprobe.d/alsa-base.conf :
For complete list of options to put in
[YOUR_MODEL_SETTING] , see HD-Audio-Models.txt.Tested with Gigabyte Aero15 2017 (P65 Model), with ALC255 and set model to dell-headset-multi .
See also
Retrieved from 'https://wiki.archlinux.org/index.php?title=Advanced_Linux_Sound_Architecture&oldid=581020'
Comments are closed.
|