Author Topic: NO sound on MD used to work out of the box.  (Read 5264 times)

theteju

  • Guru
  • ****
  • Posts: 180
    • View Profile
NO sound on MD used to work out of the box.
« on: December 10, 2012, 09:01:58 pm »
Hello guys,

install from reasonably recent snapshot, I have no sound on my MD.

root@moon62:~# dmesg | pastebinit
http://pastebin.com/7su21Ew6
root@moon62:~# aplay -l | pastebinit
http://pastebin.com/Munx46R0
root@moon62:~# lspci | pastebinit
http://pastebin.com/gkFtrkUE

root@moon62:/etc# cat asound.conf | pastebinit
http://pastebin.com/zYUkb47j
root@moon62:/etc# cat X11/xorg.conf | pastebinit
http://pastebin.com/4MH9LCqZ
root@moon62:/etc# lspci -nnk | grep VGA -A3
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF108 [GeForce GT 430] [10de:0de1] (rev a1)
   Kernel driver in use: nvidia
   Kernel modules: nvidia-glx-260, nvidiafb, nouveau
01:00.1 Audio device [0403]: NVIDIA Corporation GF108 High Definition Audio Controller [10de:0bea] (rev a1)




The soundcards were detected on AV wizard but upon selecting Asus Xonar D2 , optical output , I have no sound. Used to work out of the box.

Please look at the screen shots of alsamixer from MD. what else am I suppose to do?

any help, greatly appreciated.

Thanks.

« Last Edit: December 10, 2012, 09:44:52 pm by theteju »

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: NO sound on MD used to work out of the box.
« Reply #1 on: December 10, 2012, 11:21:35 pm »
I would expect this to work ootb.

Your cards native HDMI is another issue. I am in chat now, and while you asked for help I cannot raise a reply from you.
I never quit... I just ping out.

Michaelree

  • Regular Poster
  • **
  • Posts: 17
    • View Profile
Re: NO sound on MD used to work out of the box.
« Reply #2 on: December 19, 2012, 07:50:20 am »
I am having the same problem.  Installed from the 12/15 snapshot and i no longer have sound using spdf optical.

root@moon40:~# dmesg | pastebinit
http://pastebin.com/CFXFh22W

root@moon40:~# aplay -l | pastebinit
http://pastebin.com/HRpFr387

root@moon40:~# lspci | pastebinit
http://pastebin.com/1L66Js08

root@moon40:~# cat /etc/asound.conf | pastebinit
http://pastebin.com/zfdFLDVT

root@moon40:~# cat /etc/X11/xorg.conf | pastebinit
http://pastebin.com/Bvw7P11a

Any help would be appreciated.

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: NO sound on MD used to work out of the box.
« Reply #3 on: December 19, 2012, 04:21:17 pm »
I don't understand how this ever worked but doesn't now...

I need to change how I am dealing with these device numbers. All sorts of chipsets use their own designation for device types. Please replace /usr/pluto/bin/SetupAudioVideo.sh with the following:
Code: [Select]
#!/bin/bash
. /usr/pluto/bin/pluto.func
. /usr/pluto/bin/Config_Ops.sh
. /usr/pluto/bin/Utils.sh
. /usr/pluto/bin/SQL_Ops.sh

