3

Situation: unable to configure ALSA in Ubuntu 16.04 for Matlab 2016a
System characteristics

  • /proc/asound/cards

      0 [HDMI           ]: HDA-Intel - HDA Intel HDMI
                           HDA Intel HDMI at 0xb0a10000 irq 54
      1 [PCH            ]: HDA-Intel - HDA Intel PCH
                           HDA Intel PCH at 0xb0a14000 irq 53
    
  • /usr/share/alsa/also.conf found here where I tried the following at the end of the file unsuccessfully because I think device 1 is my sound thing (PCH)

      pcm.!default {
       type hw
       card 0
       device 1
      }
    

Test code in Matlab

soundsc(230)

Errors

ALSA lib pcm_dsnoop.c:606:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave

Manual proposal

I found one possible proposal in the blog post PyAudio, PortAudio, and ALSA messages which says

  • remove the line pcm.rear cards.pcm.rear in /usr/share/alsa/alsa.conf.
  • Have snd_lib_error_set_handler() of alsa-lib to set a new error handler instead of default one; How to do this?

Unsuccessful Attempt by following Monkeyman_stones' Piece of Advice

I follow instructions for the older Macbook Air which still uses the same/similar sound chip in the wikipage MacBookAir3-2/Meerkat > Sound. I do unsuccessfully

  1. Terminal, sudo vim /etc/modprobe.d/alsa-base.conf and add the line options snd-hda-intel model=mba31 to the end of the file.
  2. Terminal, alsamixer and use arrow keys to select Front Speaker (testing S/PDIF, S/PDIF 1 and S/PDIF 2) and press mand last ESC. Done!
  3. Output: Same warnings as before after running any code in Matlab prompt. After reboot, the system forgets all changes in alsamixer. I tried also with sudo alsamixer. How can you make those changes permanent?

My complete /etc/modprobe.d/alsa-base.conf after the change and you cannot see there duplicates of snd-hda-intel, only once, which does not seem to affect alsamixer at all

install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7

# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-ioctl32 ; /sbin/modprobe --quiet --use-blacklist snd-seq ; }
#
# Workaround at bug #499695 (reverted in Ubuntu see LP #319505)
install snd-pcm /sbin/modprobe --ignore-install snd-pcm $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-pcm-oss ; : ; }
install snd-mixer /sbin/modprobe --ignore-install snd-mixer $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-mixer-oss ; : ; }
install snd-seq /sbin/modprobe --ignore-install snd-seq $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; /sbin/modprobe --quiet --use-blacklist snd-seq-oss ; : ; }
#
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; : ; }
# Cause optional modules to be loaded above sound card driver modules
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-emu10k1-synth ; }
install snd-via82xx /sbin/modprobe --ignore-install snd-via82xx $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq ; }

# Load saa7134-alsa instead of saa7134 (which gets dragged in by it anyway)
install saa7134 /sbin/modprobe --ignore-install saa7134 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist saa7134-alsa ; : ; }
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options saa7134-alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
options snd-usb-audio index=-2
options snd-usb-caiaq index=-2
options snd-usb-ua101 index=-2
options snd-usb-us122l index=-2
options snd-usb-usx2y index=-2
# Ubuntu #62691, enable MPU for snd-cmipci
options snd-cmipci mpu_port=0x330 fm_port=0x388
# Keep snd-pcsp from being loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2

# https://help.ubuntu.com/community/MacBookAir3-2/Meerkat
# Start up a terminal, run alsamixer and use arrow keys to select Front Speaker and press m, then all is good sound-wise.
# TODO this is not affecting `alxamixer` at all; restart restores the defaults. Why?
options snd-hda-intel model=mba31
System Linux kernel Linux kernel options Hardware Matlab
Linux Ubuntu 16.04 64 bit 4.6 wl Macbook Air 2013-mid 2016a

Official Matlab docs about sounds in Linux: ALSA Audio Playback
Related threads: No sound with HDA Intel PCH, Alsa problems with python2.7- Unable to open slave, Why ALSA lib is not working in Ubuntu?

1
+50

While this says that it's targeted for Ubuntu Meerkat (10.10), Alsa-base.conf settings have not changed much at all, so the directions are still sound: Ubuntu directions for sound from the early Macbook Air

As it uses an HDA Intel sound card type, changes specific to your device's sound card settings in /etc/modprobe.d/alsa-base.conf are required.

3
  • 1
    It is possible that you need to change your index numbers to your actual device in /etc/modprobe.d/alsa-base.conf. Make certain they are all set to the same number (which is your output device). use "aplay -l" to determine which device has which index number. Index=2 may not be your correct sound card. alsa.opensrc.org/MultipleCards Jul 28 '16 at 22:19
  • I would suggest making the changes as the Root user. If they change after reboot then something very odd would appear to be going on as Root is supposed to have absolute control of the system.. "sudo su" to become root (but make certain you use "exit" when you are done so that it drops the Root user privilege for the session). As you have not provided the output of aplay -l it is not clear if things are correctly set or not. But, the changes as root should stick or something else may be going on. Aug 1 '16 at 16:31
  • Here are directions directly from ALSA for multiple sound card systems (which you have as your device sound card and your Nvidia video card are individual sound card devices): alsa.opensrc.org/MultipleCards Aug 1 '16 at 16:48
0

Those error messages are caused by the calls of the function audiodevinfo() made by sound/soundsc/audioplayer/audiorecorder. They are harmless, designed by MathWorks in their application. I do not like such a design myself. Related: here where the ticket and some responses of the support service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.