Problem with audio apps and mixer

View: New views
6 Messages — Rating Filter:   Alert me  

Problem with audio apps and mixer

by Alexander Best :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi there,

i've never had a problem to adjust the volume with audio apps like mplayer or
mpd. recently however i'm experiencing this strange behaviour. the app's
volume doesn't match the volume that `mixer` reports. here's an example:

`mpc`:

J.R.R. Tolkien -
[playing] #2/19   1:54/3:06 (61%)
volume: 45%   repeat: off   random: off

`mixer`:

Mixer vol      is currently set to  40:40
Mixer pcm      is currently set to  70:70
Mixer speaker  is currently set to  75:75
Mixer line     is currently set to  75:75
Mixer mic      is currently set to   0:0
Mixer mix      is currently set to   0:0
Mixer rec      is currently set to   0:0
Recording source: mic

if i adjust the volume in mplayer or mpd the volume DOES get increased, but
the mixer settings don't change. after a song change or pausing a video
however the volume settings get reset to the previous settings. here's an
example:

[arundel@arundel - 02:51 pm] mpc
J.R.R. Tolkien -
[playing] #5/19   3:01/6:23 (47%)
volume: 45%   repeat: off   random: off
[arundel@arundel - 02:51 pm] mpc volume 60
J.R.R. Tolkien -
[playing] #5/19   3:05/6:23 (48%)
volume: 60%   repeat: off   random: off
[arundel@arundel - 02:51 pm] mixer
Mixer vol      is currently set to  40:40
Mixer pcm      is currently set to  70:70
Mixer speaker  is currently set to  75:75
Mixer line     is currently set to  75:75
Mixer mic      is currently set to   0:0
Mixer mix      is currently set to   0:0
Mixer rec      is currently set to   0:0
Recording source: mic
[arundel@arundel - 02:51 pm] mpc pause
J.R.R. Tolkien -
[paused]  #5/19   3:10/6:23 (50%)
volume: 70%   repeat: off   random: off
[arundel@arundel - 02:51 pm] mpc play
J.R.R. Tolkien -
[playing] #5/19   3:11/6:23 (50%)
volume: 45%   repeat: off   random: off

it seems the apps don't actually access /dev/mixer, but instead use an
internal volume setting. i had a look at /dev and this is the output of
`ls|grep mixer`:

mixer0
mixer1
mixer2

i thought maybe i need to create a symlink from mixer0 to mixer, but that
doesn't work:

ln: mixer: File exists

i haven't changed mplayer's of mpd's settings in years, so this seems to be a
freebsd problem.

i'm running r195247 (HEAD). this is the output of `cat /dev/sndstat`:

FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
Installed devices:
pcm0: <HDA Realtek ALC885 PCM #0 Analog> at cad 2 nid 1 on hdac0  [MPSAFE]
(1p:4v/1r:4v channels duplex default)
pcm1: <HDA Realtek ALC885 PCM #1 Analog> at cad 2 nid 1 on hdac0  [MPSAFE]
(1p:1v/1r:1v channels duplex)
pcm2: <HDA Realtek ALC885 PCM #2 Digital> at cad 2 nid 1 on hdac0  [MPSAFE]
(1p:1v/1r:1v channels duplex)

cheers.
alex
_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."

Re: Problem with audio apps and mixer

by Paul B Mahol :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 7/3/09, Alexander Best <alexbestms@...> wrote:
> hi there,
>
> i've never had a problem to adjust the volume with audio apps like mplayer
> or
> mpd. recently however i'm experiencing this strange behaviour. the app's
> volume doesn't match the volume that `mixer` reports. here's an example:

CURRENT have VPC.
You can completly disable such feature with this sysctl:
hint.pcm.X.vpc (default=undefined, enabled)
            0=disable, 1=enable
            Notes: The only place to enable/disable vpc.
                   Enabling/Disabling requires driver reload.

here is explanation with more details:
http://people.freebsd.org/~ariff/SOUND_4.TXT.html

--
Paul
_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."

Re: Problem with audio apps and mixer

by Alexander Best :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

wow. thanks a bunch. this new feature of having each app use it's own volume
setting is pretty cool. however i think i'd like to preserve the volume
setting for each application and rather not have it reset. because i think
this feature takes the pid of the app and preserves the volume for the pid.
mplayer and mpd however seem to fork a new instance after a song change or
pausing etc. so so the volume get's reset while the app is still running.

i might be wrong, but i think there's a typo in this description of the
feature i'm looking for:

        hw.snd.vpc_autoreset (default=1, enabled)
            0=disable, 1=enable
            Notes: By default, channel volume will be reset to 0db
                   relative after the channel is closed which means that any
                   changes will be lost and not preserved. Setting this to '1'
                   will preserve the volume at the cost of possible confusion
                   for other applications trying to re-open the same
                   device (see hw.snd.vpc_reset for possible 'panic' switch to
                   fix the volumes).