DEVICECATEGORY_Media_Director="8"
DEVICECATEGORY_Video_Cards="125"
DEVICECATEGORY_Sound_Cards="124"
DEVICETEMPLATE_OnScreen_Orbiter="62"
DEVICETEMPLATE_Stereo_virtual_sound_card="2223"
DEVICEDATA_Video_settings="89"
DEVICEDATA_Audio_settings="88"
DEVICEDATA_Reboot="236"
DEVICEDATA_Connector="68"
DEVICEDATA_TV_Standard="229"
DEVICEDATA_Setup_Script="189"
DEVICEDATA_Sound_Card="288"
DEVICEDATA_Channel_Left="311"
DEVICEDATA_Channel_Right="312"
DEVICEDATA_Channel="81"
DEVICEDATA_Sampling_Rate="310"
SettingsFile="/etc/pluto/lastaudiovideo.conf"
# don't let KDE override xorg.conf
rm -f {/home/*,/root}/.kde/share/config/displayconfigrc

Reboot="NoReboot"
ReloadX="NoReloadX"
AudioSetting_Override="$1"
SoundCard_Override="$2"
XineConf_Override="$3"
ComputerDev=$(FindDevice_Category "$PK_Device" "$DEVICECATEGORY_Media_Director" '' 'include-parent')
OrbiterDev=$(FindDevice_Template "$ComputerDev" "$DEVICETEMPLATE_OnScreen_Orbiter")
VideoCardDev=$(FindDevice_Category "$ComputerDev" "$DEVICECATEGORY_Video_Cards")
AsoundConf="/usr/pluto/templates/asound.conf"
ConfGet "AlternateSC"

if [[ -z "$VideoCardDev" ]]; then
VideoCardDev=$(FindDevice_Category "$PK_Device" "$DEVICECATEGORY_Video_Cards")
fi

SoundCardDev=$(FindDevice_Category "$ComputerDev" "$DEVICECATEGORY_Sound_Cards")

if [[ -z "$SoundCardDev" ]]; then
SoundCardDev=$(FindDevice_Category "$PK_Device" "$DEVICECATEGORY_Sound_Cards")
fi

ReadConf()
{
## config file format (direcly parsable by bash):
# name=value
if [[ -f "$SettingsFile" ]]; then
while read line; do
eval "OldSetting_$line"
done <"$SettingsFile"
fi
}

GetVideoSetting()
{
local Q
local VideoSetting

VideoSetting=$(GetDeviceData "$ComputerDev" "$DEVICEDATA_Video_settings")

if [[ -n "$VideoSetting" ]]; then
Refresh=$(echo "$VideoSetting" | cut -d '/' -f2)
ResolutionInfo=$(echo "$VideoSetting" | cut -d '/' -f1)
ResX=$(echo "$ResolutionInfo" | cut -d' ' -f1)
ResY=$(echo "$ResolutionInfo" | cut -d' ' -f2)
if [[ -z "$Refresh" || -z "$ResX" || -z "$ResY" ]]; then
Logging "$TYPE" "$SEVERITY_CRITICAL" "SetupAudioVideo.sh" "Malformed DeviceData: VideoSetting='${VideoSetting}'"
MalformedVideoSetting='Malformed VideoSetting'
fi
fi

if [[ -z "$MalformedVideoSetting" ]]; then
echo "$VideoSetting"
fi
}

SaveSettings()
{
local Var VarName

for Var in ${!OldSetting_*}; do
VarName="${Var#OldSetting_}"
eval "Save_$VarName=\"${!Var}\""
done

for Var in ${!NewSetting_*}; do
VarName="${Var#NewSetting_}"
eval "Save_$VarName=\"${!Var}\""
done

for Var in ${!Save_*}; do
VarName="${Var#Save_}"
echo "$VarName=\"${!Var}\""
done >"$SettingsFile"
}

Setup_VirtualCards()
{
local Q R
mkdir -p /etc/pluto/alsa
local Vfile=/etc/pluto/alsa/virtual_cards.conf
local Devices=$(FindDevice_Template "$PK_Device" "$DEVICETEMPLATE_Stereo_virtual_sound_card" "" "" all)
local Dev ParentDev SoundCard
local Channel_Left Channel_Right
local SampleRate IpcKey

>"$Vfile"
for Dev in $Devices; do
Channel_Left=$(GetDeviceData "$Dev" "$DEVICEDATA_Channel_Left")
Channel_Right=$(GetDeviceData "$Dev" "$DEVICEDATA_Channel_Right")
Q="SELECT FK_Device_ControlledVia FROM Device WHERE PK_Device=$Dev"
R=$(RunSQL "$Q")

ParentDev=$(Field 1 "$R")
SoundCard=$(GetDeviceData "$ParentDev" "$DEVICEDATA_Sound_Card")
SoundCard=$(TranslateSoundCard "$SoundCard")

if [[ -z "$SoundCard" ]]; then
continue
fi

Channels=$(GetDeviceData "$ParentDev" "$DEVICEDATA_Channel")
if [[ ! "$Channels" =~ ^[0-9]+$ ]]; then
continue
fi

SampleRate=$(GetDeviceData "$ParentDev" "$DEVICEDATA_Sampling_Rate")
if [[ -z "$SampleRate" ]]; then
SampleRate=44100
fi

IpcKey=$(printf "0x%08x" $((0x72380000 + ParentDev)))
cat >>"$Vfile" <<END
pcm.Virtual_$Dev {
type plug
slave.pcm {
type dmix
ipc_key $IpcKey
bindings.0 $Channel_Left
bindings.1 $Channel_Right
slave {
pcm "hw:$SoundCard,0"
channels $Channels
rate $SampleRate
}
}
}
END
done
}

Enable_Audio_Channels()
{
# Added this to correctly unmute channels for setup wizard, and to
# inject necessary unmuting commands for later bootup.
yalpa=$(aplay -l)
grep -iwo "card ." <<< "$yalpa" | awk '{print $2}' | uniq | while read CardNumber; do
amixer -c "$CardNumber" | grep '\[off\]' -B5 | grep "Simple" | sed 's/Simple mixer control //g' | grep -vi "capture" | while read MuteStatus; do
amixer -c "$CardNumber" sset "$MuteStatus" unmute
done
alsactl store
amixer -c "$CardNumber" | grep '\[.*\%\]' -B5 | grep "Simple" | sed 's/Simple mixer control //g' | grep -vi "capture" | while read VolLevel; do
amixer -c "$CardNumber" sset "$VolLevel" 80%
done 2>&1>/dev/null
alsactl store
done
}

Setup_AsoundConf()
{
local AudioSetting="$1"
SoundOut="hw:"
Yalpa=$(aplay -l 2>&1)
# Do not mess with asound.conf if Audio Setting is set to Manual. This will only happen after the asound.conf has been generated at least once.
if [[ "$AudioSetting" == "M" ]]; then
return
fi
if grep 'no soundcards found' <<< "$Yalpa"; then
return
fi

local Q R
local MD_Device="$PK_Device"

Setup_VirtualCards

Q="SELECT FK_DeviceTemplate FROM Device WHERE PK_Device=$PK_Device"
R=$(RunSQL "$Q")

if [[ "$R" == "7" ]]; then
Q="SELECT PK_Device FROM Device WHERE FK_DeviceTemplate=28 AND FK_Device_ControlledVia=$PK_Device"
R=$(RunSQL "$Q")
MD_Device=$(Field 1 "$R")
fi

if [[ -n "$SoundCard_Override" ]]; then
SoundCard="$SoundCard_Override"
else
SoundCard=$(GetDeviceData "$MD_Device" "$DEVICEDATA_Sound_Card")
fi

SoundCard=$(TranslateSoundCard "$SoundCard")
HWOnlyCard="$SoundCard"

# Handle nVidia GT card types
case "$AudioSetting" in
*[CO]*)
CardDevice=$(grep -i "card" <<< "$Yalpa" | grep -v "device 0" | grep -vi "HDMI" | grep -wo "device ." | awk '{print $2}' | head -1)
ConnectType="spdif"
PlaybackPCM="${ConnectType}_playback"
if [[ "$AlternateSC" -ge "1" ]]; then
SoundOut="plughw:"
SoundCard="${HWOnlyCard},${CardDevice}"
fi
if [[ "$AlternateSC" == "2" ]]; then
AsoundConf="/usr/pluto/templates/asound.conf.backup"
fi
;;
*H*)
CardDevice=$(grep -i "hdmi" <<< "$Yalpa" | grep -wo "device ." | awk '{print $2}')
if [[ $(wc -l <<< "$CardDevice") -gt "3" ]]; then
if grep "7" <<< "$CardDevice"; then
CardDevice="7"
fi
fi
if [[ "$AlternateSC" -ge "1" ]]; then
SoundOut="plughw:"
SoundCard="${HWOnlyCard},${CardDevice}"
fi
if [[ "$AlternateSC" == "2" ]]; then
AsoundConf="/usr/pluto/templates/asound.conf.backup"
fi
ConnectType="hdmi"
PlaybackPCM="${ConnectType}_playback"
;;
*)
CardDevice="0"
SoundOut="plug:dmix:"
ConnectType="analog"

if [[ "$AlternateSC" -ge "1" ]]; then
SoundOut="plughw:"
SoundCard="${HWOnlyCard},${CardDevice}"
fi

if [[ "$AlternateSC" == "2" ]]; then
AsoundConf="/usr/pluto/templates/asound.conf.backup"
fi
PlaybackPCM="${SoundOut}${SoundCard}"
;;
esac

local PlaybackCard="${SoundOut}${SoundCard}"
sed -r "s#%CONNECT_TYPE%#$ConnectType#g; s#%MAIN_CARD%#$SoundCard#g; s#%PLAYBACK_PCM%#$PlaybackPCM#g;" "$AsoundConf" > /etc/asound.conf

Setup_XineConf "$AudioSetting" "$PlaybackCard"
/usr/pluto/bin/RestartALSA.sh
Enable_Audio_Channels
}

Setup_XineConf()
{
local AudioSetting="$1" PlaybackCard="$2"
local XineConf=/etc/pluto/xine.conf
sed -i '/audio\.device.*/d' "$XineConf"
sed -i '/audio\.output.*/d' "$XineConf"

if [[ -n "$XineConf_Override" ]]; then
XineConf="$XineConf_Override"
fi

if [[ "$AlternateSC" -ne "2" ]]; then
case "$AudioSetting" in
*[COH]*)
XineConfSet audio.device.alsa_front_device "$PlaybackCard" "$XineConf"
XineConfSet audio.device.alsa_default_device "$PlaybackCard" "$XineConf"
XineConfSet audio.output.speaker_arrangement 'Pass Through' "$XineConf"
XineConfSet audio.device.alsa_passthrough_device "$PlaybackCard" "$XineConf"
;;
*)
XineConfSet audio.device.alsa_front_device "$PlaybackCard" "$XineConf"
XineConfSet audio.device.alsa_default_device "$PlaybackCard" "$XineConf"
;;
esac
else
case "$AudioSetting" in
*[COH]*)
XineConfSet audio.device.alsa_front_device "$PlaybackCard" "$XineConf"
XineConfSet audio.device.alsa_default_device "$PlaybackCard" "$XineConf"
XineConfSet audio.device.alsa_passthrough_device "$PlaybackCard" "$XineConf"
;;
*)
XineConfSet audio.device.alsa_front_device "$PlaybackCard" "$XineConf"
XineConfSet audio.device.alsa_default_device "$PlaybackCard" "$XineConf"
sed -i '/audio\.device\.alsa_passthrough_device.*/d' "$XineConf"
;;
esac
fi

