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 not working #49

Closed
rickbrandt opened this issue Apr 24, 2017 · 12 comments
Closed

Volume control not working #49

rickbrandt opened this issue Apr 24, 2017 · 12 comments

Comments

@rickbrandt
Copy link

Hi!
First of all a lot of compliments and gratitude for this project, I got it to work on my Pi yesterday and am very happy with it. I have four questions though.

(1) When pressing the volume buttons on my phone while in the Spotify app, the app shows the volume of Spotify go up and down, but the volume of my music stays the same. Is this a known issue? Is there a way to fix it?

(2) The volume coming from the Pi seems to be remarkably lower than from for instance my phone. The alsamixer is set to 100% already. (Maybe the spotify volume is set to something low and I cannot get it to max because of above issue (1)?).

(3) The audio quality from the Pi seems quite a bit worse than from my phone. My speakers are able to project very clear high pitched drums and stuff like that and when playing a song from my phone, I can notably hear the details more than when playing from the pi. I did set the bitrate to 320 in the config already. Is this just the RPi soundcard being poor compared to my phone (OnePlus One)? I know this is a highly subjective question but maybe someone knows...

(4) When skipping through numbers and disconnecting and reconnecting (don't know what I did exactly) the daemon crashed. Logs are saying this:

Apr 24 16:48:32 raspberrypi Spotifyd[1062]: Caught panic with message: called Option::unwrap() on a None value
Apr 24 16:49:44 raspberrypi Spotifyd[1062]: Caught panic with message: called Result::unwrap() on an Err value: "SendError(..)"

I am running the precompiled ARMv7 binary on a RPi 2B Jessie.

Thanks in advance!
Cheers Rick

@SimonPersson
Copy link
Member

Hi!

(1) - Yes, I'm aware of this. I don't use the feature so I haven't bothered. One day :)

(2) and (3) - Yeah, the inbuilt audio is not great. I use a cheap USB DAC which really helps. You could test if the issue is with Spotifyd or not by playing some audio with another application, such as:

aplay /usr/share/sounds/alsa/Front_Center.wav

(4) - No idea, sorry! I think the underlying library might be a little bit unstable. Perhaps set up some solution to restart the daemon when it crashes for now.

Cheers,

Simon

@rickbrandt
Copy link
Author

rickbrandt commented Apr 28, 2017

  1. Fair enough, thanks for letting me know (so I dont spend more time on it).
    2 and 3. Playing an mp3 seems to have similar volume and sound quality. So indeed seems nothing to do with spotify.
  2. Will do, thanks!

@wedi
Copy link

wedi commented May 28, 2017

Volume control was working for me in an earlier version. After upgrading to the current release this went away.

I extracted the version this was working in from a file called spotifyd-2017-03-27-armv7.zip but the date does not correspond to a release… I can provide this file if you are interested.

@rickbrandt
Copy link
Author

Since some time now I get this error:

19:29:10 [ERROR] Caught panic with message: subscription terminated

My Spotify subscription is still valid though. I tried logging out and in again. Any idea?

@rickbrandt
Copy link
Author

@wedi Thanks! For now I dont have anything working anymore so Ill focus on that first ;)

@rickbrandt
Copy link
Author

For future reference, the
Caught panic with message: subscription terminated
error was resolved by getting the latest compiled version. also see

#57

@SebastianJarsve
Copy link

+1 for the volume control. I've made an amplifier with a built in Raspberry Pi and wanted to use Spotify Connect to control the music. Everything works great, except for the volume control. Of course, I could just ssh into the Raspberry and adjust the volume with alsamixer, but that doesn't make my amplifier so user friendly.

@SimonPersson
Copy link
Member

Yeah, this issue shouldn't have been closed. I will look into it.

I've made an amplifier with a built in Raspberry Pi and wanted to use Spotify Connect to control the music. Everything works great, except for the volume control.

Sounds cool! Does the RPi control the amplification via alsamixer? I'm thinking that for good audio quality, one would want to output line level to the amplifier, and then change the volume on the amplifier, rather than outputting less than line level from the RPi, no? In any case, I'm looking into it :)

@SimonPersson SimonPersson reopened this Jun 15, 2017
SimonPersson added a commit that referenced this issue Jun 15, 2017
This fixes the broken volume control, issue #49.
@SimonPersson
Copy link
Member

This should be solved on master, binaries will be available in a bit.

The solution is really hackish, but should work. There is an open PR to add an alsa volume controller to Librespot, which will implement a more proper solution. Essentially, the issue is that Librespot defaults the mixer to full volume. Until Librespot merges a more proper solution, I just make sure to never raise the volume by more than 20%, hence blocking the initial setting unless you already had the sound really loud.

@SebastianJarsve
Copy link

Yeah, I control the amplification through alsamixer, which works great.
Now spotifyd works flawlessly, thanks man!

@Jezorko
Copy link

Jezorko commented Feb 7, 2023

Hey @SebastianJarsve, I just installed this on Raspberry with Manjaro ARM and everything works perfectly, exept the volume control 😅

Has this not been resolved, or am I doing something incorrectly? Here's my config:

[global]
username = ""
password = ""
use_mpris = false
backend = "alsa"
device = "default"
control = "default"
mixer = "PCM"
volume_controller = "alsa_linear"
device_name = "DownstairsSpeakers"
bitrate = 320

@eladyn
Copy link
Member

eladyn commented Feb 15, 2023

@Jezorko In general, this should be working. I'm not using Manjaro ARM, but on my RaspberryPi it's working with the following configuration:

backend = "alsa" # use portaudio for macOS [homebrew]

# The alsa audio device to stream audio. To get a
# list of valid devices, run `aplay -L`,
device = "default:CARD=Headphones"  # omit for macOS

# The alsa control device. By default this is the same
# name as the `device` field.
control = "default"  # omit for macOS

# The alsa mixer used by `spotifyd`.
mixer = "Headphone"  # omit for macOS

# The volume controller. Each one behaves different to
# volume increases. For possible values, run
# `spotifyd --help`.
volume_controller = "alsa"  # use softvol for macOS

So, I guess, you could try to play around with those config options and see, if there's a working configuration for you.

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

6 participants