shouldn't it be:

        hw.snd.vpc_autoreset (default=1, enabled)
            0=disable, 1=enable
            Notes: By default, channel volume will be reset to 0db
                   relative after the channel is closed which means that any
                   changes will be lost and not preserved. Setting this to '0'
                   will preserve the volume at the cost of possible confusion
                   for other applications trying to re-open the same
                   device (see hw.snd.vpc_reset for possible 'panic' switch to
                   fix the volumes).

????

so after settings hw.snd.vpc_autoreset=0 each application uses it's own volume
setting AND preserves it. just what i wanted. even better because i didn't
know this cool new feature existed. :)

thanks again for the hint.

cheers.
alex

Paul B. Mahol schrieb am 2009-07-03:
> On 7/3/09, Alexander Best <alexbestms@...> wrote:
> > hi there,

> > i've never had a problem to adjust the volume with audio apps like
> > mplayer
> > or
> > mpd. recently however i'm experiencing this strange behaviour. the
> > app's
> > volume doesn't match the volume that `mixer` reports. here's an
> > example:

> CURRENT have VPC.
> You can completly disable such feature with this sysctl:
> hint.pcm.X.vpc (default=undefined, enabled)
>             0=disable, 1=enable
>             Notes: The only place to enable/disable vpc.
>                    Enabling/Disabling requires driver reload.

> here is explanation with more details:
> http://people.freebsd.org/~ariff/SOUND_4.TXT.html

_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."

Re: Problem with audio apps and mixer

by Ariff Abdullah-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 03 Jul 2009 16:12:07 +0200 (CEST)
Alexander Best <alexbestms@...> wrote:
[...]
>
> shouldn't it be:
>
>         hw.snd.vpc_autoreset (default=1, enabled)
>             0=disable, 1=enable
>             Notes: By default, channel volume will be reset to 0db
>                    relative after the channel is closed which means
>                    that any changes will be lost and not preserved.
>                    Setting this to '0' will preserve the volume at
                                     ^^^
>                    the cost of possible confusion for other
>                    applications trying to re-open the same device
>                    (see hw.snd.vpc_reset for possible 'panic' switch
>                    to fix the volumes).
>

Good catch, thanks :)

Fixed.

--
Ariff Abdullah
FreeBSD

... Recording in stereo is obviously too advanced
    and confusing for us idiot ***** users :P ........

... Going with the standard and orthodox
    is the death of intellect ..............


attachment0 (202 bytes) Download Attachment

Re: Problem with audio apps and mixer

by Paul B Mahol :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 7/3/09, Alexander Best <alexbestms@...> wrote:
> wow. thanks a bunch. this new feature of having each app use it's own volume
> setting is pretty cool. however i think i'd like to preserve the volume
> setting for each application and rather not have it reset. because i think
> this feature takes the pid of the app and preserves the volume for the pid.

Negative. Same application can open and close (different) channel(s) multiple
times causing volume to be changed. You can get some patches on freebsd forums
for mplayer and others ...

> mplayer and mpd however seem to fork a new instance after a song change or
> pausing etc. so so the volume get's reset while the app is still running.

Nope, there is no *forking*.

> i might be wrong, but i think there's a typo in this description of the
> feature i'm looking for:
>
>         hw.snd.vpc_autoreset (default=1, enabled)
>             0=disable, 1=enable
>             Notes: By default, channel volume will be reset to 0db
>                    relative after the channel is closed which means that any
>                    changes will be lost and not preserved. Setting this to
> '1'
>                    will preserve the volume at the cost of possible
> confusion
>                    for other applications trying to re-open the same
>                    device (see hw.snd.vpc_reset for possible 'panic' switch
> to
>                    fix the volumes).
>
> shouldn't it be:
>
>         hw.snd.vpc_autoreset (default=1, enabled)
>             0=disable, 1=enable
>             Notes: By default, channel volume will be reset to 0db
>                    relative after the channel is closed which means that any
>                    changes will be lost and not preserved. Setting this to
> '0'
>                    will preserve the volume at the cost of possible
> confusion
>                    for other applications trying to re-open the same
>                    device (see hw.snd.vpc_reset for possible 'panic' switch
> to
>                    fix the volumes).
>
> ????
>
> so after settings hw.snd.vpc_autoreset=0 each application uses it's own
> volume
> setting AND preserves it. just what i wanted. even better because i didn't
> know this cool new feature existed. :)

Doesn't work as expected because if you use multiple applications at same time
silenced channel may and may not become extremly noise at any time - this is
OSS and not FreeBSD fault and it is implemented as is in many if not all
multimedia applications; so you may look again in freebsd forums and use
ariff@ patch for mplayer. I don't remmember there was patch for mpd, but you
can always ask politely.

