georgefilipkin / pulsemixer Goto Github PK
View Code? Open in Web Editor NEWCLI and curses mixer for PulseAudio
License: MIT License
CLI and curses mixer for PulseAudio
License: MIT License
Last release is from Dec 16, 2017, maybe its time for another one?
It would be cool to have regular updates if, like now, some small fixes and features/adjustments make it into the repo. This would allow distros to pickup those changes instead of keeping them outside of a release for over 2 years.
thanks a lot, cheers
Hi,
I am getting SIGSEGV at line 972:
self.ret = pointer(c_int())
Running Arch, python 3.5.1.
I am on arch and use the latest version of pulsemixer from the aur repository. When I start it in interactive mode I cannot switch modes using the F keys. Pulsemixer then just exits.
This is a really cool tool, but it seems to be missing the IMO most important part of a pulse mixer: The ability to play around with individual client streams. (i.e. sink inputs / source outputs in pulse terminology)
Basically, I'm missing this tab from pavucontrol:
It needs the ability to
bonus points for also distinguishing between “applications only” and “all streams (including virtual streams)” like pavucontrol does.
Current mousewheel selects devices. It would be handy if that could be switched to change the device volume.
How does one mute the microphone?
If it's set using the --toggle-mute ID, how do I discover which ID the mic has?
I am able to mute the mic with the interactive interface, but I'd like to create a key bind to mute it.
Currently all the possible card profiles from pactl list cards
are displayed in third tab "F3 Cards". I am wondering if this is attended or if it would be possible (e.g. via config file or cmd line argument) to only show currently available which can be detetcted via pactl list cards
and searching available
ports and their corresponding Part fo profile(s)
properties.
Alternatively it would make it easier to mark them differently. If you think some of this is worth implementing it, I could also start a PR after some hints provided.
Example excerpts for
hdmi-output-2: HDMI / DisplayPort 3 (priority: 5700, latency offset: 0 usec, not available)
Properties:
device.icon_name = "video-display"
Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2, output:hdmi-surround71-extra2+input:analog-stereo
hdmi-output-2: HDMI / DisplayPort 3 (priority: 5700, latency offset: 0 usec, available)
Properties:
device.icon_name = "video-display"
device.product.name = "XXX TV"
Part of profile(s): output:hdmi-stereo-extra2, output:hdmi-stereo-extra2+input:analog-stereo, output:hdmi-surround-extra2, output:hdmi-surround-extra2+input:analog-stereo, output:hdmi-surround71-extra2, output:hdmi-surround71-extra2+input:analog-stereo
pulsemixer
always shows the same list of items, see screenshot:
Edit: Just saw that even the profile shows if it is available
by displaying yes
or no
, see
output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (sinks: 1, sources: 0, priority: 5700, available: yes)
vs.
output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (sinks: 1, sources: 0, priority: 5700, available: no)
It looks useful but it would be even better if we could easily install it from github.
Hello,
I would find it useful if Pulsemixer were to provide get/set-default-source/sink
commands.
It could be useful to support pseudo-IDs like @DEFAULT_SINK@
and @DEFAULT_SOURCE@
, or specific options --default-sink/source
to specify the default sink and default source for the various commands. I know that when no ID is specified, Pulsemixer acts on the default sink, but something is missing to use the default source.
Regards,
--
Tanguy Ortolo
It doesn't work on ArchLinux.
I get the following error:
Traceback (most recent call last): File "/usr/bin/pulsemixer", line 1784, in <module> main() File "/usr/bin/pulsemixer", line 1696, in main curses.wrapper(Screen().run) File "/usr/bin/pulsemixer", line 1192, in __init__curses.init_pair(67, 66, -1)_curses.error: init_pair() returned ERR
Python version 3.6.0
pulseaudio version 10.0
Pulse is running:
ps maux |grep pulse alex 828 1.8 0.4 1660604 12672 ? - 19:54 0:55 /usr/bin/pulseaudio --daemonize=no alex 832 0.0 0.1 82644 3516 ? - 19:54 0:00 /usr/lib/pulse/gconf-helper alex 1581 0.0 0.0 11344 2240 pts/0 - 20:43 0:00 grep pulse
But I get output on --list-sources etc
Any idea? Do I have to specify something?
Thank you.
Any 0.0.1 would be good for an initial packaging it into distros.
I use rofi to run most of my programs. Running pulsemixer through rofi will lead to pulsemixer running in the background and not in a visible interactive terminal. That behavior is correct.
The memory usage of the pulsemixer process that is not running in a visible terminal will permanently increase. As seen in this screenshot.
The highlighted process is the one running in the background. The other processes run in a normal terminal.
I think this might help to solve the issue:
if sys.stdout.isatty():
# You're running in a real terminal
else:
# You're being piped or redirected
If you hold shift when running it through rofi, rofi will open a terminal and run pulsemixer inside of it. In this case no memory leak exists.
It'd be nice to be able to specify the step size for the Shift+Left and Shift+Right volume adjustments.
:)
I can't figure this one out on my own. I use the default config, which includes ▮ as the symbol for bar on. For some reason tho, it won't display on my terminal. It's just a blank space and I can't figure out what is going on with it. This is what it looks like.
I'm using pulsemixer to mute when the screen locker activates (and unmute when it deactivates). This works fine as long as there is only a single sink, since --mute
and --unmute
will just act on that. It would be quite useful if there was an easy way to mute or unmute all sinks, not just a specific one.
# ps_mem.py -p 6715
Private + Shared = RAM used Program
1.6 GiB + 933.5 KiB = 1.6 GiB pulsemixer
# ps axuw|grep [p]ulsemixer
user 6715 0.1 0.8 1994524 1698556 pts/34 S+ May13 109:12 /usr/bin/python3 /usr/bin/pulsemixer
I think 1.6g ram is a "bit" too much for a volume controller.
Hey there, thanks for creating pulsemixer. I have a minor request to make: I'm a Gentoo user and write my own ebuilds for software I like. I heavily prefer to work with tarballs for various reasons (e.g. checksum verification) and the latest release 1.1.0 doesn't work properly on my system while the current state of master does.
Would you mind to make a minor release so there's a tarball available that contains the fixes that were committed after the 1.1.0 release?
I love this program, but it's quite qwertynormative.. and I use the Colemak mod DH keyboard layout.
let's make it inclusive for qwerty nonconforming folks. :)
It would be great to have unselected channels in gray-scale while the selected one is in color.
Thoughts?
i'm aware of the rename feature and ability to remove the name, but i'd like to completely remove some of the inputs/outputs out there through configuration or cli parameters..
reason: i have HDMI1, HDMI2, HDMI3, Speaker + Headphones and multiple bluetooth receivers + sometimes combined sink.. moving around all those can be challenging, and some of them I don't ever use, so it would be helpful to hide them..
everytime i try to run "python setup.py" i get this error:
`pi@raspberrypi:~/pulsemixer $ sudo python setup.py
**usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied**`
So what do i fill in here? What commands? and global options?
It would be useful if pulsemixer could have an optional machine readable output (say, json) so I can integrate it with other tools without worrying that its output will change in the future. It would also be easier than having to sed the current output.
I think PgUp/PgDown could select the next/previous device, while Home/End would, obviously, go the very end or the very beginning of the entire list.
It would be very helpful to be able to specify a single sink ID to control in interactive mode.
Thoughts?
CJK characters sometimes have multiple width that messed up the indentation.
Example
*Built-in Audio Analog Stereo 10 ─┌▮▮▮▮--------------------------------------------------------------┐─
│ 10 ─└▮▮▮▮--------------------------------------------------------------┘─
└─mpv Media Player: 楊宗緯 張碧晨 - 凉凉 (官 100 ┌▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮----------------------┐
100 └▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮----------------------┘
*Built-in Audio Analog Stereo 10 ─┌▮▮▮▮▮----------------------------------------------------------------------------------┐─
│ 10 ─└▮▮▮▮▮----------------------------------------------------------------------------------┘─
└─mpv Media Player: 楊宗緯 張碧晨 - 凉凉 (官方歌詞 100 ┌▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮-----------------------------┐
100 └▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮-----------------------------┘
I have feature request for you to consider: a combined mode. In this mode, both sources and sinks would be visible on the same screen, so that I can see everything at once.
When I press Enter to select one of the available options from the context menu, I can't see the highlighted option at all (see the first image below). I think that maybe it is due to my terminal colors, because it works well on a simple tty.
However, many other curses-based tools I use have not this problem. The second image, for example, is taken from wicd-curses.
Is it possible to change the highlighted item style in some way?
Thanks for building this very much useful tool.
But i can not set the appearance anywhere near the screenshot placed on the page. It's just boring lines. I had placed the config file in ~/.config/pulsemixer.cfg
Any attempt to increase volume over 150% will simply set the volume to 150%. I think this behavior should be at least documented.
This is using pipewire on Arch Linux. If running pulsemixer --list
immediately after booting the system, there is a crash with an IndexError:
$ pulsemixer --list
Traceback (most recent call last):
File "/sbin/pulsemixer", line 2054, in <module>
main()
File "/sbin/pulsemixer", line 1968, in main
index = 'sink-{}'.format([s.index for s in sinks if s.name == server_info.default_sink_name][0])
IndexError: list index out of range
I guess this is pipewire not initialsing fast enough and returning either an empty list of sinks or not specifying a default sink. It's not a major issue, but could be more defensive.
navigating through sinks/sources is indicating the current position with bold
font style of the text there.. with some fonts that's less visible, and potentially being able to change the color of the currently selected (hovered) item would be helpful..
the color might be a relative hue shift or a static color, configurable via config file or parameters..
It's only visible with colors enabled.
As one example, a user might be in a video conference call, and wants to also share audio coming from their system.
This is a very useful feature, some other pulseaudio frontends support this feature.
I often have lots of pulseaudio clients that I want to move around my several outputs (local, bluetooth, combined). It's hard to identify which client is the one I want to move. Observe the screenshot demonstrating the situation with multiple firefox tabs (upper terminal hosts pulsemixer
, while lower two show how it looks like in pamix
with playback clients and output devices tabs).
Now, I like the simple and uncluttered interface of pulsemixer
so I don't think it would be serving to maintaining that value to add additional bar like pamix
does, but we could use text color changing from green to red dynamically based on volume or some other indicator that would at least point to what clients are actively sending some sound through and which are just idle.
Can you make it any bigger?
addwstr() returned ERR
This error is displayed when I attempt to run the script, pulsemixer was working yesterday and I don't believe I changed anything.
oddly pulsemixer -h still displays the help menu...
Linux Mint 17.2 Python 3.4.3 installed Pulseaudio 4.0
I came across some minor but confusing glitch when using pulsemixer within tmux.
Steps to reproduce:
tmux
pulsemixer
within a tmux windowShift+Left
or Shift+Right
Actual result: pulsemixer quits with status zero
Expected result: volume gets decreased/increased by 10%
I narrowed it down to this line:
Line 1442 in 71f15d0
It enters the if
block because c == self.ESC_KEY
somehow. It seems like either tmux or curses is decoding the Shift
key incorrectly.
(As a workaround, one can use H
/L
which are aliases for Shift+Left
/Shift+Right
.)
Firefox' audio output appears as "AudioIPC Server: AudioStream", is there a general solution for all programs that have a separate audio thread/s / audio servers or it would require hard-coding program names?
here's the output of:
$ pactl list clients
Client #0
Driver: module-systemd-login.c
Owner Module: 20
Properties:
application.name = "Login Session 249"
systemd-login.session = "249"
Client #1
Driver: protocol-native.c
Owner Module: 12
Properties:
application.name = "Music Player Daemon"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
media.role = "music"
application.icon_name = "mpd"
application.process.id = "5106"
application.process.user = "auser"
application.process.host = "archmachine"
application.process.binary = "mpd"
application.language = "C"
window.x11.display = ":0"
application.process.machine_id = "546c9574f539484aa460b73e76b3428a"
application.process.session_id = "249"
Client #185881
Driver: protocol-native.c
Owner Module: 12
Properties:
application.name = "Chrome input"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
application.process.id = "13405"
application.process.user = "auser"
application.process.host = "archmachine"
application.process.binary = "chromium"
application.language = "en_US.UTF-8"
window.x11.display = ":0"
application.process.machine_id = "546c9574f539484aa460b73e76b3428a"
application.process.session_id = "249"
application.icon_name = "chromium"
Client #185889
Driver: protocol-native.c
Owner Module: 12
Properties:
application.name = "mpv Media Player"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
application.process.id = "29139"
application.process.user = "auser"
application.process.host = "archmachine"
application.process.binary = "mpv"
application.language = "C"
window.x11.display = ":0"
application.process.machine_id = "546c9574f539484aa460b73e76b3428a"
application.process.session_id = "249"
application.icon_name = "mpv"
Client #187743
Driver: protocol-native.c
Owner Module: 12
Properties:
application.name = "pulsemixer"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
application.process.id = "21856"
application.process.user = "auser"
application.process.host = "archmachine"
application.process.binary = "python3.7"
application.language = "C"
window.x11.display = ":0"
application.process.machine_id = "546c9574f539484aa460b73e76b3428a"
application.process.session_id = "249"
Client #190084
Driver: protocol-native.c
Owner Module: 12
Properties:
application.name = "AudioIPC Server"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
application.process.id = "16218"
application.process.user = "auser"
application.process.host = "archmachine"
application.process.binary = "firefox"
application.language = "en_US.UTF-8"
window.x11.display = ":0"
application.process.machine_id = "546c9574f539484aa460b73e76b3428a"
application.process.session_id = "249"
application.icon_name = "firefox"
Client #190161
Driver: protocol-native.c
Owner Module: 12
Properties:
application.name = "pactl"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
application.process.id = "10982"
application.process.user = "auser"
application.process.host = "archmachine"
application.process.binary = "pactl"
application.language = "en_US.UTF-8"
window.x11.display = ":0"
application.process.machine_id = "546c9574f539484aa460b73e76b3428a"
application.process.session_id = "249"
should I contribute and add the option to display a more meaningful application.icon_name
or application.binary
for config specified list of application.name
(s), which can be added with a key press to the config?
The traceback:
Traceback (most recent call last):
File "./pulsemixer", line 1652, in <module>
main()
File "./pulsemixer", line 1579, in main
curses.wrapper(scr.run)
File "/usr/lib/python3.4/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "./pulsemixer", line 1366, in run
self.display()
File "./pulsemixer", line 1501, in display
n = round(len(vol) * line.volume[bartype] / line.maxsize)
IndexError: list index out of range
When the error occurs, the value of line.volume
is [100]
but bartype
is 1
.
The code might be making an assumption that is incorrect in my particular setup. In my setup, I have a virtual output device where the left and right channels are remixed into a single mono channel. The configuration in ~/.pulse/default.pa to create this device is:
load-module module-remap-sink master=alsa_output.pci-0000_00_1b.0.analog-stereo sink_name=alsa_output.pci-0000_00_1b.0.analog-stereo-magic_mono channels=1 master_channel_map=front-right
update-sink-proplist alsa_output.pci-0000_00_1b.0.analog-stereo-magic_mono device.description="Magic Mono"
The traceback disappears when I unload that module. Strangely, it doesn't reappear if I then reload the module manually (with pactl). It's only when the module is loaded at startup time.
It would be great if the current default sink could be listed in the --list-sinks
output.
Perhaps like this:
Sink input: ID: 3, Name: Spotify, Mute: 0, Channels: 2, Volumes: ['55%', '55%']
Sink: ID: 0, Name: G430 Surround Sound Gaming Headset Analog stereo, Mute: 0, Channels: 2, Volumes: ['71%', '71%']
Sink: ID: 3, Name: Built-In Analog stereo, Mute: 0, Channels: 2, Volumes: ['60%', '60%'], Default
(Note the added , Default
at the end of the last line)
This would help me write a small Rofi/dmenu utility to quickly pick my default output source.
Seems like that #35 introduces a bug, namely that choosing a card profile does also count the inactive ones (guess by index) such that if one chooses that third visible / available one actually the third one of all is selected.
If you need more information, don't hesitate to ask.
Just wondering if you could include a LICENSE file in the repo? Unfortunately I'd love to package this for void linux but one of the guidelines is that it has a LICENSE file included if it uses the MIT license.
Thanks for building a powerful pulse cli panel.
Recently start using simple protocol module but got error from pulsemixer.
pactl load-module module-simple-protocol-tcp rate=48000 format=s16le channels=2 source=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor record=true port=server_port listen=ip_address
Traceback (most recent call last):
File "/usr/bin/pulsemixer", line 2054, in <module>
main()
File "/usr/bin/pulsemixer", line 1948, in main
curses.wrapper(Screen(CFG.ui.color, CFG.ui.mouse).run)
File "/usr/lib/python3.8/curses/__init__.py", line 105, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/bin/pulsemixer", line 1253, in run
self.get_data()
File "/usr/bin/pulsemixer", line 1447, in get_data
self.data = self.build(self.modes_data[0][0], PULSE.sink_list(), PULSE.sink_input_list())
File "/usr/bin/pulsemixer", line 1418, in build
bar = Bar(s[0])
File "/usr/bin/pulsemixer", line 952, in __init__
self.poll_data(pa, 0, 0)
File "/usr/bin/pulsemixer", line 963, in poll_data
media_fullname = pa.media_name.decode().replace('\n', ' ')
AttributeError: 'NoneType' object has no attribute 'decode'
$ uname -a
Linux 5.6.15-arch1-1 #1 SMP PREEMPT Wed, 27 May 2020 23:42:26 +0000 x86_64 GNU/Linux
$ pulsemixer --version
1.5.1
this amazing tool that is extremely useful and an replacement for pavucontrol and alsamixer
the problem is that this has not been updated since april of 2020 and many issues and pull requests have just not been getting any attention,
the last solved issue was last year, i'm also dealing with an issue but i assume it won't be fixed because of font rendering in pulsemixer
the project owner GeorgeFilipkin has also been inactive, i would love to see if the project got updated this year
I am trying out your mixer on the command line and cannot get the ID selection to work.
pulsemixer --list
Sink input: ID: 470, Name: Firefox, Mute: 0, Channels: 2, Volumes: ['90%', '90%']
Sink: ID: 0, Name: Built-in Audio Digital Stereo (HDMI), Mute: 0, Channels: 2, Volumes: ['65%', '65%']
Sink: ID: 1, Name: Built-in Audio Analog Stereo, Mute: 1, Channels: 2, Volumes: ['64%', '64%']
Source: ID: 0, Name: Monitor of Built-in Audio Digital Stereo (HDMI), Mute: 0, Channels: 2, Volumes: ['100%', '100%']
Source: ID: 1, Name: Monitor of Built-in Audio Analog Stereo, Mute: 0, Channels: 2, Volumes: ['100%', '100%']
Source: ID: 2, Name: Built-in Audio Analog Stereo, Mute: 1, Channels: 2, Volumes: ['100%', '100%']
The default sink is ID = 1 and 64% volume - other IDs have other values for volumes not 64%.
if I run the following (using switch format --id=[ID] or --id [ID] )
> pulsemixer --get-volume --id=470
64 64
> pulsemixer --get-volume --id=2
64 64
I am actually looking to use the mute function from the command line but it and other commands likewise only report or effect the default sink regardless of ID specified.
I am running on a up to date Arch linux os, pulseaudio 10.0 and python = 3.6.2
The curses interface works fine - I can mute only firefox for example.
I looked through the code but being a python newbie I couldn't find the issue.
Thanks for you very useful work.
Being able to set the default input or output device with shift+enter would be very helpful. Thanks a lot for this app it helps a ton :).
Hi,
It'd be awesome if there was some way to change sink for selected sink-input.
This can be achieved by using pactl command: pactl move-sink-input
.
Nice project btw.
Best regards,
b3niup
I would find it more intuative to have a tree like structure for the different "Playback Streams" and their "Output device", i.e something like this:
Built-in Audio Analog Surround.. 55 ┌⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛-----------------------┐
├ Locked Muted 55 ├⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛-----------------------┤
├ 55 └⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛-----------------------┘
├ Music Player Daemon 76 ─┌⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛------------------┐─
├ Locked Muted 76 ─└⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛------------------┘─
└ mpv Media Player 71 ┌⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛-------------------┐
Locked Muted 71 └⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛-------------------┘
GF114 HDMI Audio Controller Di.. 66 ─┌⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛--------------------┐─
Locked Muted 66 ─└⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛--------------------┘─
What do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.