spotify-cli-linux icon indicating copy to clipboard operation
spotify-cli-linux copied to clipboard

--volumeup and --volumedown does not work

Open thexavier666 opened this issue 4 years ago • 4 comments

Sometimes the volume controls don't work. Other commands such as play/pause/next/prev works fine. The only way to fix this is by restarting the Spotify app.

Using Ubuntu 18.04 LTS with i3

thexavier666 avatar Jul 28 '19 20:07 thexavier666

I'm going through the source code. It might be because of pacmd or pactl. I'll let you know when the bug occurs again.

thexavier666 avatar Jul 28 '19 20:07 thexavier666

Hi,

I actually removed that feature in version 1.6.0 due to its errors and different behavior on different distros. It's mostly related to the system - not the Spotify app itself, so it doesn't have to be necessarily handled by this program.

Regards, Piotr

pwittchen avatar Jul 28 '19 20:07 pwittchen

I understand @pwittchen But I found the issue. It's with pacmd It returns 2 instances of spotify in it's output (which should be 1 normally), which get_sink_number cannot parse properly. This is the output of my pacmd list-sink-inputs

2 sink input(s) available.
    index: 0
	driver: <protocol-native.c>
	flags: START_CORKED 
	state: CORKED
	sink: 0 <alsa_output.pci-0000_00_1b.0.analog-stereo>
	volume: front-left: 68793 / 105% / 1.26 dB,   front-right: 68793 / 105% / 1.26 dB
	        balance 0.00
	muted: no
	current latency: 0.00 ms
	requested latency: 371.52 ms
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	resample method: (null)
	module: 12
	client: 3 <spotify>
	properties:
		media.role = "music"
		media.name = "Spotify"
		application.name = "spotify"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "30"
		application.process.id = "1672"
		application.process.user = "xavier666"
		application.process.host = "lazarus"
		application.process.binary = "spotify"
		window.x11.display = ":0"
		application.language = "en_IN"
		application.process.machine_id = "e3ba4449b32a46a1af28c128a83c91e5"
		application.process.session_id = "2"
		module-stream-restore.id = "sink-input-by-media-role:music"
    index: 14
	driver: <protocol-native.c>
	flags: START_CORKED 
	state: RUNNING
	sink: 0 <alsa_output.pci-0000_00_1b.0.analog-stereo>
	volume: front-left: 22937 /  35% / -27.36 dB,   front-right: 22937 /  35% / -27.36 dB
	        balance 0.00
	muted: no
	current latency: 1656.60 ms
	requested latency: 371.52 ms
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	resample method: (null)
	module: 12
	client: 693 <spotify>
	properties:
		media.role = "music"
		media.name = "Spotify"
		application.name = "spotify"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "30"
		application.process.id = "1672"
		application.process.user = "xavier666"
		application.process.host = "lazarus"
		application.process.binary = "spotify"
		window.x11.display = ":0"
		application.language = "en_IN"
		application.process.machine_id = "e3ba4449b32a46a1af28c128a83c91e5"
		application.process.session_id = "2"
		module-stream-restore.id = "sink-input-by-media-role:music" 

If we can select the correct index, then it works properly. If I find time, I'll do a pull request.

thexavier666 avatar Jul 29 '19 19:07 thexavier666

Ok, I re-opened the issue. If you're able to prepare PR with a properly working code, I'm open for it. :)

pwittchen avatar Jul 29 '19 19:07 pwittchen