> thanks again for the hint.
>
> cheers.
> alex
>
> Paul B. Mahol schrieb am 2009-07-03:
>> On 7/3/09, Alexander Best <alexbestms@...> wrote:
>> > hi there,
>
>> > i've never had a problem to adjust the volume with audio apps like
>> > mplayer
>> > or
>> > mpd. recently however i'm experiencing this strange behaviour. the
>> > app's
>> > volume doesn't match the volume that `mixer` reports. here's an
>> > example:
>
>> CURRENT have VPC.
>> You can completly disable such feature with this sysctl:
>> hint.pcm.X.vpc (default=undefined, enabled)
>>             0=disable, 1=enable
>>             Notes: The only place to enable/disable vpc.
>>                    Enabling/Disabling requires driver reload.
>
>> here is explanation with more details:
>> http://people.freebsd.org/~ariff/SOUND_4.TXT.html
>
>


--
Paul
_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."

Re: Problem with audio apps and mixer

by Alexander Best :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

thanks a bunch for all the great info.

alex

Paul B. Mahol schrieb am 2009-07-03:
> On 7/3/09, Alexander Best <alexbestms@...> wrote:
> > wow. thanks a bunch. this new feature of having each app use it's
> > own volume
> > setting is pretty cool. however i think i'd like to preserve the
> > volume
> > setting for each application and rather not have it reset. because
> > i think
> > this feature takes the pid of the app and preserves the volume for
> > the pid.

> Negative. Same application can open and close (different) channel(s)
> multiple
> times causing volume to be changed. You can get some patches on
> freebsd forums
> for mplayer and others ...

> > mplayer and mpd however seem to fork a new instance after a song
> > change or
> > pausing etc. so so the volume get's reset while the app is still
> > running.

> Nope, there is no *forking*.

> > i might be wrong, but i think there's a typo in this description of
> > the
> > feature i'm looking for:

> >         hw.snd.vpc_autoreset (default=1, enabled)
> >             0=disable, 1=enable
> >             Notes: By default, channel volume will be reset to 0db
> >                    relative after the channel is closed which means
> >                    that any
> >                    changes will be lost and not preserved. Setting
> >                    this to
> > '1'
> >                    will preserve the volume at the cost of possible
> > confusion
> >                    for other applications trying to re-open the
> >                    same
> >                    device (see hw.snd.vpc_reset for possible
> >                    'panic' switch
> > to
> >                    fix the volumes).

> > shouldn't it be:

> >         hw.snd.vpc_autoreset (default=1, enabled)
> >             0=disable, 1=enable
> >             Notes: By default, channel volume will be reset to 0db
> >                    relative after the channel is closed which means
> >                    that any
> >                    changes will be lost and not preserved. Setting
> >                    this to
> > '0'
> >                    will preserve the volume at the cost of possible
> > confusion
> >                    for other applications trying to re-open the
> >                    same
> >                    device (see hw.snd.vpc_reset for possible
> >                    'panic' switch
> > to
> >                    fix the volumes).

> > ????

> > so after settings hw.snd.vpc_autoreset=0 each application uses it's
> > own
> > volume
> > setting AND preserves it. just what i wanted. even better because i
> > didn't
> > know this cool new feature existed. :)

> Doesn't work as expected because if you use multiple applications at
> same time
> silenced channel may and may not become extremly noise at any time -
> this is
> OSS and not FreeBSD fault and it is implemented as is in many if not
> all
> multimedia applications; so you may look again in freebsd forums and
> use
> ariff@ patch for mplayer. I don't remmember there was patch for mpd,
> but you
> can always ask politely.

> > thanks again for the hint.

> > cheers.
> > alex

> > Paul B. Mahol schrieb am 2009-07-03:
> >> On 7/3/09, Alexander Best <alexbestms@...> wrote:
> >> > hi there,

> >> > i've never had a problem to adjust the volume with audio apps
> >> > like
> >> > mplayer
> >> > or
> >> > mpd. recently however i'm experiencing this strange behaviour.
> >> > the
> >> > app's
> >> > volume doesn't match the volume that `mixer` reports. here's an
> >> > example:

> >> CURRENT have VPC.
> >> You can completly disable such feature with this sysctl:
> >> hint.pcm.X.vpc (default=undefined, enabled)
> >>             0=disable, 1=enable
> >>             Notes: The only place to enable/disable vpc.
> >>                    Enabling/Disabling requires driver reload.

> >> here is explanation with more details:
> >> http://people.freebsd.org/~ariff/SOUND_4.TXT.html




_______________________________________________
freebsd-questions@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@..."