0

On my Ubuntu 16.04 every time I run tvtime after a reboot the sound does not work. I discovered that it is because it changes the order of the sound boards in this list:

$ cat / proc / asound / cards
 0 [HDMI           ]: HDA-Intel - HDA Intel HDMI
                      HDA Intel HDMI at 0xf7b14000 irq 33
 1 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xf7b10000 irq 32
 2 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xf7080000 irq 17
 3 [Camera         ]: USB-Audio - USB2.0 Camera
                      AVEO Technology Corp. USB2.0 Camera at usb-0000:00:14.0-4, high speed

The one that I use is the 1 (PCH) the problem is that in the next restart it changes the order being able to be in 2 so i need to modifie the config file.

In the configuration file .tvtime.xml the line that I must modify is:

<option name = "MixerDevice" value = "hw: 1 / Line" />

changing the 1 by the number in which it falls.

Is there a way to make a script that does this in an automated way?

I hope my English is not very bad and it is understood.

Thank you very much.

Thomas
  • 6,433
Ignacio
  • 11

1 Answers1

1

I have created a script and it works well for me on Ubuntu 18.04. It may serve someone with the same inconvenience. Is this:

#!/bin/sh

# Se necesita la primera vez       $ sudo apt install libxml2-utils v4l-utils

Archivo="~/.tvtime/tvtime.xml"

# TODO: Este siguiente comando habilita el sonido. Ver como hacer para que quede
pactl load-module module-loopback

# Determinar placa de sonido
CanalDeSonidoNro=$(cat /proc/asound/cards|grep "HDA-Intel - HDA Intel PCH"|awk '{ print $1 }')

# Determinar placa de Video
for d in /dev/video* 
do
    Resultado=$(v4l2-ctl --device=$d --info| grep -c -i "Encore ENLTV")

    if [ $Resultado = 1 ] ; then
        PlacaVideoNro=$d
    fi
done

# Salida
echo Placa de Sonido es $CanalDeSonidoNro
echo Placa de Video es $PlacaVideoNro


#Quito ultima linea
sed -i '$d' ~/.tvtime/tvtime.xml

# 
sed -i '/MixerDevice/d' ~/.tvtime/tvtime.xml
echo '' >> ~/.tvtime/tvtime.xml

# 
sed -i '/V4LDevice/d' ~/.tvtime/tvtime.xml
echo '' >> ~/.tvtime/tvtime.xml

# Agrego cierre
echo "" >> ~/.tvtime/tvtime.xml

# amixer -c 0 set Line unmute
tvtime
# amixer -c 0 set Line mute
Ignacio
  • 11