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

/sbin/pulseaudio-control: line 313: [: : Expected an integer expression #48

Closed
brerk opened this issue May 9, 2021 · 9 comments · Fixed by #49
Closed

/sbin/pulseaudio-control: line 313: [: : Expected an integer expression #48

brerk opened this issue May 9, 2021 · 9 comments · Fixed by #49

Comments

@brerk
Copy link

brerk commented May 9, 2021

When i run the command:

$ pulseaudio-control --icons-volume " , " --icon-muted " " --sink-nicknames-from "device.description" --sink-nickname "alsa_output.pci-0000_00_1f.3.analog-stereo: Volume" listen

I get 2 errors:
/sbin/pulseaudio-control: line 313: [: : Expected integer expression
/sbin/pulseaudio-control: line 313: [: : Expected integer expression

The output of pactl list sinks short | cut -f2 is: alsa_output.pci-0000_00_1f.3.analog-stereo

inspecting the line 313 of the script it looks like it compares 2 different volumes

@marioortizmanero
Copy link
Owner

Can you show me the output of pactl list sinks? VOL_LEVEL is probably failing to be parsed

@brerk
Copy link
Author

brerk commented May 9, 2021

Sure, my system is in spanish, so maybe that its the source of the problem

$ pactl list sinks
Destino #0
	Estado: RUNNING
	Nombre: alsa_output.pci-0000_00_1f.3.analog-stereo
	Descripción: Audio Interno Estéreo analógico
	Controlador: module-alsa-card.c
	Especificación de muestra: s16le 2ch 44100Hz
	Mapa de canales: front-left,front-right
	Módulo propietario: 6
	Silencio: no
	Volumen: front-left: 29868 /  46% / -20.48 dB,   front-right: 29868 /  46% / -20.48 dB
	        balance 0.00
	Volumen base: 65536 / 100% / 0.00 dB
	Fuente que lo monitoriza: alsa_output.pci-0000_00_1f.3.analog-stereo.monitor
	Latencia: 76799 usec, configurados 105000 usec
	Indicadores: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
	Propiedades:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC3204 Analog"
		alsa.id = "ALC3204 Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0x91620000 irq 140"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "34c8"
		device.product.name = "Ice Lake-LP Smart Sound Technology Audio Controller"
		device.form_factor = "internal"
		device.string = "front:0"
		device.buffering.buffer_size = "352800"
		device.buffering.fragment_size = "176400"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Estéreo analógico"
		device.description = "Audio Interno Estéreo analógico"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Puertos:
		analog-output-speaker: Speakers (type: Altavoz, priority: 10000, availability unknown)
		analog-output-headphones: Headphones (type: Auriculares, priority: 9900, availability group: Legacy 2, not available)
	Puerto Activo: analog-output-speaker
	Formatos:
		pcm

@marioortizmanero
Copy link
Owner

Ah yup that must be it. We do use LANG=$LANGUAGE in listen() to get events in english, but the rest of the calls don't have that. Can you try it with LANG=en_US pactl list sinks?

@marioortizmanero
Copy link
Owner

marioortizmanero commented May 9, 2021

Or rather, try running the script with the prefix LANG=en_US and see if it works that way. I can make a PR to fix that later. Or maybe with LC_ALL=C, I don't know which one is best.

@brerk
Copy link
Author

brerk commented May 10, 2021

Yes, this command works as expected:

$ LANG=en_US pulseaudio-control --sink-nickname "alsa_output.pci-0000_00_1f.3.analog-stereo:  Volume"  listen

61% Volume

Thanks for the help :)

@marioortizmanero
Copy link
Owner

marioortizmanero commented May 10, 2021

No problem! Can you try one last thing?

Try adding after the LANGUAGE=en_US line in the script a line with export LANG=en_US. That should make it work for every comand without needing to add it as a prefix, but I want to make sure before adding it to the script.

@brerk
Copy link
Author

brerk commented May 10, 2021

Just added the export LANG=en_US in the script, it works as expected.

@marioortizmanero
Copy link
Owner

Great thanks! I'll update the script then.

@marioortizmanero
Copy link
Owner

The new update v2.2.1 (also available on the AUR) should fix this issue.

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

Successfully merging a pull request may close this issue.

2 participants