======Hardware - Audio - Soundcards - Linux - ALSA====== [[http://alsa-project.org/|Advanced Linux Sound Architecture (ALSA) project homepage]] \\ [[https://alsa.opensrc.org/|Alsa Opensrc Org]] \\ =====Notes===== ===='aplay -l | grep card' output==== ^Card^Slot type^Chipset^Output^Linux distro/version^Remarks^ |Audiotrak Prodigy HD2|PCI|VIA Envy24|card 4: ICE1724 [ICEnsemble ICE1724], device 0: ICE1724 [ICE1724] \\ card 4: ICE1724 [ICEnsemble ICE1724], device 1: ICE1724 IEC958 [ICE1724 IEC958]|Slackware64 14.2|Card is recognised, but does not output sound. Only shows S/PDIF options in alsamixer. Setting jumper JP4 on the card to ON (or OFF) and creating /etc/modprobe.d/alsa-base.conf with 'options snd-ice1724 model=prodigyhd2' as suggested [[http://aulix.com/gyrocom-audiotrak-prodigy-hd2-advance-de-linux-alsa|here]] only changes the card name in aplay -l output and provides a Front volume control in alsamixer, but still no sound output. speaker-test -c2 -twav -Dhw:2,0 complains about: \\ Sample format not available for playback: Invalid argument \\ Setting of hwparams failed: Invalid argument.| |ASTRO Gaming USB MixAmp|USB| |card 7: MixAmp [ASTRO Gaming USB MixAmp], device 0: USB Audio [USB Audio]|Slackware 14.2 (tested with kernel 5.0.17)|Works out of the box. \\ \\ // Dolby Headphone button does nothing. //| |ASUS STRIX RAID DLX|PCIe| |card 4: DLX [STRIX RAID DLX], device 0: USB Audio [USB Audio] \\ card 4: DLX [STRIX RAID DLX], device 1: USB Audio [USB Audio #1] \\ card 4: DLX [STRIX RAID DLX], device 2: USB Audio [USB Audio #2]|Slackware64 14.2 (tested with kernel 5.0.20)|Works out of the box.| |ASUS Xonar D2X|PCIe|AV200|card 0: D2X [Xonar D2X], device 0: Multichannel [Multichannel] \\ card 0: D2X [Xonar D2X], device 1: Digital [Digital]|Slackware64 14.2| | |ASUS Xonar Essence ST|PCI|AV100|card 4: ST [Xonar ST], device 0: Multichannel [Multichannel] \\ card 4: ST [Xonar ST], device 1: Digital [Digital]|Slackware64 14.2| | |Asus Xonar Essence STX|PCIe|AV100|card 1: STX [Xonar STX], device 0: Multichannel [Multichannel] \\ card 1: STX [Xonar STX], device 1: Digital [Digital]|Slackware64 14.2| | |Avid Mbox (3) Mini|USB| |card 11: Mini [Avid Mbox Mini], device 0: USB Audio [USB Audio]|Slackware 14.2 (tested with kernel 5.0.20)|Works out of the box. \\ Supported formats: \\ S16_LE \\ S24_3LE \\ \\ // On the Mini: Be sure to turn the Mix dial all the way up (clockwise) and then set the headphone/speaker volume to the desired level to get sound on headphones or speakers (speakers not tested). //| |Behringer UCA200|USB|Coolaudio V2902 (DAC)|card 7: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]|Slackware64 14.2| | |Behringer UCA202|USB|PCM2902C (DAC)|card 7: CODEC [USB AUDIO CODEC], device 0: USB Audio [USB Audio]|Slackware64 14.2| | |Club3D Theatron Agrippa|PCI|CMI8770|card 3: CMI8762 [C-Media CMI8762], device 0: CMI8738-MC8 [C-Media PCI DAC/ADC] \\ card 3: CMI8762 [C-Media CMI8762], device 1: CMI8738-MC8 [C-Media PCI 2nd DAC] \\ card 3: CMI8762 [C-Media CMI8762], device 2: CMI8738-MC8 [C-Media PCI IEC958]|Slackware64 14.2| | |Creative Sound Blaster EVO ZxR|USB, Bluetooth|SBAxx1|card 9: ZxR [Sound Blaster EVO ZxR], device 0: USB Audio [USB Audio]|Slackware64-current (14.2+) (tested with kernel 5.3.3)|Only USB connection was tested. Volume control wheel on headphone does not work.| |Creative Sound Blaster Recon3D|USB|SoundCore3D|card 5: Recon3D [Sound Blaster Recon3D], device 0: USB Audio [USB Audio]|Slackware64 14.2|SBX/THX settings not available unless you configured them on a Windows system and saved the profile to the Recon3D USB. Then you can enable/disable them with the THX TruStudio Pro button on the Recon3D USB.| |Creative Sound Blaster Tactic3D Alpha|USB| |card 10: Alpha [Sound Blaster Tactic(3D) Alpha], device 0: USB Audio [USB Audio]|Slackware64-current (14.2+) (tested with kernel 5.4.16)| | |Creative Sound Blaster Tactic3D Rage USB|USB| |card 4: USB [SB Tactic3D Rage USB], device 0: USB Audio [USB Audio]|Slackware 14.2 (tested with kernel 5.2.9)| | |Creative Sound Blaster X-Fi|PCI/PCIe|EMU20k1 \\ EMU20k2|card 2: XFi [Creative X-Fi], device 0: ctxfi [Front/WaveIn] \\ card 2: XFi [Creative X-Fi], device 1: ctxfi [Surround] \\ card 2: XFi [Creative X-Fi], device 2: ctxfi [Center/LFE] \\ card 2: XFi [Creative X-Fi], device 3: ctxfi [Side] \\ card 2: XFi [Creative X-Fi], device 4: ctxfi [IEC958 Non-audio]|Slackware64 14.2| | |Creative Sound Blaster Z|PCIe|SoundCore3D|card 2: Creative [HDA Creative], device 0: CA0132 Analog [CA0132 Analog] \\ card 2: Creative [HDA Creative], device 1: CA0132 Digital [CA0132 Digital]|Slackware64 (tested with kernel 5.0.7)|Requires at least kernel 4.18 as Z drivers weren't available in older kernels. All SBX Pro functionality is available via alsamixer. See also:[[https://www.reddit.com/r/SoundBlasterOfficial/comments/9mm5ad/sound_blaster_r3dr3dizzxrae5_linux_driver/|Reddit - r/SoundBlasterOfficial - Sound Blaster R3D/R3Di/Z/ZxR/AE-5 Linux Driver]].| |Creative Sound Blaster ZxR (with DBpro)|PCIe|SoundCore3D|card 0: Creative_1 [HDA Creative], device 0: CA0132 Analog [CA0132 Analog] \\ card 0: Creative_1 [HDA Creative], device 1: CA0132 Digital [CA0132 Digital]|Slackware64 (tested with kernel 5.0.7)|Requires at least kernel 4.18 as ZxR drivers weren't available in older kernels. All SBX Pro functionality is available via alsamixer. See also:[[https://www.reddit.com/r/SoundBlasterOfficial/comments/9mm5ad/sound_blaster_r3dr3dizzxrae5_linux_driver/|Reddit - r/SoundBlasterOfficial - Sound Blaster R3D/R3Di/Z/ZxR/AE-5 Linux Driver]].| |Creative Sound BlasterX G5|USB|SBAxx1|card 9: G5 [Sound BlasterX G5], device 0: USB Audio [USB Audio]|Slackware64-current (14.2+) (tested with kernel 5.3.6)|Volume control wheel does not work.| |Digidesign MBOX 2 Mini \\ Digidesign MBOX 2 Micro|USB| |card 10: M2 [Mbox 2], device 0: USB Audio [USB Audio]|Slackware64 14.2 (tested with kernel 5.0.11)|The MBOX 2 only supports format S24_3BE. See [[hardware:audio:soundcards:digidesign:mbox2mini#linux|Hardware - Audio - Sound cards - Digidesign - MBOX 2 Mini - Linux]] for details and working ~/.asoundrc sample. \\ \\ // On the Mini: Be sure to turn the Mix dial all the way up (clockwise) and then set the headphone/speaker volume to the desired level to get sound on headphones or speakers (speakers not tested). //| |HyperX Amp|USB| |card 5: Amp [HyperX Amp], device 0: USB Audio [USB Audio] \\ card 5: Amp [HyperX Amp], device 1: USB Audio [USB Audio #1]|Slackware64 14.2 (tested with kernel 5.0.7)| | |HyperX Cloud II Advanced Audio Control Box|USB| |card 6: Sound [HyperX Virtual Surround Sound], device 0: USB Audio [USB Audio]|Slackware64 14.2| | |M-Audio Audiophile 192|PCI|Via Envy24 (ICE1724)|card 3: Audiophile192 [M Audio Audiophile192], device 0: ICE1724 [ICE1724] \\ card 3: Audiophile192 [M Audio Audiophile192], device 1: ICE1724 IEC958 [ICE1724 IEC958]|Slackware64 14.2|Card is recognised, but does not output sound via xmms if using ALSA output plugin to hw:X.0 device. Shows PCM volume control and S/PDIF options in alsamixer. speaker-test -c2 -twav -Dhw:2,0 complains about: \\ Sample format not available for playback: Invalid argument \\ Setting of hwparams failed: Invalid argument. \\ It does work in Audacious with ALSA output plugin set to PCM device: sysdefault:CARC=Audiophile192 (...).| |M-Audio Fast Track|USB| |card 13: Track [Fast Track], device 0: USB Audio [USB Audio]|Slackware64 14.2 (tested with kernel 5.1.17)|// Both the version with the 3 volume dials on top and the silver-grey version with buttons on the front. // | |Sennheiser GSX 1200 PRO|USB| |card 4: Audio [GSX 1200 Pro Main Audio], device 0: USB Audio [USB Audio] \\ card 4: Audio [GSX 1200 Pro Main Audio], device 1: USB Audio [USB Audio #1]|Slackware64 14.2|Works. See [[ hardware:audio:soundcards:sennheiser:gsx|Sennheiser GSX]] for .asoundrc settings.| |Sweex 5.1|PCI|CMI8768|card 2: CMI8768 [C-Media CMI8768], device 0: CMI8738-MC8 [C-Media PCI DAC/ADC] \\ card 2: CMI8768 [C-Media CMI8768], device 1: CMI8738-MC8 [C-Media PCI 2nd DAC] \\ card 2: CMI8768 [C-Media CMI8768], device 2: CMI8738-MC8 [C-Media PCI IEC958]|Slackware64 14.2| | |Tascam US-100|USB| |card 8: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]|Slackware 14.2 (tested with kernel 5.2.9)|// Same chipset as Behringer UCA200? // | |Terratec Aureon Xfire8.0 HD|USB| |card 5: HD [AUREON XFIRE8.0 HD], device 0: USB Audio [USB Audio] \\ card 5: HD [AUREON XFIRE8.0 HD], device 1: USB Audio [USB Audio #1] \\ card 5: HD [AUREON XFIRE8.0 HD], device 2: USB Audio [USB Audio #2]|Slackware64 14.2|Volume control knob on the unit does not work.| |Turtlebeach Ear Force Stealth 450|USB| |card 5: E450 [Ear Force Stealth 450], device 0: USB Audio [USB Audio]|Slackware64 14.2 (tested with kernel 5.0.7)| | |Yamaha UW500|USB| |card 5: UW500 [YAMAHA UW500], device 0: USB Audio [USB Audio]|Slackware64-current (14.2+) (tested with kernel 5.4.28)| | ====Play from commandline and provide output device==== Using ffmpeg (for most audio formats): SDL_AUDIODRIVER="alsa" AUDIODEV="hw:0,0" ffplay -nodisp audiofile.flac Source:[[https://superuser.com/questions/763683/select-ffplay-audio-out-device|Super User - select ffplay audio out device]] Using mpg123 (for mp3's only): mpg123 -a hw:1,0 audiofile.mp3 ====Dump hardware parameters==== For example, to dump the hardware parameters for a Digidesign MBOX 2: arecord --dump-hw-params -D hw:M2,0 Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono HW Params of device "hw:M2,0": -------------------- ACCESS: MMAP_INTERLEAVED RW_INTERLEAVED FORMAT: S24_3BE SUBFORMAT: STD SAMPLE_BITS: 24 FRAME_BITS: 48 CHANNELS: 2 RATE: 48000 PERIOD_TIME: [1000 1820438) PERIOD_SIZE: [48 87381] PERIOD_BYTES: [288 524286] PERIODS: [2 1024] BUFFER_TIME: [2000 3640875] BUFFER_SIZE: [96 174762] BUFFER_BYTES: [576 1048572] TICK_TIME: ALL -------------------- arecord: set_params:1297: Sample format non available Available formats: - S24_3BE // Here you can see the MBOX2 only supports the S24_3BE (signed 24-bit 3bytes Big Endian) format. // Source:[[https://sourceforge.net/p/alsa/mailman/message/33820068/|SourceForge - ALSA - Mailing Lists - Re: [Alsa-user] arecord: begin_wave:2480: Wave doesn't support S24_3BE format]] \\ ====Midi==== Get a list of midi devices:aplaymidi -l Example output: Port Client name Port name 14:0 Midi Through Midi Through Port-0 20:0 USB Midi USB Midi MIDI 1 44:0 Mbox 2 Mbox 2 MIDI 1 48:0 Mbox 2 Mbox 2 MIDI 1 ====DOSbox==== To use the midi device named "USB Midi" on port 20:0 in above output in DOSbox, edit the [midi] part in your DOSbox config in ~/.dosbox/dosbox-VERSION.conf (in my case ~/.dosbox/dosbox-0.74-3.conf) to look like this: [midi] # mpu401: Type of MPU-401 to emulate. # Possible values: intelligent, uart, none. # mididevice: Device that will receive the MIDI data from MPU-401. # Possible values: default, win32, alsa, oss, coreaudio, coremidi, none. # midiconfig: Special configuration options for the device driver. This is usually the id of the device you wan t to use. # See the README/Manual for more details. mpu401=intelligent mididevice=default midiconfig=20:0 ====Test playback==== Show all soundcards that are recognised by ALSA: aplay -l | grep card Test playback on a specific card: speaker-test -c2 -twav -Dhw:Creative Test playback on a specific pcm or dmix device definied in a manually edited .asoundrc: speaker-test -c2 -twav -Ddmixsoundblasterz // This helps to track down vague error messages in a .asoundrc that sends sound output to multiple soundcards simultaneously. // =====Route 7.1 channels to 2-channel stereo soundcard===== For faking a 7.1 channel setup on a stereo soundcard. Save the below code to ~/.asoundrc and change the pcm.maudiomicrodac part to match your card (see 'aplay -l | grep card' output): pcm.!default { type asym playback.pcm "plug:stereo2quad" } pcm.dmixer { type dmix ipc_key 1024 slave { pcm "maudiomicrodac" period_time 0 period_size 1024 buffer_size 4096 rate 48000 } bindings { 0 0 1 1 2 0 3 1 4 0 5 1 6 0 7 1 } } pcm.stereo2quad { type route slave.pcm "dmixer" ttable.0.0 1 ttable.1.1 1 ttable.2.2 1 ttable.3.3 1 ttable.4.4 1 ttable.4.5 1 ttable.5.4 1 ttable.5.5 1 ttable.6.6 1 ttable.7.7 1 } pcm.maudiomicrodac { type hw card DAC device 0 channels 2 } ctl.dmixer { type hw card 0 } Sources: * [[https://bootlin.com/blog/audio-multi-channel-routing-and-mixing-using-alsalib/|bootlin - Audio multi-channel routing and mixing using alsalib]] * [[https://unix.stackexchange.com/questions/738631/splitting-the-outputs-of-a-7-1-usb-sound-card-into-4-distinct-stereo-pairs|unix stackexchange - Splitting the outputs of a 7.1 USB sound card into 4 distinct stereo pairs]] * [[https://askubuntu.com/questions/106186/how-to-split-7-1-soundcard-outputs-to-4-stereo-outs-with-alsa|askubuntu - How to split 7.1 soundcard outputs to 4 stereo outs with ALSA]] * [[https://www.alsa-project.org/main/index.php/Asoundrc|AlsaProject - Asoundrc]] * [[https://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html|AlsaProject - PCM (digital audio) plugins]] PCM plugins extends functionality and features of PCM devices. The plugins take care about various sample conversions, sample copying among channels and so on.