case "$AudioSetting" in
*3*)
XineConfSet audio.output.speaker_arrangement 'Pass Through' "$XineConf"
XineConfSet audio.device.alsa_passthrough_device "$PlaybackCard" "$XineConf"
;;

*)
XineConfSet audio.output.speaker_arrangement 'Stereo 2.0' "$XineConf"
sed -i '/audio\.device\.alsa_passthrough_device.*/d' "$XineConf"
;;
esac
}

VideoSettings_Check()
{
local Update_XorgConf="NoXorgConf"
local DB_VideoSetting DB_OpenGL DB_AlphaBlending DB_Connector DB_TVStandard DB_Reboot

DB_VideoSetting=$(GetVideoSetting)
DB_OpenGL=$(OpenGLeffects)
DB_AlphaBlending=$(AlphaBlendingEnabled)
DB_Connector=$(GetDeviceData "$ComputerDev" "$DEVICEDATA_Connector")
DB_TVStandard=$(GetDeviceData "$ComputerDev" "$DEVICEDATA_TV_Standard")
DB_Reboot=$(GetDeviceData "$VideoCardDev" "$DEVICEDATA_Reboot")

if [[ -n "$DB_VideoSetting" && "$DB_VideoSetting" != "$OldSetting_VideoSetting" ]]; then
Update_XorgConf="XorgConf"
NewSetting_VideoSetting="$DB_VideoSetting"
fi

if [[ -n "$DB_OpenGL" && "$DB_OpenGL" != "$OldSetting_OpenGL" ]]; then
Update_XorgConf="XorgConf"
NewSetting_OpenGL="$DB_OpenGL"
fi

if [[ -n "$DB_AlphaBlending" && "$DB_AlphaBlending" != "$OldSetting_AlphaBlending" ]]; then
Update_XorgConf="XorgConf"
NewSetting_AlphaBlending="$DB_AlphaBlending"
fi

if [[ -n "$DB_Connector" && "$DB_Connector" != "$OldSetting_Connector" ]]; then
Update_XorgConf="XorgConf"
NewSetting_Connector="$DB_Connector"
fi

if [[ -n "$DB_TVStandard" && "$DB_TVStandard" != "$OldSetting_TVStandard" ]]; then
Update_XorgConf="XorgConf"
NewSetting_TVStandard="$DB_TVStandard"
fi

if [[ "$Update_XorgConf" == "XorgConf" ]]; then
/usr/pluto/bin/Xconfigure.sh
if [[ "$DB_Reboot" == 1 ]]; then
Reboot="Reboot"
else
ReloadX="ReloadX"
fi

# Orbiter Regen
Q="
UPDATE Orbiter
SET Regen=1
WHERE PK_Orbiter='$OrbiterDev'
"
RunSQL "$Q"
fi
}

