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 scale issue #3

Closed
andyjenkinson opened this Issue Jan 16, 2015 · 10 comments

Comments

9 participants
@andyjenkinson

andyjenkinson commented Jan 16, 2015

Hi,

I notice that the scale of the volume control is a bit odd when using the ALSA mixer to control the volume control of the Raspberry Pi's internal sound card. For me, almost all of the variability in audible volume occurs in the top 15% of the volume range, and it is also inconsistent with the volume reported through other applications like shairport (another component of pimusicbox, which is the context I am using mopidy in).

I believe this is due to a change to the way amixer reports volume in ALSA. The scale used by mopidy appears to be the one amixer uses, i.e. a simple linear scale of the raw values from the card. By contrast, alsamixer uses a scale that represents human perception volume instead (which I believe is more correct from a user-driven application like mopidy). See this thread for details:
https://bbs.archlinux.org/viewtopic.php?pid=1217759

I guess any change would need to be in the python alsa binding library.

@jodal jodal self-assigned this Jan 28, 2015

@matt-oakes

This comment has been minimized.

matt-oakes commented Sep 15, 2015

I'm having the same issue. Is this something that will be fixed?

@adamcik

This comment has been minimized.

Member

adamcik commented Sep 16, 2015

I would suggest we make the scale a configuration option. Unless there is some sane way to pull the data to just make this work from pyalsa. Not sure if this should be in mopidy-alsamixer, or mopidy itself though.

@tkem

This comment has been minimized.

Member

tkem commented Sep 25, 2015

Same issue with IQAudio PiDAC+; anything below 60 is barely audible. So +1 for a config option for this.

@jodal jodal removed their assignment Jan 17, 2016

@jodal jodal added the enhancement label Jan 17, 2016

@tkem tkem referenced this issue Aug 1, 2016

Closed

Volume #201

@fluffypony

This comment has been minimized.

fluffypony commented Sep 30, 2016

Same issue on RPi 3 - @jodal do you have a Bitcoin / Monero address I can donate to in order to get a bit of traction on this issue? Thanks!

@steveb1475

This comment has been minimized.

steveb1475 commented Jan 7, 2017

Still a problem - RPi 2 with DAC+

karlvr added a commit to karlvr/mopidy-alsamixer that referenced this issue Jan 31, 2017

@karlvr

This comment has been minimized.

Contributor

karlvr commented Jan 31, 2017

@steveb1475 @fluffypony @tkem if you're still interested. I have been successful messing around with the code. It might be enough to things better for you. I'm not sure if it's the right solution, but it makes things much better for me!

Download the three files from https://github.com/karlvr/mopidy-alsamixer/tree/volume-range/mopidy_alsamixer and replace the files in /usr/lib/python2.7/dist-packages/mopidy_alsamixer/ on your RPi.

Add volmin and volmax to your mopidy.conf:

e.g.

[alsamixer]
card = 0
control = Digital
volmin = 30
volmax = 70

Then restart Mopidy. You should now have your Mopidy volume control mapped to the middle of the ALSA range. For me it's now much more usable.

@karlvr

This comment has been minimized.

Contributor

karlvr commented Feb 2, 2017

I've also just added an option for logarithmic volume control to that PR. That is working really nicely for us. The movement of the volume slider in Mopidy now corresponds to the movement of the volume slider in alsamixer (which I understand already uses the logarithmic scale).

@jodal

This comment has been minimized.

Member

jodal commented Feb 11, 2017

Fixed by PR #9. Thanks @karlvr! :-)

@jodal jodal closed this Feb 11, 2017

@morenocruzf

This comment has been minimized.

morenocruzf commented Apr 17, 2017

Hi guys, I am having the same issue. Also the "mute" option doesn't work.

I've followed the steps from @karlvr but I get

● mopidy.service - Mopidy music server
   Loaded: loaded (/lib/systemd/system/mopidy.service; enabled)
   Active: failed (Result: exit-code) since Mon 2017-04-17 10:41:55 CEST; 6min ago
  Process: 542 ExecStart=/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf (code=exited, status=1/FAILURE)
  Process: 532 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
  Process: 518 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
 Main PID: 542 (code=exited, status=1/FAILURE)

Apr 17 10:41:55 PiMediaCenter mopidy[542]: from mopidy.core import Core
Apr 17 10:41:55 PiMediaCenter mopidy[542]: File "/usr/lib/python2.7/dist-pack...>
Apr 17 10:41:55 PiMediaCenter mopidy[542]: from .actor import Core
Apr 17 10:41:55 PiMediaCenter mopidy[542]: File "/usr/lib/python2.7/dist-pack...>
Apr 17 10:41:55 PiMediaCenter mopidy[542]: from mopidy import audio, backend,...r
Apr 17 10:41:55 PiMediaCenter mopidy[542]: File "/usr/lib/python2.7/dist-pack...>
Apr 17 10:41:55 PiMediaCenter mopidy[542]: from mopidy import exceptions, mixer
Apr 17 10:41:55 PiMediaCenter mopidy[542]: ImportError: cannot import name mixer
Apr 17 10:41:55 PiMediaCenter systemd[1]: mopidy.service: main process exited...E
Apr 17 10:41:55 PiMediaCenter systemd[1]: Unit mopidy.service entered failed ....

Any idea??
(I didn't have the files "_ init_.py" and "mixer.py" under "/usr/lib/python2.7/dist-packages/mopidy_alsamixer/" , they were in "/usr/lib/python2.7/dist-packages/mopidy"
And the file ext.conf wasn't there, so just made it new)

I think I have the last version of everything... but...

@jodal

This comment has been minimized.

Member

jodal commented Apr 17, 2017

@morenocruzf This is a closed issue. Please use the discussion forum at https://discuss.mopidy.com to get help with your installation.

karlvr added a commit to karlvr/mopidy-alsamixer that referenced this issue Aug 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment