Author Topic: Customize /etc/asound.conf  (Read 1376 times)

m3freak

  • Veteran
  • ***
  • Posts: 125
    • View Profile
Customize /etc/asound.conf
« on: October 24, 2011, 02:36:12 am »
How do I customize /etc/asound.conf on my MDs so that the changes survive reboots?

The auto generated asound.conf doesn't give my any sound over HDMI.  This is what it looks like:

Code: [Select]
pcm_slave.spdif_convert48k {
pcm "spdif:0"
rate 48000
}

pcm.spdif_playback {
type plug
slave spdif_convert48k
}

pcm_slave.hdmi_convert48k {
pcm "hdmi:0"
rate 48000
}

pcm.hdmi_playback {
type plug
slave hdmi_convert48k
}

pcm.asym_spdif {
type asym
playback.pcm "spdif_playback"
capture.pcm "plughw:0"
}

pcm.asym_hdmi {
type asym
playback.pcm "hdmi_playback"
capture.pcm "plughw:0"
}

pcm.asym_analog {
type asym
playback.pcm "plug:dmix:0"
capture.pcm "plughw:0"
}
pcm.!default asym_hdmi

If I comment the "pcm.!default asym_hdmi" and put the following default lines in, sound over HDMI works:

Code: [Select]
pcm.!default {
type hw
card 0
device 7
}

So, how do I make that change stick?

m3freak

  • Veteran
  • ***
  • Posts: 125
    • View Profile
Re: Customize /etc/asound.conf
« Reply #1 on: October 25, 2011, 02:40:43 am »
Gah!  I'd really like some help on this.  Does anyone know how I could make my changes stick?

darrenmason

  • Addicted
  • *
  • Posts: 529
    • View Profile
Re: Customize /etc/asound.conf
« Reply #2 on: October 25, 2011, 07:06:52 am »
There is a template file that is used to generate it. If you change the template (it is only for that MD) then it will generate the working one each time.

Can't remember filenames and locations and I am at work at the moment so I can't check. But if you have trouble finding it let me know and I will look up on the MD that I changed at home.

Looks like a similar change to what I had to do. What sort of machine?

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2847
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Customize /etc/asound.conf
« Reply #3 on: October 25, 2011, 07:39:14 am »
Most of LinuxMCE's files are in directories below /usr/pluto. Diskless MD stuf is in diskless, the binaries are in bin, the templates are in ... templates ;)

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5476
  • DOES work for LinuxMCE.
    • View Profile
Re: Customize /etc/asound.conf
« Reply #4 on: October 25, 2011, 05:07:27 pm »
I am wondering if we should provide a devicedata so that device templates for sound cards could carry what is needed to make them work.

-Thom

m3freak

  • Veteran
  • ***
  • Posts: 125
    • View Profile
Re: Customize /etc/asound.conf
« Reply #5 on: October 25, 2011, 10:25:58 pm »
There is a template file that is used to generate it. If you change the template (it is only for that MD) then it will generate the working one each time.

Can't remember filenames and locations and I am at work at the moment so I can't check. But if you have trouble finding it let me know and I will look up on the MD that I changed at home.

Found it in /usr/pluto - thanks posde!

I added the following to it:

Code: [Select]
pcm.nvidia_hdmi {
type hw
card 0
device 7
}

pcm.!default pcm.nvidia_hdmi

Funny thing is, I don't see the line, "pcm.!default asym_hdmi", like I did when the MD was up and running.  I'm going to guess something else sets the default, so I'm not sure if I should put the default in manually.  I will be testing this out tonight.

Looks like a similar change to what I had to do. What sort of machine?

This, though I'm not 100% sure my version has the exact same specs:

http://www.jetway.com.tw/jw/Barebone_view.asp?productid=760&proname=JBC600C99352W-BW%20%28Mini-top%29

After sound over HDMI is working 100%, my next task is going to be getting the remote working.  Right now, only a few of the buttons work.  The MD doesn't see the remote as a remote.  I think right now it's just being recognized as a mouse (based on its current behaviour).  Anyway, I'll leave this remote stuff to a new thread.

m3freak

  • Veteran
  • ***
  • Posts: 125
    • View Profile
Re: Customize /etc/asound.conf
« Reply #6 on: October 26, 2011, 03:37:21 am »
I have no idea what I'm doing.  I know next to nothing about LinuxMCE and making any custom changes is extremely confusing.  I wish I could spend more time learning, but these days I don't have a lot of free time.

So, with that said, I guess editing /usr/pluto/templates/asound.conf was a mistake because after the MD booted up, /etc/asound.conf on the MD hadn't changed at all. Just great.

I then looked on the core in /usr/pluto/diskless/29/usr/pluto/templates, and found the MD's asound.conf.  It has some macros in it for automagically finding the card number.  Can I put the lines I mentioned before straight into this file?  Also, I don't see the "default" line.  Can I manually put that in here too, or will something else come along and add another default line?

m3freak

  • Veteran
  • ***
  • Posts: 125
    • View Profile
Re: Customize /etc/asound.conf
« Reply #7 on: October 29, 2011, 03:56:44 am »
Any tips for my newest dilemma?

m3freak

  • Veteran
  • ***
  • Posts: 125
    • View Profile
Re: Customize /etc/asound.conf
« Reply #8 on: November 06, 2011, 01:48:00 am »
There is a template file that is used to generate it. If you change the template (it is only for that MD) then it will generate the working one each time.

Can't remember filenames and locations and I am at work at the moment so I can't check. But if you have trouble finding it let me know and I will look up on the MD that I changed at home.

Looks like a similar change to what I had to do. What sort of machine?

I changed the template file for the MD in question, but the generated config file didn't change.  I'm not sure what to do next.   Could you tell me which file you edited for your MD and what you did?