Ticket #78 (closed defect: fixed)

Opened 2 years ago

Last modified 4 weeks ago

Allow configuration of ALSA mixer device

Reported by: coling Assigned to: lennart
Priority: low Milestone:
Component: daemon Severity: normal
Keywords: Cc:

Description

Hi,

I've been having problems with pulseaudio and volume controls on my laptop. It seems other users are also affected. See this Ubuntu bug (I'm a Mandriva dev but not filed a bug for this yet seeing as it's upstream!).

When I use the volume up/down keys on my keyboard or on my laptop, Gnome usually controls the Master (this is configured in gnome-sound-properties). This works fine. When I run pulseaudio however, this changes and it now controls PCM rather than Master which has no real affect on the sound levels (or so it seems).

I've patched pulseaudio (trunk/src/modules/module-alsa-sink.c) to use Master then PCM and all is well on my system.

I'm guessing that this needs to be a configuration option.

I'll attach my patch but more feedback on this "issue" would be appreciated.

Attachments

pulseaudio-0.9.5-use-master.patch (487 bytes) - added by coling on 04/24/07 10:18:38.
Use Master over PCM.…
module-alsa-sink.diff (0.9 kB) - added by koct9i on 12/16/07 14:26:56.
add mixer_channel option

Change History

04/24/07 10:18:38 changed by coling

  • attachment pulseaudio-0.9.5-use-master.patch added.

Use Master over PCM....

05/23/07 02:13:45 changed by lennart

  • priority changed from normal to low.
  • status changed from new to assigned.
  • type changed from defect to enhancement.

Hmm. I wonder if we really should work around a kernel driver bug like this in PA.

Our top priority for PA is to work out-of-the-box without manual configuration. Adding kludges to PA which are enabled manually on a per-case basis is not an option. The right place to fix this is the kernel driver. Please post a bug upstream and ask there for a fix.

I'd prefer it if the kernel driver could be fixed to not show the PCM track in the mixer if it doesn't work.

Nonetheless, I will leave this bug open. Feel free to supply a patch that makes this configurable. (Just swapping the default from PCM to Master is not good for merging)

06/06/07 12:43:15 changed by coling

Sorry didn't notice this reply as I didn't get an email about it :(

I'm not sure that PCM doesn't work at all. I'm pretty sure that without PA running PCM works OK, but with PA running it has no effect.

I'll do some test later when I get a mo' and report back.

I see a lot of programs allow you to change the mixer you use so I guess this is a semi-frequent issue, tho' will confess to knowing very little about it!

Cheers

08/26/07 04:21:50 changed by lennart

OK, I've discussed this with Takashi Iwai from ALSA. He's working on making sure that there is always a "Master" volume control available and also told me to use it instead of PCM.

In the "lennart" branch in SVN PA now looks first for Master and falls back to PCM afterwards. This should be more compatible with your setup and is future-proof.

09/22/07 16:53:36 changed by lennart

  • milestone set to 0.9.7.

10/30/07 15:02:17 changed by lennart

  • status changed from assigned to closed.
  • resolution set to fixed.

PA from SVN now prefers "Master" over "PCM".

12/16/07 14:26:56 changed by koct9i

  • attachment module-alsa-sink.diff added.

add mixer_channel option

12/16/07 14:29:44 changed by koct9i

hard coded mixer channels names sux, particularly on strange notebooks

10/12/08 12:52:08 changed by pibis

Did the mixer_channel option patch get into the upstream? I have the Dell Inspiron e1705 with HDA Intel (STAX9200). It's 2.1 and Mixer handles only the front speakers. I need PulseAudio to use PCM mixer channel to tune both Front and LFE.

Under current Gentoo stable release (0.9.9) this does not work as expected. And setting module-alsa-sink device_id=0 mixer_channel=PCM results in "E: module-alsa-sink.c: Failed to parse module arguments"

10/13/08 02:19:40 changed by pibis

  • status changed from closed to reopened.
  • type changed from enhancement to defect.
  • resolution deleted.
  • milestone deleted.

I'm re-openning this ticket, as I had lots of trouble now, caused by this issue. My system:

  • Dell Inspiron e1705
  • Gentoo Linux 2.6.26-r1
  • Intel-HDA (STAX9200)
  • USB Headset
  • pulseaudio 0.9.13

As I have written in above post, this laptop has 3 speakers - two front and LFE, but they are recognized as 2 channels. Master mixer control changes volume of front speakers but does not influence LFE. PCM mixer control changes speakers and LFE.

I have applied the mixer_channel patch myself to 0.9.13 version, and it worked fine, apart from the fact that I could no longer use module-hal-detect, as I needed to put mixer_channel on load-module module-alsa-sink. This resulted with my being unable to hotplug an USB Headset, which is kind of pathetic.

It would be nice if I could set default_mixer_channel in pulse-daemon.conf, be able to specify it on a per-card basis or at least if module-hal-autodetect would ignore devices already added with module-alsa-sink.

Is there any additional data necessary?

10/13/08 02:42:52 changed by coling

The fact that you explain that it needs to be done on a per-card basis really highlights that this is an inconsistency in how things are handled at the alsa level. IMO this has to be fixed at the alsa level and adding in complex work arounds and hacks in the auto-detection system in pulse is really not the right place to fix things.

10/13/08 07:32:33 changed by pibis

Thanks for your reply.

I'm pretty much certain, that you're the person more familiar with alsa development routines, however I have a strange feeling that this is a "wontfix" in ALSA project. GNOME has recently made a dropdown available in their Sound Preferences to allow adjusting any mixer control on any card with keyboard multimedia buttons. Before that they were bound to Master, just as pulseaudio is.

What I'm just trying to say here is that I need just ANY way of changing that channel (be it programatic or compiler switch) other than manually patching the code targeted for my platform. From my point of view, the fix here is actually doing the opposite than intented.

(follow-up: ↓ 12 ) 10/13/08 10:55:55 changed by coling

Well, I wouldn't say I am more familiar with the dev routines of ALSA. Certainly not in this specific case.

I'll leave it to Lennart to comment authoritatively on this matter. As there are three channels, I presume you've set default-sample-channels = 3 in your daemon.conf?

(in reply to: ↑ 11 ) 10/13/08 13:03:41 changed by pibis

Replying to coling:

I'll leave it to Lennart to comment authoritatively on this matter. As there are three channels, I presume you've set default-sample-channels = 3 in your daemon.conf?

Oh, You can trust me on that. I have tried all the numbers there, from 2 to 6 and three distinct pulseaudio build from 0.9.9 to 0.9.13.

That would be a "yes". But pulseaudio keeps downgrading the device to 2 channels saying that my device ain't capable of 3. I have learned that however my speaker setup is 2.1, the output accepted is 2.0 and internal remixing is done for the LFE.

The card is also capable of SPDIF output via SVideo, but only for digital sound and DVDs. No 5.1 gaming.

10/25/08 01:41:21 changed by lennart

Really, ALSA needs to fix the mixer controls for your device. I am not adding ugly kludges to work around this issue if the proper place is to fix the ALSA mixer for your device.

Please bring this up on the ALSA ML. They need to export the surround volume controls as a single element, not three.

10/25/08 01:50:04 changed by lennart

  • status changed from reopened to closed.
  • resolution set to fixed.

10/25/08 01:51:28 changed by pibis

Um, I'm not really an expert on the issue, and you're probably right, but I would only like to emphasise, that PCM does control both front speakers and LFE on my device. And that this was working perfectly for me, prior to the "fix" here.

Anyway, I'll follow your recommendation OFC and write to ALSA ML.

10/25/08 01:54:39 changed by lennart