Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume control via mpc / ncmpc is often ignored #19

Open
retrofreak83 opened this issue Jun 21, 2019 · 8 comments
Open

Volume control via mpc / ncmpc is often ignored #19

retrofreak83 opened this issue Jun 21, 2019 · 8 comments

Comments

@retrofreak83
Copy link

I already wrote a forum query for this, but I didn't get any reaction. I still consider this a bug:
https://discourse.mopidy.com/t/volume-control-via-mpc-ncmpc-sometimes-is-ignored/3298

mopidy/stable,now 2.2.2-1 all
mopidy-alsamixer/stable 1.0.3-3 all

I use volume control via mpc from remote machines. I always send commands “volume -5” and “volume +5”. But sometimes, these commands seem to be ignored.
Even when I log in to the mopidy machine and try to control the volume via local ncmpc, volume control commands sometimes are ignored (I have alsamixer open in parallel to see if there are changes).
Also, what from my point of view really should’nt happen, is a misalignment between alsamixer’s volume and the volume reported by ncmpc. For example,
alsamixer says 76%, ncmpc says 84%.
I push the right cursor key for “louder” in ncmpc -> nothing happens.
I push it again -> nothing happens.
I push it a third time: the sound card as reported by alsamixer is spontaneously set to 80%, volume in ncmpc is reported to be 87%.
Iset the alsamixer min_/max_ volume values to 0 and 100, scale to linear, so there shouldn’t be problems.

To conclude, I see the following pattern:
For example, when repeatedly issuing “vol +”-commands, I see that a volume change is only applied every second/third time and then with 2 - 3% mostly.

Nevertheless, there is a discrepance between the volume percentage reported to mpd-clients (mpc / ncmpc) and the volume which is indeed set in alsamixer.

From my point of view, I consider this a bug. However, no error messages or warnings are logged in the mopidy log when controlling the volume.

@kingosticks kingosticks transferred this issue from mopidy/mopidy Jun 21, 2019
@retrofreak83
Copy link
Author

The issue is still there in mopidy 2.2.3 and mopidy-alsamixer 1.1.1.

@retrofreak83
Copy link
Author

The problem still persists... Is there any way I can further debug it?

@kingosticks
Copy link
Member

kingosticks commented Oct 11, 2019

Hi, really sorry for the lack of replies here. Any MPD volume commands that Mopidy receives will be logged so you can see Mopidy's response to them (I'm using the software mixer here).

INFO     2019-10-11 15:55:38,413 [24953:MpdSession-24] mopidy.mpd.session
  New MPD connection from [::ffff:127.0.0.1]:53170
DEBUG    2019-10-11 15:55:38,414 [24953:MpdSession-24] mopidy.mpd.session
  Request from [::ffff:127.0.0.1]:53170: volume "5"
DEBUG    2019-10-11 15:55:38,415 [24953:SoftwareMixer-1] mopidy.mixer
  Mixer event: volume_changed(volume=55)
DEBUG    2019-10-11 15:55:38,416 [24953:MpdSession-24] mopidy.mpd.session
  Response to [::ffff:127.0.0.1]:53170: OK
DEBUG    2019-10-11 15:55:38,416 [24953:SoftwareMixer-1] mopidy.listener
  Sending volume_changed to MixerListener: {'volume': 55}
DEBUG    2019-10-11 15:55:38,416 [24953:Core-14] mopidy.listener
  Sending volume_changed to CoreListener: {'volume': 55}

Run mopidy -v to see the debug logging.

The README for Mopidy-ALSAMixer states:

The cubic scale is the default as it is closer to how the human ear percieves volume, and matches the volume scale used in the alsamixer program

But you say you are using linear scale, right?

@retrofreak83
Copy link
Author

retrofreak83 commented Oct 12, 2019

I tried what you suggested. When I run mopidy in verbose mode, I see something like

DEBUG    2019-10-12 02:31:11,468 [943:MpdSession-43] mopidy.mpd.session
  Request from [[::ffff:192.168.120.160]:6600]: idle
DEBUG    2019-10-12 02:31:11,556 [943:MpdSession-43] mopidy.mpd.session
  Request from [[::ffff:192.168.120.160]:6600]: noidle
DEBUG    2019-10-12 02:31:11,557 [943:MpdSession-43] mopidy.mpd.session
  Response to [[::ffff:192.168.120.160]:6600]: OK
DEBUG    2019-10-12 02:31:11,558 [943:MpdSession-43] mopidy.mpd.session
  Request from [[::ffff:192.168.120.160]:6600]: setvol "35"
DEBUG    2019-10-12 02:31:11,560 [943:MpdSession-43] mopidy.mpd.session
  Response to [[::ffff:192.168.120.160]:6600]: OK
DEBUG    2019-10-12 02:31:11,561 [943:MpdSession-43] mopidy.mpd.session
  Request from [[::ffff:192.168.120.160]:6600]: idle
DEBUG    2019-10-12 02:31:12,062 [943:MpdSession-43] mopidy.mpd.session
  Request from [[::ffff:192.168.120.160]:6600]: noidle
DEBUG    2019-10-12 02:31:12,063 [943:MpdSession-43] mopidy.mpd.session
  Response to [[::ffff:192.168.120.160]:6600]: OK
DEBUG    2019-10-12 02:31:12,064 [943:MpdSession-43] mopidy.mpd.session
  Request from [[::ffff:192.168.120.160]:6600]: status
DEBUG    2019-10-12 02:31:12,070 [943:MpdSession-43] mopidy.mpd.session
  Response to [[::ffff:192.168.120.160]:6600]: 

The effect is: when I press for example the key for decreasing volume in ncmpc or send a "vol -5" via mpc, the volume command mopidy receives is unaltered. The volume scale already is linear.

@retrofreak83
Copy link
Author

I'd like to add:
I noticed that I have not the most recent mopidy version. Apparently, it is not available in the stretch repository. So I upgraded the machine to Debian Buster and I am now running mopidy 2.3.0 (alsamixer 1.1.1). I attach my mopidy.conf for you.

To repeat what I find bizarre: when I control the volume via ncmpc, for example, when I push the volume key for "lower the volume", the volume percentage

  • does not change at all
  • does change between 1 and more percents
    But: in any case, according to the debug messages, mopidy receives a volume change command with the (e.g.) non-altering volume...
    mopidy_conf.txt

@kingosticks
Copy link
Member

The readme states cubic is what alsamixer uses. Linear seems to be the wrong setting if you are trying to compare against alsamixer. I'm not saying it's the issue but you can't compare two different scales.

@retrofreak83
Copy link
Author

retrofreak83 commented Oct 12, 2019

Setting the volume scale to cubic does change nothing for me.
I rephrase: I don't have a problem with the amount of percentage that is changed when a volume up/down command is issued, my problem is that - in an arbitrary number of cases - the percentage does not change at all.
The setup I use to control my music playback via ncmpc and mpc with used to work for years and extremely reliable when I still used the original mpd. So I am puzzled what the actual problem may be here. The alsa configuration of the system as well as the sound card also are untouched since then.

@sobornostea
Copy link

I can confirm that I have the same issue using ncmpcpp, I am also using alsamixer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants