LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Problems with Alsa (I think) (14.1 x64, kernel 3.13.0) (https://www.linuxquestions.org/questions/slackware-14/problems-with-alsa-i-think-14-1-x64-kernel-3-13-0-a-4175492800/)

spudgunner 01-27-2014 07:57 PM

Problems with Alsa (I think) (14.1 x64, kernel 3.13.0)
 
So I've been battling to get a functional XBMC server working, and I've hit my second roadblock with sound.

My sound doesn't work through HDMI by default. So I compiled kernel 3.13.0 to get that working and now my (minor) problem is that it's muted when my system starts. It seems that the ATI HDMI device lists a S/PDIF device, which can only either be muted (by default) or set to [00] (at which point sounds work). However, when I try to use programs to listen to music, they usually work but throw errors. Furthermore, on XBMC, I can watch certian movies, but others will cause my TV to pop up a message about incompatible PCM signals and then none of my sound will work again until I reboot.

I've been pulling my hair out, going through docs.slackware.org stuff and other things (mostly help stuff from Arch Linux, limited help from XBMC sources but nothing concrete) without success. Anyone have any tips for me?

Thanks.

EDIT: I dug up a pdf of the manual for my TV... turns out it basically supports nothing but PCM, so I fixed that in XBMC. How, errors I get while trying to play music (which doesn't play as of now) throw errors like ALSA error: : No suitable mixer element found, ALSA error: snd_mixer_find_selem failed, and ALSA error: snd_pcm_open failed: No such file or directory

ReaperX7 01-27-2014 09:07 PM

Can you run:

Code:

cat /proc/asound/cards
and post the results?

/dev/random 01-27-2014 09:14 PM

Quote:

Originally Posted by spudgunner (Post 5106448)
So I've been battling to get a functional XBMC server working, and I've hit my second roadblock with sound.

My sound doesn't work through HDMI by default. So I compiled kernel 3.13.0

Did you compile the drivers into the kernel or did you recompile them as modules?
It looks to me that you forgot to compile the sound modules for that card.

Please post the relivent portion of lspci -vv and cat /usr/src/linux/.config

spudgunner 01-28-2014 07:28 AM

@ReaperX7: As requested

cat /proc/asound/cards
Code:

0 [HDMI          ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xfef44000 irq 42
 1 [Generic        ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xfef40000 irq 16

@/dev/random: As requested

(Hopefully) Relevant portions of lspci -vv
Code:

00:01.1 Audio device: AMD/ATI [Advanced Micro Devices, Inc.] Trinity HDMI Audio Controller
        Subsystem: AMD/ATI [Advanced Micro Devices, Inc.] Trinity HDMI Audio Controller
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin B routed to IRQ 42
        Region 0: Memory at fef44000 (32-bit, non-prefetchable) [size=16K]
        Capabilities: <access denied>
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel

...

00:14.2 Audio device: AMD [Advanced Micro Devices, Inc.] FCH Azalia Controller (rev 01)
        Subsystem: Gigabyte Technology Co., Ltd Device a002
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 32, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 16
        Region 0: Memory at fef40000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: <access denied>
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel

(Hopefully) Relevant portion of my config file:
Code:

CONFIG_SND_HDA_INTEL=m
CONFIG_SND_HDA_DSP_LOADER=y
CONFIG_SND_HDA_PREALLOC_SIZE=2048
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_RECONFIG=y
# CONFIG_SND_HDA_INPUT_BEEP is not set
CONFIG_SND_HDA_INPUT_JACK=y
CONFIG_SND_HDA_PATCH_LOADER=y
CONFIG_SND_HDA_CODEC_REALTEK=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
CONFIG_SND_HDA_CODEC_HDMI=y
CONFIG_SND_HDA_I915=y
CONFIG_SND_HDA_CODEC_CIRRUS=y
CONFIG_SND_HDA_CODEC_CONEXANT=y
CONFIG_SND_HDA_CODEC_CA0110=y
CONFIG_SND_HDA_CODEC_CA0132=y
CONFIG_SND_HDA_CODEC_CA0132_DSP=y
CONFIG_SND_HDA_CODEC_CMEDIA=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0


mlpa 01-28-2014 08:33 AM

Every time I need sound in the HDMI interface I have to activate a switch in xfce-mixer (IEC958).
After that I can redirect the sound through the HDMI interface.

Hope it helps.

ReaperX7 01-28-2014 10:08 PM

You may also want to setup an alsa module.conf file and a user .asoundrc profile to default the audio to your HDA codec and not the HDMI.

/dev/random 01-28-2014 11:32 PM

By any chance does this HTPC you are building have a integrated sound card? if so find the module it is using and black list it.

ReaperX7 01-28-2014 11:42 PM

If he Blacklists it, since he's using HDMI, it would Blacklist the snd-intel-hda module which would diable both sound cards. He needs to setup his device controls actually since he's using this method.

Correction on my last reply regarding which audio device to default to.

As far as a mixer issue. Alsa uses dmix, so you may need to check the alsa utilities packages that handle dmix.

spudgunner 01-29-2014 07:31 AM

Blacklisting the module definitely doesn't work, I've already tried that.

I haven't fooled around with it much since I got XBMC working correctly, but here's a couple more pieces of info that may be of use:

(1) At one point I tried editing /usr/share/alsa/alsa.conf, and I changed the line

Code:

defaults.pcm.device 0
to

Code:

defaults.pcm.device 3
(due to what running aplay -l tells me about my devices) and I was able to adjust the volume of the HDMI PCM device via alsamixer (whereas before, it's only set to MM or 00). However, this didn't appear to do anything for me, so I switched to back to try to keep as much as possible at default values to isolate my problems.

(2) I have tried defining a default device in /etc/asound.conf but then I cannot use alsamixer at all (but the sound does work), I'll confirm tonight with music players still give me error messages with this setting.

(3) When I boot my computer or restart ALSA, sometimes I get the following message:

Code:

/usr/sbin/alsactl: set_control:1452: control.7.value.2 is not specified
/usr/sbin/alsactl: set_control:1452: control.7.value.3 is not specified
/usr/sbin/alsactl: set_control:1452: control.7.value.4 is not specified
/usr/sbin/alsactl: set_control:1452: control.7.value.5 is not specified
/usr/sbin/alsactl: set_control:1452: control.7.value.6 is not specified
/usr/sbin/alsactl: set_control:1452: control.7.value.7 is not specified

I know it comes up when I set the default device in /etc/asound.conf, and it may or may not come up if I make the change listed in (1). (I never did establish that pattern, but luckily I have time tonight to keep trying to diagnose the problems and work through them). I don't know what the above messages mean, but it almost looks to me as if it's trying to do something with multiple audio channels and failing.

Hopefully this info may be able to lead you guys in the right direction.

55020 01-29-2014 08:28 AM

This just popped up in the changelog for kernel 3.13.1, which is just out:

Quote:

David Henningsson (1):
ALSA: hda - Explicitly keep codec powered up in hdmi_present_sense
Worth a try...?

spudgunner 01-29-2014 09:20 AM

Quote:

Originally Posted by 55020 (Post 5107474)
This just popped up in the changelog for kernel 3.13.1, which is just out:



Worth a try...?

Might as well, can't hurt anything. I can compile it now (ssh in from work) but I won't be able to test it out until I get home tonight.

enorbet 01-29-2014 09:43 AM

Greetings
It is my understanding and experience that blacklisting is only good if you never want to use a secondary card for a secondary purpose. I can't tell you exactly how you should do this on your system but I can give you an example of how I do it on mine.

I have 3 sound devices - an onboard Realtek ACL898 Codec, an Intel-hda-hdmi, and a discrete Esi Juli@ semi-pro recording quality card based on Ice1724. Since at this time I have no plans to use the HDMI output, it is blacklisted.
BUT
I prefer to use the onboard capture for network/speech usage, such as Skype, TeamSpeak, etc but never use it for music recording. To accomplish this I had to make a $HOME/.asoundrc shown here

Code:

pcm.!default {                        # declare the default PCM device

        type asym                      # combine playback and capture devices

        playback.pcm {                ### Playback object ###
                type plug              # convert audio to mixer format
                slave.pcm {
                        type dmix      # mix multiple audio streams
                        ipc_key 6969  # shared memory key; must be unique
                        ipc_key_add_uid true      # add UID to shared mem key
                        ipc_perm 0600            # shared mem file permissions
                        slave {
                                pcm {
                                  type hw        # define the playback hardware
                                  card "Ice1724"  # playback card name
                                  device 0      # playback device on that card
                                }
                                format S16_LE    # bits per sample format
                                rate 44100        # samples per second
                                channels 2        # number of audio channels
                        }
                }
        }

        capture.pcm {                  ### Capture object ###
                type plug              # convert audio format from the hardware
                slave {
                        pcm {
                                type hw        # define the capture hardware
                                card "Intel"      # capture card name
                                device 0      # capture device on that card
                        }
                }
        }
}

Presently, I load the Ice1724 capture for recording manually only because I rarely use "Microphone In" for music recording since usually I am inputting at Line Level from a standalone mixer. On the rare occasion that I use the "Mic In" I need to walk through a routine checklist so I KNOW it is on and onboard is off, not left to assume software did it properly. Psychological I suppose, but necessary nonetheless for me. Not a recommendation, just mentioned for clarity sake. This just works for me.

Hope this helps you find yours.

spudgunner 01-30-2014 07:19 AM

Wow, that situation is far more complicated than mine is. However, I will play around with some of the things you've presented here. Does they ipc_key have to be any particular number or is it just a random, made-up number? And I'm assuming you are able to adjust the volume on multiple audio channels via alsamixer with that configuration?

rvdboom 01-30-2014 12:34 PM

Quote:

Originally Posted by spudgunner (Post 5107435)
(1) At one point I tried editing /usr/share/alsa/alsa.conf, and I changed the line

Code:

defaults.pcm.device 0
to

Code:

defaults.pcm.device 3
(due to what running aplay -l tells me about my devices) and I was able to adjust the volume of the HDMI PCM device via alsamixer (whereas before, it's only set to MM or 00). However, this didn't appear to do anything for me, so I switched to back to try to keep as much as possible at default values to isolate my problems.

Try with card instead.
I have some issues with AMD audio too. When I run "aplay -l", I get :

Code:

bash-4.2$ aplay -l
**** Liste des Périphériques Matériels PLAYBACK ****
carte 0: Generic [HD-Audio Generic], périphérique 3: ID aa01 Digital [ID aa01 Digital]
  Sous-périphériques: 1/1
  Sous-périphérique #0: subdevice #0
carte 1: Generic_1 [HD-Audio Generic], périphérique 0: ALC887-VD Analog [ALC887-VD Analog]
  Sous-périphériques: 0/1
  Sous-périphérique #0: subdevice #0
bash-4.2$


I've put the following in /etc/asound.conf :

Code:

defaults.ctl.card 1
defaults.pcm.card 1
defaults.timer.card 1

Now I get sound in every application though I can't manage to have two applications accessing the audio device, while I could before.
Kmix is also not displaying the proper mixing channels, but that seems to be a bug in current kmix as the HDMI and Analog audio have the same name. alsamixer works fine though.
This is really quite a mess.

spudgunner 03-21-2014 07:37 PM

First off, sorry to revive a dead thread (and sorry for leaving you all hanging).

I had it somewhat working, as in I could hear audio but I had no volume control or no individual channel control in alsamixer. But it was working well enough for what I needed it for, so I gave up in trying to make it better because I was frustrated.

Fast forward to today: the power was cut to my machine and when I booted it back up audio was again not working. I can't remember my somewhat solution and I've tried lots of asound.conf stuff but nothing is working for me. So currently, I have a S/PDIF channel that defaults to mute and only goes to 00 if it's not muted. When I unmute and test with aplay -D, I get a static sound.

So (since I never had it working quite right to begin with anyways), please try to help me once again.

Thanks.


All times are GMT -5. The time now is 12:34 AM.