You are not logged in.

#1 2009-10-18 16:31:07

soupcan
Member
From: ?
Registered: 2008-10-25
Posts: 268

MPlayer does not respond to ALSA PCM volume setting

As above. I use extra keyboard keys mapped to "amixer -q set PCM 2dB+-" control volume. This works for all programs except MPlayer. MPlayer only responds to changes in Master volume; it also "locks" ALSA- when I play a movie, nothing else can use my speakers. I'd like to know if there is a way to make MPlayer use PCM instead of Master.

Offline

#2 2009-10-18 22:30:52

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: MPlayer does not respond to ALSA PCM volume setting

soupcan wrote:

As above. I use extra keyboard keys mapped to "amixer -q set PCM 2dB+-" control volume. This works for all programs except MPlayer. MPlayer only responds to changes in Master volume; it also "locks" ALSA- when I play a movie, nothing else can use my speakers. I'd like to know if there is a way to make MPlayer use PCM instead of Master.

Have you checked into mplayer's mixer options?


Knute

Offline

#3 2009-10-18 23:08:03

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: MPlayer does not respond to ALSA PCM volume setting

Knute wrote:
soupcan wrote:

As above. I use extra keyboard keys mapped to "amixer -q set PCM 2dB+-" control volume. This works for all programs except MPlayer. MPlayer only responds to changes in Master volume; it also "locks" ALSA- when I play a movie, nothing else can use my speakers. I'd like to know if there is a way to make MPlayer use PCM instead of Master.

Have you checked into mplayer's mixer options?

Like this?

man mplayer wrote:

-mixer-channel <mixer line>[,mixer index] (-ao oss and -ao alsa only)
              This option will tell MPlayer to use a different  channel  for  controlling  volume
              than the default PCM.  Options for OSS include vol, pcm, line.  For a complete list
              of options look for SOUND_DEVICE_NAMES in /usr/include/linux/soundcard.h.  For ALSA
              you can use the names e.g. alsamixer displays, like Master, Line, PCM.
              NOTE:  ALSA  mixer  channel  names  followed  by  a number must be specified in the
              <name,number> format, i.e. a channel labeled 'PCM 1' in alsamixer must be converted
              to PCM,1.

Offline

#4 2009-10-19 00:23:53

soupcan
Member
From: ?
Registered: 2008-10-25
Posts: 268

Re: MPlayer does not respond to ALSA PCM volume setting

skottish wrote:
Knute wrote:
soupcan wrote:

As above. I use extra keyboard keys mapped to "amixer -q set PCM 2dB+-" control volume. This works for all programs except MPlayer. MPlayer only responds to changes in Master volume; it also "locks" ALSA- when I play a movie, nothing else can use my speakers. I'd like to know if there is a way to make MPlayer use PCM instead of Master.

Have you checked into mplayer's mixer options?

Like this?

man mplayer wrote:

-mixer-channel <mixer line>[,mixer index] (-ao oss and -ao alsa only)
              This option will tell MPlayer to use a different  channel  for  controlling  volume
              than the default PCM.  Options for OSS include vol, pcm, line.  For a complete list
              of options look for SOUND_DEVICE_NAMES in /usr/include/linux/soundcard.h.  For ALSA
              you can use the names e.g. alsamixer displays, like Master, Line, PCM.
              NOTE:  ALSA  mixer  channel  names  followed  by  a number must be specified in the
              <name,number> format, i.e. a channel labeled 'PCM 1' in alsamixer must be converted
              to PCM,1.

I tried playing a movie that way (mplayer ~/movies/foo -mixer-channel PCM) but it says "audio card does not have channel 'PCM', using default." I also tried PCM,1, pcm, pcm,1. What I'm really looking for is a way to use PCM by default.
EDIT: Disregard that. I didn't realize that I needed to add -ao alsa along with -mixer-channel. But part of my question still stands; can I make MPlayer do this by default?

Last edited by soupcan (2009-10-19 00:27:13)

Offline

#5 2009-10-19 00:59:48

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: MPlayer does not respond to ALSA PCM volume setting

Put any options that you want to be persistent a file ~/.mplayer/config. For instance, so I can use VDPAU by default, my file looks like this:

[default]

vo=vdpau:deint=4,xv,
vc=ffh264vdpau,ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,

The trailing commas are necessary so Mplayer can fall back on it's own options if needed. Hopefully this will get you started.

Offline

#6 2009-10-20 03:32:30

soupcan
Member
From: ?
Registered: 2008-10-25
Posts: 268

Re: MPlayer does not respond to ALSA PCM volume setting

skottish wrote:

Put any options that you want to be persistent a file ~/.mplayer/config. For instance, so I can use VDPAU by default, my file looks like this:

[default]

vo=vdpau:deint=4,xv,
vc=ffh264vdpau,ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,

The trailing commas are necessary so Mplayer can fall back on it's own options if needed. Hopefully this will get you started.

Perfect; this is exactly what I wanted. I modified my config to this (from a blank file?):

 ao=alsa,mixer-channel=PCM,

That seems to have done the trick.

Offline

Board footer

Powered by FluxBB