LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   HD-Audio: ALSA settings not persistent across reboots. (http://www.linuxquestions.org/questions/slackware-14/hd-audio-alsa-settings-not-persistent-across-reboots-4175444284/)

stf92 01-05-2013 01:29 PM

HD-Audio: ALSA settings not persistent across reboots.
 
2 Attachment(s)
Hi:
The OS is Slackware 14.0. When, after 14.0 install I first ran alsamixer, I got an error message and it quit. After some googling, I created /etc/modprobe.d/alsa.conf with these lines:
Code:

      alias snd-card-0 snd_hda_intel
      alias sound-slot-0 snd_hda_intel
      options snd_hda_intel model=auto

Then 'alsactl init' and 'alsactl store'.


All went well. I rebooted and still everything fine. I then turned off the computer and, this morning, after turning it on back, I found the OS had only found the PC builtin speaker but not the sound card, which is Realtek ALC887-VD (High definition audio). I ran alsa_utils_alsa-info.sh, provided by the ALSA project, and whose output I attach (alsa-info.txt.XXXXxjVB26_old.txt).

I renamed alsa.conf to a non existent name, rebooted, and all went back to normal. I renamed back to alsa.conf, rebooted again and still normal. See by the way /lib/modprobe.d/sound-modems.conf:
Code:

# ALSA modules to support sound modems.  These should be loaded manually
# if needed.  For most people they just break sound support...
blacklist snd-atiixp-modem
blacklist snd-intel8x0m
blacklist snd-via82xx-modem

In fact the detection of the sound card is random across reboots: sometimes detected, sometimes not. Perhaps removing the second line above has anything to do. Now, from HD-Audio.txt:

Quote:

DMA-Position Problem
~~~~~~~~~~~~~~~~~~~~
The most common problem of the controller is the inaccurate DMA
pointer reporting. The DMA pointer for playback and capture can be
read in two ways, either via a LPIB register or via a position-buffer
map. As default the driver tries to read from the io-mapped
position-buffer, and falls back to LPIB if the position-buffer appears
dead. However, this detection isn't perfect on some devices. In such
a case, you can change the default method via `position_fix` option.

`position_fix=1` means to use LPIB method explicitly.
`position_fix=2` means to use the position-buffer.
`position_fix=3` means to use a combination of both methods, needed
for some VIA and ATI controllers. 0 is the default value for all other
controllers, the automatic check and fallback to LPIB as described in
the above. If you get a problem of repeated sounds, this option might
help.
Perhaps the addition of 'position_fix=3' in /etc/modprobe.d/alsa.conf, line options, solves the problem. I could try it myself, but I repeat, the behavior is almost random. In fact, in another post I saw some people used this option, but I disregarded it, because a remark there made reference to mic noise. Now, this is the output of alsa_utils_alsa-info.sh when everything goes well (see second attachment). That would be all, I think.

Slackware 14.0

EDIT: in /etc/modprobe.d/alsa.conf, I'm not sure if it is 'options snd_hda_intel' or 'snd-hda-intel'. Both forms get the same error message at boot time.

EDIT:
Code:

semoi@darkstar:/lib/modprobe.d$ cat sound-modems.conf
##############################################################################
# Do not edit this file; instead, copy it to /etc/modprobe.d/ and edit that
##############################################################################

# ALSA modules to support sound modems.  These should be loaded manually
# if needed.  For most people they just break sound support...
blacklist snd-atiixp-modem
blacklist snd-intel8x0m
blacklist snd-via82xx-modem

semoi@darkstar:/lib/modprobe.d$

So, I just renamed /etc/modprobe.d/alsa.conf as /etc/modprobe.d/sound-modems.conf and appended the blacklist lines. Then booted and it worked. I must wait to see if it's still working after several boots [it is NOT]

As a side note, I think this post is not trivial if you believe, and I quote from another forum, this:
Quote:

It is probably issue with the Realtek ALC 887 codec, since there is miriad of problems in linux with that codec in combination with Intel and Nvidia HDA cards.

stf92 01-06-2013 04:46 AM

The problem seems to be solved now [see below, it is not]. I did two things: I copied /lib/modprobe.d/sound-modems.conf to /etc/modprobe.d/ which is only a set of blacklist lines and added the following to the latter:
Code:

      alias snd-card-0 snd_hda_intel
      alias sound-slot-0 snd_hda_intel
      options snd_hda_intel index=0 model=auto

The second thing was the election of 'auto' in the options line above. I have the BIOS with 'Control detection of the audio device' enabled so 'model=auto' seems to work fine, that is, the ALSA configuration persists across bootings and alsamixer can be run and shows all the controls. There is only one thing left floating still. To get arecord to record, but this does not belong to the tread.

THE PROBLEM was not solved. I just rebooted and the card was not detected.

allend 01-06-2013 07:23 AM

Quote:

options snd_hda_intel index=0 model=auto
Have you tried with a comma separating the two options i.e.
Code:

options snd_hda_intel index=0, model=auto

stf92 01-06-2013 08:51 AM

I just put the comma, rebooted and still not detected.

Question: does anything in /etc/modprobe.d/ get executed or only the files with filenames matching those in /lib/modprobe.d/?

I was going to post the following in post #2. Here it is:
As of now I know this: the motherboard chipset is an Intel H61 Express, which hosts the Realtek ALC887-VD codec. The audio controller is inside the H61. Now, in realtek, I downloaded LinuxPkg_5.17rc13.tar.bz2. I quote from file SOUNDCARDS in it:
Code:



        Advanced Linux Sound Architecture  -  Supported SoundCards
                  ==========================================================

                ID: SoundCard chipset/type
                SC: SoundCard name
                IF: Supported interfaces (MIXER,PCM,SYNTH,SYNTH_MIDI,SEQ,OPL,MIDI,EMUL,HWDEP)
                MA: Maintainer
                CO: Coder

                This file is maintained by Jaroslav Kysela <perex@perex.cz>.
                Note: OPL -> Raw (native) OPL
                Note: MIDI -> external MIDI port
                Note: EMUL -> MIDI emulation
                Note: SYNTH -> yeah, well ?
                Note: SYNTH_MIDI -> internal synth that handles MIDI data
                Note: SEQ -> kernel client for ALSA sequencer
                Note: HWDEP -> various hardware-dependent interfaces/devices
                =====

                ID: AMD InterWave
                SC: Gravis UltraSound Plug & Play
                SC: Dynasonic 3-D
                SC: STB Sound Rage 32
                SC: UltraSound 32-Pro (STB)
                SC: MED3210
                IF: MIXER,PCM,MIDI,SYNTH
                MA: Jaroslav Kysela <perex@perex.cz>

                .................................

                ID: Intel i810/i820/i830/i840/MX440
                IF: MIXER,PCM,MIDI
                MA: Jaroslav Kysela <perex@perex.cz>

The dot line is mine. The only reference to Intel is that shown. It would follow that Realtek ALC887-VD does not support Intel H61. At the same time in /usr/src/linux-3.2.29/Documentation/sound/alsa/HD-Audio-Models.txt, there are listed ALC882/883/885/888/889, with, among others, model name 'auto', described as "auto-config reading BIOS (default)".
BIOS has option 'Control detection of the audio device'. The logical would be to disable it, then. I say, BIOS has, with model=auto, no need to detect the device. I tried with bios enabled and disabled.

EDIT: as I sometimes have deleted all files in /etc/modeprobe.d/ and after booting the audio has come back, I strongly suspect that the only thing I needed to do after I installed 14.0 was to run 'alsactl init'. The only file in that dir now is README. I'll wait to see if after some booting I loose audio again.

kkady32 01-06-2013 09:33 AM

in /etc/modprobe.d/alsa.conf put only:
Code:

options snd_hda_intel model=auto
i have the same ALC 887-VD but i run slackware64-current (3.7.1)

stf92 01-06-2013 10:02 AM

OK. I just did it and lets suppose the settings persist across reboots (of course I rebooted once and it's fine). I have now
Code:

/usr/bin/amixer -c 0 sset Line,0 100%,100% mute  capt
/usr/bin/amixer -c 0 sset Front,0 100%,100% unmute  nocap
arecord -r 8 -D plughw:0,0

where I am entering with audio at the Line In jack.

With my previous card I had 'PCM' instead of 'Front' in the second line. When I run the third line, I should see mixed characters in the console, but it's filled with the same character. That is, it's recording nothing.

Now unmuting 'Line' in alsamixer, what enters one jack gets out at the other (Line In -> Line Out). So this path at least works.

kkady32 01-06-2013 10:08 AM

ok,then use alsamixer and see with F4 when the capture is enabled

kkady32 01-06-2013 10:10 AM

and after use to try recording:
Code:

arecord -d 5 test.wav
and to play
Code:

aplay test.wav

stf92 01-06-2013 10:29 AM

I hear noise. Now, I have 'Capture' and 'Capture 1' in alsamixer. I raised both to 100%.

stf92 01-06-2013 10:37 AM

How silly. There is 'Input Source' control in alsamixer (capture view)! I set it to Line. And voila. Thanks a lot, kkady32. I cannot mark 'solved' because still persistence across reboots pending. I could not have done without your help.

kkady32 01-06-2013 10:41 AM

ok,but they are enabled?must appear write with red color under scale (L CAPTURE R)
you can anable with backspace

kkady32 01-06-2013 10:42 AM

ok and now with alsactl store you cannot save the settings?

stf92 01-06-2013 10:54 AM

I can. I rebooted to see. And 'alsactl store' really stored the settings. Could you tell what's the man page that speaks about /etc/modprobe.d/alsa.conf?

kkady32 01-06-2013 11:22 AM

here is man page for modprobe.d,not for /etc/modprobe/alsa.conf
you can rename alsa.conf with name.conf,important is to have a file with .conf extension
when you have mic noise then you can use this :
Code:

options snd_hda_intel model=auto position_fix=3

stf92 01-06-2013 11:36 AM

Here too. Thanks. About mic noise I heard that advice but did not take notice of it as in /usr/src/linux-3.2.29/Documentation/sound/alsa/HD-Audio.txt says:

Code:

DMA-Position Problem
~~~~~~~~~~~~~~~~~~~~
The most common problem of the controller is the inaccurate DMA
pointer reporting.  The DMA pointer for playback and capture can be
read in two ways, either via a LPIB register or via a position-buffer
map.  As default the driver tries to read from the io-mapped
position-buffer, and falls back to LPIB if the position-buffer appears
dead.  However, this detection isn't perfect on some devices.  In such
a case, you can change the default method via `position_fix` option.

`position_fix=1` means to use LPIB method explicitly.
`position_fix=2` means to use the position-buffer.
`position_fix=3` means to use a combination of both methods, needed
for some VIA and ATI controllers.  0 is the default value for all other
controllers, the automatic check and fallback to LPIB as described in
the above.  If you get a problem of repeated sounds, this option might
help.

I presume it's speaking about dinamic memory alocation (DMA).


All times are GMT -5. The time now is 02:08 AM.