AudioSettings_Check()
{
local DB_AudioSetting DB_AudioScript DB_Reboot
local ScriptPath

if [[ -z "$AudioSetting_Override" ]]; then
DB_AudioSetting=$(GetDeviceData "$ComputerDev" "$DEVICEDATA_Audio_settings")
else
DB_AudioSetting="$AudioSetting_Override"
fi

DB_Reboot=$(GetDeviceData "$AudioCardDev" "$DEVICEDATA_Reboot")
Logging "$TYPE" "$SEVERITY_NORMAL" "SetupAudioVideo" "'"
DB_AudioScript=$(GetDeviceData "$SoundCardDev" "$DEVICEDATA_Setup_Script")
ScriptPath="/usr/pluto/bin/$DB_AudioScript"
Logging "$TYPE" "$SEVERITY_NORMAL" "SetupAudioVideo" "DBSetting: $DB_AudioSetting Reboot: $DB_Reboot Script Path: $ScriptPath"

if [[ -n "$DB_AudioSetting" && -f "$ScriptPath" ]]; then
Logging "$TYPE" "$SEVERITY_NORMAL" "SetupAudioVideo" "Running: $ScriptPath $DB_AudioSetting"
"$ScriptPath" "$DB_AudioSetting"
fi

NewSetting_AudioSetting="$DB_AudioSetting"

if [[ "$NewSetting_AudioSetting" == *S* ]]; then
# S3 is not a valid combination and will break things
NewSetting_AudioSetting="${NewSetting_AudioSetting//3}"
fi

if [[ -z "$AlternateSC" ]]; then
AlternateSC="0"
fi

Setup_AsoundConf "$NewSetting_AudioSetting" "$AlternateSC"

if [[ "$DB_Reboot" == "1" ]]; then
Reboot="Reboot"
fi
}

Logging "$TYPE" "$SEVERITY_NORMAL" "SetupAudioVideo" "Starting"
ReadConf
VideoSettings_Check
AudioSettings_Check
SaveSettings

if [[ -z "$(pidof X)" ]]; then
exit # no X is running
fi

if [[ "$Reboot" == "Reboot" ]]; then
reboot
elif [[ "$ReloadX" == "ReloadX" ]]; then
/usr/pluto/bin/RestartLocalX.sh &
disown -a
fi


And please be aware of this: http://wiki.linuxmce.org/index.php/Audio_in_1004
« Last Edit: December 19, 2012, 04:22:51 pm by l3mce »
I never quit... I just ping out.

Michaelree

  • Regular Poster
  • **
  • Posts: 17
    • View Profile
Re: NO sound on MD used to work out of the box.
« Reply #4 on: December 19, 2012, 11:58:44 pm »
It is still not working.  This stopped working sometime over the last 6 month.  It was working on an install I did in May/June, that I had not updated till last week, After the update it stopped working.  The other 3 MD's did not have any audio problems.

root@moon40:~# cat /etc/asound.conf | pastebinit
http://pastebin.com/Q5DJZLcv

root@moon40:~# cat /usr/pluto/bin/SetupAudioVideo.sh | pastebinit
http://pastebin.com/hBZuHR8L

root@moon40:~# cat /etc/pluto.conf | pastebinit
http://pastebin.com/pkhfbTwj

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: NO sound on MD used to work out of the box.
« Reply #5 on: December 20, 2012, 03:33:27 am »
Can I see tail -4 /etc/pluto/xine.conf

The thing is, it is setup correctly outside of one oddity.

Please rm /etc/asound.conf   edit /etc/pluto/xine.conf (go all the way to the end of the very long config file) and delete everything below the line:
#vcd.title_format:%F - %I %N%L%S, disk %c of %C - %v %A

leaving a space... then run /usr/pluto/bin/SetupAudioVideo.sh
It will spit back a few things, including FATAL: Module such-n-such in use. You could paste that output as well...

I am expecting the configuration, the way you have it, to be creating a slightly different asound, and we will see about the /xine.conf

If you could drop into IRC this would probably go faster.
I never quit... I just ping out.