4
votes

Unable to use snd-aloop audio driver in AWS EC2 ubuntu 16.04 instance

On running modprobe on snd-aloop

$modprobe snd-aloop
modprobe: FATAL: Module snd-aloop not found in directory /lib/modules/4.4.0-1052-aws

Kernels in AWS matchine are -

/lib/modules/4.4.0-1049-aws  
/lib/modules/4.4.0-1052-aws  
/lib/modules/4.4.0-116-generic

Current kernel loaded

$uname -r
4.4.0-1052-aws
  1. After searching a lot it was confirmed that snd-aloop comes pre-installed in ubuntu 16.04.(https://askubuntu.com/questions/891445/alsa-snd-aloop-kernel-module-for-16-04-or-14-04-server)
  2. So i verified and found that the module was present at

"/lib/modules/4.4.0-116-generic" kernel. location - /lib/modules/4.4.0-116-generic/kernel/sound/drivers/snd-aloop.ko

  1. After giving much thought one possible way to use snd-aloop audio driver was to use 4.4.0.116-generic kernel.
    • So to do the same i modified /boot/grub/menu.lst and edited the kernel list.(commented out all other kernels other then 4.4.0.116-generic) and then did update-grub but nothing happened, kernel loaded was /lib/modules/4.4.0-1052-aws.
    • Then i modified the /etc/default/grub file and changed GRUB_DEFAULT=0 to kernel title as GRUB_DEFAULT="gnulinux-4.4.0-116-generic-advanced-b6adc449-5e3d-4331-ba6b-6e99a75fa48e>gnulinux-4.4.0-116-generic-recovery-b6adc449-5e3d-4331-ba6b-6e99a75fa48e" and again did an grub update but again nothing happened.

I have already gone through the following doc's

1.https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html - Aws doc guide to change kernels.

I can't recall the other links but i have searched a lot.

Please point me in the right direction. How can i use audio driver sdn-aloop in AWS EC2 Ubuntu 16.04 instance?

4

4 Answers

13
votes

Steps to update default kernel boot item (without modification of /boot/grub/menu.lst):

  1. Find needed menu and sub-menu item in grub.cfg: cat /boot/grub/grub.cfg

    For example you can have menu structure like this (default for AWS Ubuntu 16.04):

    • (0) Ubuntu
    • (1) Advanced options for Ubuntu
      • (0) Ubuntu, with Linux 4.4.0-1052-aws
      • (1) Ubuntu, with Linux 4.4.0-1052-aws (recovery mode)
      • (2) Ubuntu, with Linux 4.4.0-116-generic
      • (3) Ubuntu, with Linux 4.4.0-116-generic (recovery mode)

    In this case if you need to load "Ubuntu, with Linux 4.4.0-116-generic" your default boot setting would be "1>2"

  2. Edit default grub file:

    vim /etc/default/grub and set

    GRUB_DEFAULT=“1>2”

  3. Run update-grub

  4. And then reboot now to take this in effect
  5. After reboot you can test it with uname -a which should give 4.4.0-116-generic

After this modprobe snd-aloop should work fine.

9
votes

esto me funciono en ubuntu 18

$ update-grub
0: Found linux image: /boot/vmlinuz-5.3.0-1017-aws
1: Found initrd image: /boot/initrd.img-5.3.0-1017-aws
2: Found linux image: /boot/vmlinuz-4.15.0-1057-aws
3: Found initrd image: /boot/initrd.img-4.15.0-1057-aws
4: Found linux image: /boot/vmlinuz-4.15.0-99-generic
5: Found initrd image: /boot/initrd.img-4.15.0-99-generic

seleciona los drive genericos 4 es genericos edita el /etc/default/grub

GRUB_DEFAULT="1>4"

update-grub
reboot now
lsmod | grep snd_aloop

exito amigo.

2
votes

Jibri on AWS and getting the below issue.

org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit abruptly. Last output line: plug:bsnoop: Input/output error

Solution: changing and updating the kernel boot settings from Linux 4.4.0-xxxx-aws to Linux 4.4.0-xxxx-generic and restarting the instance.

I have fixed by the following steps:

$ grep -A200 submenu /boot/grub/grub.cfg |grep menuentry

Output:

submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-e6dc6474-8016-46c6-8ab0-0a871bae4cd1' {
    menuentry 'Ubuntu, with Linux 4.4.0-1107-aws' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-1107-aws-advanced-e6dc6474-8016-46c6-8ab0-0a871bae4cd1' {
    menuentry 'Ubuntu, with Linux 4.4.0-1107-aws (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-1107-aws-recovery-e6dc6474-8016-46c6-8ab0-0a871bae4cd1' {
    menuentry 'Ubuntu, with Linux 4.4.0-1106-aws' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-1106-aws-advanced-e6dc6474-8016-46c6-8ab0-0a871bae4cd1' {
    menuentry 'Ubuntu, with Linux 4.4.0-1106-aws (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-1106-aws-recovery-e6dc6474-8016-46c6-8ab0-0a871bae4cd1' {
    menuentry 'Ubuntu, with Linux 4.4.0-1105-aws' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-1105-aws-advanced-e6dc6474-8016-46c6-8ab0-0a871bae4cd1' {
    menuentry 'Ubuntu, with Linux 4.4.0-1105-aws (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-1105-aws-recovery-e6dc6474-8016-46c6-8ab0-0a871bae4cd1' {
    menuentry 'Ubuntu, with Linux 4.4.0-179-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-179-generic-advanced-e6dc6474-8016-46c6-8ab0-0a871bae4cd1' {
    menuentry 'Ubuntu, with Linux 4.4.0-179-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-179-generic-recovery-e6dc6474-8016-46c6-8ab0-0a871bae4cd1' {

menu entry id for Advanced options for Ubuntu is gnulinux-advanced-e6dc6474-8016-46c6-8ab0-0a871bae4cd1 menu entry for Ubuntu, with Linux 4.4.0-179-generic is gnulinux-4.4.0-179-generic-advanced-e6dc6474-8016-46c6-8ab0-0a871bae4cd1

Edit Grub and replace GRUB_DEFAULT with above value

$ nano /etc/default/grub

GRUB_DEFAULT="gnulinux-advanced-e6dc6474-8016-46c6-8ab0-0a871bae4cd1>gnulinux-4.4.0-179-generic-advanced-e6dc6474-8016-46c6-8ab0-0a871bae4cd1"
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0"
GRUB_CMDLINE_LINUX=""

Update and Reboot

$ sudo update-grub $ sudo reboot

After reboot you can test it with uname -a which should give 4.4.0-179-generic

$ uname -a

Linux 4.4.0-179-generic

After this modprobe snd-aloop should work fine.

0
votes

How i did this was run

grep-A100 submenu /boot/grub/grub.cfg |grep menuentry

This lists something like

submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-6156ec80-9446-4eb1-95e0-9ae6b7a46187' { menuentry 'Ubuntu, with Linux 5.3.0-1017-aws' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.3.0-1017-aws-advanced-6156ec80-9446-4eb1-95e0-9ae6b7a46187' { menuentry 'Ubuntu, with Linux 5.3.0-1017-aws (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.3.0-1017-aws-recovery-6156ec80-9446-4eb1-95e0-9ae6b7a46187' { menuentry 'Ubuntu, with Linux 4.15.0-1065-aws' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-1065-aws-advanced-6156ec80-9446-4eb1-95e0-9ae6b7a46187' { menuentry 'Ubuntu, with Linux 4.15.0-1065-aws (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-1065-aws-recovery-6156ec80-9446-4eb1-95e0-9ae6b7a46187' { menuentry 'Ubuntu, with Linux 4.15.0-99-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-99-generic-advanced-6156ec80-9446-4eb1-95e0-9ae6b7a46187' { menuentry 'Ubuntu, with Linux 4.15.0-99-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-99-generic-recovery-6156ec80-9446-4eb1-95e0-9ae6b7a46187' {

So chose the first menuentryid i.e. gnulinux-advanced-6156ec80-9446-4eb1-95e0-9ae6b7a46187 and the generic id gnulinux-4.15.0-99-generic-advanced-6156ec80-9446-4eb1-95e0-9ae6b7a46187

THen join them with > which will look like this

gnulinux-4.15.0-99-generic-recovery-6156ec80-9446-4eb1-95e0-9ae6b7a46187>gnulinux-4.15.0-99-generic-advanced-6156ec80-9446-4eb1-95e0-9ae6b7a46187

and set this as GRUB_DEFAULT value as above then update-grub and reboot. You should get the desired output.