Author Topic: How do i stop Linuxmce editing my asound.conf file ?  (Read 5204 times)

geekyhawkes

  • Guru
  • ****
  • Posts: 230
    • View Profile
How do i stop Linuxmce editing my asound.conf file ?
« on: July 17, 2009, 03:01:44 pm »
I have been trying to get my hdmi audio working for sometime.  During my kde install i managed to get the HDMI audio working fine, but since running the avwizard during my initial 0810 setup I have never had any sucess (in KDE or Linux MCE). 

After a fair bit of digging around I think part of the problem is down to my asound.conf file being changed everytime i start the system up (i think by Linux mce). 

I had set my HDMI audio up as detailed below;


pcm.!default {
        type plug
        slave {
                pcm multi
                rate 48000
        }
        ttable.0.0 1.0
        ttable.1.1 1.0
        ttable.0.2 1.0
        ttable.1.3 1.0
}

#ctl.!default hdmiout

pcm.optical {
        type hw
        card 0
        device 1
}

ctl.optical {
        type hw
        card 0
        device 1
}

pcm.hdmiout {
        type hw
        card 0
        device 3
}

ctl.hdmiout {
        type hw
        card 0
        device 3
}

pcm.multi {
        type multi
        slaves.a.pcm "hdmiout"
        slaves.a.channels 2
        slaves.b.pcm "optical"
        slaves.b.channels 2

        bindings.0.slave a
        bindings.0.channel 0
        bindings.1.slave a
        bindings.1.channel 1

        bindings.2.slave b
        bindings.2.channel 0
        bindings.3.slave b
        bindings.3.channel 1
}

ctl.multi {
        type hw
        card 0
}


This was working fine under KDE but everytime i start my machine (even if i edit the asound.conf file back to the above), the asound.conf file actually contains the following;

type plug
slave {
pcm multi
rate 48000
}
ttable.0.0 1.0
ttable.1.1 1.0
ttable.0.2 1.0
ttable.1.3 1.0



#ctl.!default hdmiout

pcm.optical {
        type hw
        card 0
        device 1
}

ctl.optical {
        type hw
        card 0
        device 1
}

pcm.hdmiout {
        type hw
        card 0
        device 3
}

ctl.hdmiout {
        type hw
        card 0
        device 3
}

pcm.multi {
        type multi
        slaves.a.pcm "hdmiout"
        slaves.a.channels 2
        slaves.b.pcm "optical"
        slaves.b.channels 2

        bindings.0.slave a
        bindings.0.channel 0
        bindings.1.slave a
        bindings.1.channel 1

        bindings.2.slave b
        bindings.2.channel 0
        bindings.3.slave b
        bindings.3.channel 1
}

ctl.multi {
        type hw
        card 0
}

pcm.!default asym_analog


From what i can see the "edited" asound.conf isnt even a valid file, and is certainly in confliction with the manually edited file i had created.

I have searched the wiki and found some useful information for forcing the avwizard to not alter the xconf file, but nothing relating to the way MCE edits the alsa files.

Can anyone help?


chriss

  • Veteran
  • ***
  • Posts: 140
    • View Profile
Re: How do i stop Linuxmce editing my asound.conf file ?
« Reply #1 on: July 17, 2009, 04:07:58 pm »
Have you tried to spot the part of the system that is actually overwriting the file? Once you have the component you can correct the behavior to produce valid files and you can also enhance the system to allow for custom configuration via device templates (if this isn't implemented yet).

just my 2 c
/chriss

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: How do i stop Linuxmce editing my asound.conf file ?
« Reply #2 on: July 17, 2009, 04:15:37 pm »
Its AV Wizard itself that modifies the file based on the settings you choose for sound when you run it. There are other triggers, but typically just a reboot is not one of them (although something else maybe checking some settings, and that triggers it), there is a wiki article that talks about preventing the system modifying your xorg.conf file even when you haven't run AV Wizard, so this would seem to be a similar effect. Perhaps look up that article and see if it gives any clues on a similar approach to sound?

geekyhawkes

  • Guru
  • ****
  • Posts: 230
    • View Profile
Re: How do i stop Linuxmce editing my asound.conf file ?
« Reply #3 on: July 17, 2009, 05:40:01 pm »
Thanks colin.  I had suspected the avwizard was modifying the asound.conf file.  Is there any way i could find what the trigger is at all?  Or an easy way to restart alsa sound whilst the system is up and running to see if that helps? 

I have found the wiki relating to preventing the modification of xorg.conf but it doesnt really give much in the way of clues for sound;

http://wiki.linuxmce.org/index.php/Custom_Display_Resolutions

Quote
Prevent LinuxMCE from changing the Xorg config

This is a bit of an ugly hack, and if the above is done correctly I'm not sure if it's even needed. Nevertheless, if you want to get really creative and write your own xorg.conf, this is the way to protect it from being overwritten:

Edit /usr/pluto/bin/Xconfigure.sh and add the following lines immediately below the #!/bin/bash:

   echo "$0 neutered to preserve custom xorg.conf"
   exit 0

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: How do i stop Linuxmce editing my asound.conf file ?
« Reply #4 on: July 17, 2009, 06:55:27 pm »
If you go into Wizard > Media Directors, and check the drop down box for sound configuration on your media director, you'll find an option for manually configuring...

but, why the hell are you doing this?

-Thom

geekyhawkes

  • Guru
  • ****
  • Posts: 230
    • View Profile
Re: How do i stop Linuxmce editing my asound.conf file ?
« Reply #5 on: July 17, 2009, 06:59:38 pm »
Thom;

thanks.  I have a bit of spare time this weekend and want to try and get audio via hdmi.  The asound.conf i have attached above will if nothing else get audio over hdmi in kde which is a move forward from my current set up.

geekyhawkes

  • Guru
  • ****
  • Posts: 230
    • View Profile
Re: How do i stop Linuxmce editing my asound.conf file ?
« Reply #6 on: July 18, 2009, 07:44:43 pm »
EVen with the sound setup as manual then my asound.conf file is still being edited on a reboot. 

Is there someway i could restart alsa only (ie without a full reboot?).  Hopefully this way my asound.conf would remain and i could start to isolate hdmi audio.

Or are there any other ways i could stop mce adjusting my asound.conf file?

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: How do i stop Linuxmce editing my asound.conf file ?
« Reply #7 on: July 19, 2009, 02:08:31 am »
You can do

sudo /etc/init.d/alsa-utils restart

But I'm not sure that will necessarily help...

geekyhawkes

  • Guru
  • ****
  • Posts: 230
    • View Profile
Re: How do i stop Linuxmce editing my asound.conf file ?
« Reply #8 on: July 19, 2009, 11:59:57 am »
Sadly restarting alsa doesnt help as predicted!

I have tried going back through the avwizard and selecting no sound but no change.  Anyone know if hdmi audio will be in the beta?