MOC's volume controls are not working

Forums:

Hello! I use Arch Linux (x86_64 Linux 3.18.1-3-ck), Music On Console (version 2.5.0, revision 2668) from official repository, My hardware is ASUS Xonar Essence STX. For some reason none of the moc's volume controls work (like ,. or <>), nothing happens (no "bad command" messages either), I cannot change volume level through console either (mocp -v 20 and such) so I have to resort to changing volume levels with alsamixer. This problem's been bugging me for a while and I am willing to provide more info if necessary! Thank you in advance!

It also clearly shows the right system mixer and volume level, Master, and correctly updates level when I change it with alsamixer, but is unable to change the level on ot's own.

At first glance looks like a problem in ALSA. I have a similar sound card (at least using the same driver) and didn't see this problem.

Have you tried switching mixer channels in MOC? (key X). What does MOC debug log say?

Yes, I tried switching mixer channels, the second one available is "S.Off", I can change the level on that one but it does nothing and I have no idea what it is :)

I had to remove my moc package and install one from aur (moc-svn) to edit pkgbuild so it would have debug mode compiled in, but there you go:

https://dl.dropboxusercontent.com/u/11802023/mocp_client_log.bz2
https://dl.dropboxusercontent.com/u/11802023/mocp_server_log.bz2

I was furiously mashing comma and dot plus sent some console commands to change volume for this session :)

Thank you for your time!

Found it! I really can't believe the problem was so trivial and nobody else saw that!

First of all, turns out that my soundcard was also affected but I never really checked it. I used volume knob on my amplifier and silently assumed that it was working :)

The problem was that somebody made an elementary-school-level math error in mixer values rescaling. I suspect that something is still a bit off, as numerical values in alsamixer and MOC differ. However 0 corresponds to 0 and 100 to 100, so it's not so bad ;)

You can try this patch with current svn version of MOC (sorry for google link, have problem with my webpage)
https://drive.google.com/file/d/0B5tkYv3Vhof3V2g0R01CNm1WT28/view

Regarding "S.Off" - it is software mixer telling you it is disabled :) You can enable it with 'w' and use it as a workaround to your problem :)

BTW. It is safe to turn on "Allow24bitOutput = yes" in .moc/config.

Thank you, you are a Wizard! Works like a charm now! You also deserve an extra Thank You! for clarifying things for me about software mixer. It is extremely useful!

If you feel like experimenting, I prepared additional patch related to this problem with alsamixer compatibility I mentioned before. Now you may notice that volume control in MOC sounds bad, i.e. audible changes in volume are not what you would expect. For example reducing volume from 100 to 50 has different perception than reducing from 50 to 25. With this patch, it should give more natural feel.

https://drive.google.com/file/d/0B5tkYv3Vhof3WE0yZzNwMFVNT3M/view?usp=sharing

I tried it for a while, not sure yet how I feel about it yet, but I noticed 1 odd thing:
When you are at 82% moc and press . it goes to 87, when you are at 87% and press . it goes to 93, when you press , it goes to 89, then you press . and it goes to 95 so if you are near the end of the bar and go back and forth with , and . volume level ends up at the very max (95 and a 100) which is highly counter-intuitive.

P.S. As far as I understand you implemented some sort of a logarithmic volume scale to correspond with the way we perceive loudness, but is it not already coded into alsamixer loudness?

I guess it is a predictable side effect of rounding errors. I'll see if I can do something with it.

I did exactly the same thing that is done in alsamixer loudness. Borrowed a code from there. But note that alsamixer is only volume changing app, not a part of ALSA engine, so ALSA itself doesn't see (at least as far as I understand it) volumes like alsamixer shows them. Thus in order to allow MOC to display the same volume as alsamixer I needed to do the log scaling as well.

I see. Well good luck to you! I hope your code finds its way upstream soon!

The mixer values rescaling patch has been committed to SVN today as r2759 (on the release 2.5 branch) and r2760 (on trunk).