Giter Site home page Giter Site logo

kenjitakahashi / pacmixer Goto Github PK

View Code? Open in Web Editor NEW
116.0 8.0 7.0 704 KB

an alsamixer alike for PulseAudio.

License: GNU General Public License v3.0

C 24.60% Objective-C 20.40% C++ 16.73% Objective-C++ 35.92% Shell 1.10% Roff 1.25%
pulseaudio tui mixer curses ncurses

pacmixer's Introduction

Build Status

pacmixer is an alsamixer alike for PulseAudio.

I started this, because I've found no full-blown, terminal based mixers available for PA. All there are are either CLI or some kinds of GNOME/KDE applets. That's not what I wanted, so in the end I decided to go for it myself.

It was also a good starting point to finally learn myself some ObjC :).

Back in the old days, there were a good mixer for ALSA (alsamixer), so I thought about taking some of their ideas, mix it with mine, and see what happens.

Updating past 0.5: Configuration mechanism has been reworked to be more flexible and integrate better with GNU/Linux environment. It means that:

  • Pacmixer configuration is no longer available through settings tab (it is reserved for PA options).
  • Settings are now configured using configuration file.
  • Settings configured with version <= 0.5 will be reset to defaults after update.
  • Settings storage follows XDG => No more creepy "GNUStep" directory.

screenshot

screenshot

requirements

  • libpulse
  • ncurses
  • gnustep-base
  • gcc-objc (for compilation)
  • ninja (for compilation)

installation

# ./mk install

usage

Note: There is also an introductory video available here, thanks to @gotbletu.

Note: man pacmixer is your friend now as well.

pacmixer comes with built-in help, but here's the shortcuts reference, just in case.

h (or Left): Moves to the previous control.
l (or Right): Moves to the next control.
k (or Up): Increases the volume standardly.
K (or Shift+Up): Increases the volume fastly.
j (or Down): Decreases the volume standardly.
J (or Shift+Down): Decreases the volume fastly.
m: Mutes the volume.
d: Sets as default.
i: Enters inside mode.
s: Enters settings mode.
q (or Esc): Exits settings/inside mode or exit the application.
F1-F5 (or 1-5): Switches to All/Playback/Recording/Outputs/Inputs view, respectively.
F12 (or 0): Switches to Settings view.

settings view

Used to change card wise settings (e.g. profiles).

h (or Left): Moves to the previous group of settings.
l (or Right): Moves to the next group of settings.
k (or Up): Moves to the previous setting within group.
j (or Down): Moves to the next setting within group.
space: (Un)checks highlighted setting.
q (or Esc): Exits the application.

inside mode

Used to adjust specific channel's volume.

All shortcuts (besides q) work the same, except that they affect single channel instead of the whole sink/source.

settings mode

Used to change controls settings (e.g. ports).

Shortcuts work like in outside mode, except that:

  • space is used to check setting.
  • h and l iterate only over controls which actually have settings.

configuration

Pacmixer uses toml based configuration file stored in either $XDG_CONFIG_HOME/pacmixer/settings.toml or $HOME/.config/pacmixer/settings.toml.

When run for the first time, it will create a new file with all configuration options set to their defaults. You can use this file as a basis and/or checkout the reference below.

[Display]

StartScreen (string) - Sets which screen should be visible when starting pacmixer. Available values are "All", "Playback", "Recording", "Outputs", "Inputs" and "Settings".

[Control]

UpSpeed (integer) - Sets the speed of the standard volume up command.

FastUpSpeed (integer) - Sets the speed of the fast volume up command.

DownSpeed (integer) - Sets the speed of the standard volume down command.

FastDownSpeed (integer) - Sets the speed of the standard volume down command.

[Filter]

Monitors (boolean) - Filters out Monitor controls.

Internals (boolean) - Filters out PA internal controls.

Options (boolean) - Filters out Options part of the controls.

[Log]

Dir (string) - Directory where log file(s) will be stored. Leave empty string to disable logging.

something's broken?

Please include the log file ($HOME/.local/share/pacmixer/pacmixer.log by default) with your bug report.

If it crashes hard (i.e. SEGFAULTS), it might also be useful to compile in debug mode and run through gdb to retrieve stacktrace.

$ ./mk debug
$ gdb ./pacmixer
gdb$ run
gdb$ bt

That will make it easier to identify the problem.

tests

Type

$ ./mk tests
$ ./pacmixer_run_tests

Note: It is a Catch executable, all options apply.

pacmixer's People

Contributors

fuzzynovagoblin avatar kenjitakahashi avatar tobbez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pacmixer's Issues

pacmixer does weird things on mousewheel in urxvt

$TERM is rxvt-unicode-256color

pacmixer exhibited a few curious reactions on the use of the mouse wheel over the channel levels. Sometimes characters would appear, other times the screen would go down by a half to show black, once I got a large green block.

characters like:
38;5;6m(B
[48;5;2m
%H;1m
e

It was so weird I thought I'd try use asciinema to capture it, but it comes out on that double worse than it actually looked. What I saw was the menu text at the top be pushed along to the right by characters 'inserted' before. In this capture I saw characters were inserted at various places then the screen scroll downward to black.

It segfaulted at couple of times also.

Also, on pressing q I saw some weird characters again and had to Ctrl-c to exit.

pacmixer depending on specific version of libgnustep-base

OS: Arch Linux 5.12.5

Was getting the following error when trying to run pacmixer:

pacmixer: error while loading shared libraries: libgnustep-base.so.1.27: cannot open shared object file: No such file or directory

libgnustep-base was updated to 1.28.0 in Arch core package repository, causing my system to lose libgnustep-base.so.1.27. I patched this locally by symlinking /usr/lib/libgnustep-base.so.1.27 to /usr/lib/libgnustep-base.so.

I would submit a PR for this myself, but it's been a while since I've worked with languages that require linking. Seems like if we could get pacmixer to link to the symlinked (versionless) libgnustep-base.so instead of directly to libgnustep-base.so.1.27, we could fix this for future version updates.

Broken in Archlinux

Hi, I saw that you also submitted this to AUR, so I thought I'd post this here.

I am getting this error when attempting to start pacmixer.

pacmixer: error while loading shared libraries: libpanelw.so.5: cannot open shared object file: No such file or direct

Thanks for the tool!

SIGABRT on launch

version 0.6, abort on launch:

gdb$ run
Starting program: /usr/bin/pacmixer 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid

Program received signal SIGABRT, Aborted.
-----------------------------------------------------------------------------------------------------------------------[regs]
  RAX: 0x0000000000000000  RBX: 0x0000000000741F88  RBP: 0x00007FFFF648B700  RSP: 0x00007FFFFFFFD238  o d I t s z a P c 
  RDI: 0x00000000000044EB  RSI: 0x00000000000044EB  RDX: 0x0000000000000006  RCX: 0x00007FFFF6121528  RIP: 0x00007FFFF6121528
  R8 : 0x00007FFFF648C770  R9 : 0x00007FFFF7F46780  R10: 0x0000000000000008  R11: 0x0000000000000206  R12: 0x0000000000741FC0
  R13: 0x00007FFFFFFFD960  R14: 0x0000000000634DA0  R15: 0x0000000000000000
  CS: 0033  DS: 0000  ES: 0000  FS: 0000  GS: 0000  SS: 002B                
-----------------------------------------------------------------------------------------------------------------------[code]
=> 0x7ffff6121528 <raise+56>:   cmp    rax,0xfffffffffffff000
   0x7ffff612152e <raise+62>:   ja     0x7ffff6121550 <raise+96>
   0x7ffff6121530 <raise+64>:   repz ret 
   0x7ffff6121532 <raise+66>:   nop    WORD PTR [rax+rax*1+0x0]
   0x7ffff6121538 <raise+72>:   test   ecx,ecx
   0x7ffff612153a <raise+74>:   jg     0x7ffff612151b <raise+43>
   0x7ffff612153c <raise+76>:   mov    edx,ecx
   0x7ffff612153e <raise+78>:   neg    edx
-----------------------------------------------------------------------------------------------------------------------------
0x00007ffff6121528 in raise () from /usr/lib/libc.so.6
gdb$ bt
#0  0x00007ffff6121528 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff612293a in abort () from /usr/lib/libc.so.6
#2  0x00007ffff6c8ab3d in __gnu_cxx::__verbose_terminate_handler () at /build/gcc/src/gcc-5-20150519/libstdc++-v3/libsupc++/vterminate.cc:95
#3  0x00007ffff6c88996 in __cxxabiv1::__terminate (handler=<optimized out>) at /build/gcc/src/gcc-5-20150519/libstdc++-v3/libsupc++/eh_terminate.cc:47
#4  0x00007ffff6c889e1 in std::terminate () at /build/gcc/src/gcc-5-20150519/libstdc++-v3/libsupc++/eh_terminate.cc:57
#5  0x00007ffff6c88bf8 in __cxxabiv1::__cxa_throw (obj=0x741f50, tinfo=0x7ffff6f6fa78 <typeinfo for std::logic_error>, dest=0x7ffff6c9e040 <std::logic_error::~logic_error()>) at /build/gcc/src/gcc-5-20150519/libstdc++-v3/libsupc++/eh_throw.cc:87
#6  0x00007ffff6cb18bf in std::__throw_logic_error (__s=__s@entry=0x7ffff6d37100 "basic_string::_S_construct null not valid") at /build/gcc/src/gcc-5-20150519/libstdc++-v3/src/c++11/functexcept.cc:74
#7  0x00007ffff6ccbcef in std::string::_S_construct<char const*> (__beg=<optimized out>, __end=<optimized out>, __a=...) at /build/gcc/src/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:577
#8  0x00007ffff6ccc0e6 in _S_construct_aux<char const*> (__a=..., __end=<optimized out>, __beg=0x0) at /build/gcc/src/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.h:4136
#9  _S_construct<char const*> (__a=..., __end=<optimized out>, __beg=0x0) at /build/gcc/src/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.h:4157
#10 std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string (this=0x7fffffffd450, __s=0x0, __a=...) at /build/gcc/src/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:659
#11 0x000000000040ee3a in pacmixer::Settings::Settings() ()
#12 0x000000000040ab13 in -[TUI init] ()
#13 0x000000000040b57b in -[Dispatcher init] ()
#14 0x0000000000405859 in main ()


pacmixer seg fault

Running pacmixer as an unprivileged user on Debian jessie causes a Segmentation fault upon execution. Running the debug build fails to produce a log. All tests using pacmixer_run_tests succeed. Running pacmixer as root produces a "Waiting for connection..." dialog.

Add direct controls through the CLI

It would be nice to have arguments to this program. E.g.:

  • pacmixer --vol +1
  • pacmixer --mute and pacmixer --unmute
  • etc

Said commands would apply for the default device.
This would allow for extensibility and allow using it from other programs.

I would try to implement this myself, but I don't know objective C at all.

Edit: The intention with this is to be able to use the volume keys to lower or raise the volume. I don't know if there is a specific API that, for example, alsamixer used to achieve this.

Localized (non-English) strings are rendered incorrectly

I am using sk_SK.utf8 locales on my system and pacmixer is giving me this:

  ┌Ports─┐
  │V  stup
  │Reprod│
  │Sl  cha
  └──────┘
  Vstavan 

instead of this:

  ┌Ports─┐
  │Výstup
  │Reprod│
  │Slúcha
  └──────┘
  Vstavaný

Name Missing

Hey i love the idea of this project.
My issue is that the name of each volume doesnt show up.
I tried on two different terminal, Guake and Terminator with the same results.

Here is a Screenshot
http://ompldr.org/vZnFkZQ

Using the package from Arch AUR

Archlinux segfault

I get a segfault on archlinux on two different machines both when I install from the AUR:

pacman -Qi pacmixer
Name           : pacmixer
Version        : 0.6.2-2
...

Or when I build from source. I am not sure whether I am missing a dependency because I have had some sort of issue since the pulseaudio split. The error only occurs when I have a program running such as pianobar or skype both of which were installed from the community.

My backtrace:

(gdb) bt     │  │     │  │
#0  0x00007ffff61690ca in strlen () from /usr/lib/libc.so.6
#1  0x00007ffff78dcbc6 in ?? () from /usr/lib/libgnustep-base.so.1.24
#2  0x00007ffff78da417 in ?? () from /usr/lib/libgnustep-base.so.1.24
#3  0x000000000042005e in callback_add_func (self_=0x7c5ed0, 
    name=0x7fffe4027260 "libao[pianobar]", type=<optimized out>, idx=47, 
    data=0x7fffeabfdac0) at src/middleware.m:110
#4  0x0000000000407ddc in _cb_client (c=0x7c68e0, info=0x7fffeabfdb20, eol=0, 
    userdata=0x7fffe400dbc0) at src/backend.c:209
#5  0x00007ffff69ba813 in ?? () from /usr/lib/libpulse.so.0
#6  0x00007ffff415c801 in ?? () from /usr/lib/pulseaudio/libpulsecommon-7.1.so
#7  0x00007ffff415cb8b in pa_pdispatch_run ()
   from /usr/lib/pulseaudio/libpulsecommon-7.1.so
#8  0x00007ffff69b072e in ?? () from /usr/lib/libpulse.so.0
#9  0x00007ffff415f3ff in ?? () from /usr/lib/pulseaudio/libpulsecommon-7.1.so
#10 0x00007ffff4161a5b in ?? () from /usr/lib/pulseaudio/libpulsecommon-7.1.so
#11 0x00007ffff4161e09 in ?? () from /usr/lib/pulseaudio/libpulsecommon-7.1.so
#12 0x00007ffff416269a in ?? () from /usr/lib/pulseaudio/libpulsecommon-7.1.so
#13 0x00007ffff69c5817 in pa_mainloop_dispatch () from /usr/lib/libpulse.so.0
#14 0x00007ffff69c5c1c in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#15 0x00007ffff69c5cc0 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#16 0x00007ffff69d3ee6 in ?? () from /usr/lib/libpulse.so.0
#17 0x00007ffff41725f8 in ?? () from /usr/lib/pulseaudio/libpulsecommon-7.1.so
#18 0x00007ffff4bb84a4 in start_thread () from /usr/lib/libpthread.so.0
#19 0x00007ffff61d113d in clone () from /usr/lib/libc.so.6

install method is not work for me

  1. At first, I git clone the project
  2. then I try to follow the installation to install pacmixer, and the terminal log output an error :
    install: cannot stat 'pacmixer': No such file or directory

i have to check the mk.sh, and i saw this:
install -m 755 pacmixer "${BIN}"
and i don't have "pacmixer" file in my folder

Is there any way that I can install pacmixer?

pacmixer produces segfault

Just running pacmixer produces a segfault - both as regular user and as root (thus the separate issue). pulseaudio is running (pavucontrol works fine). Maybe something not "usual": I have set PULSE_SERVER=localhost, because I am logging remotely into this raspberry pi (where I see the segfault) and don't want to control the pulseaudio on my laptop. Again, pavucontrol and any playing software is fine with this, and I am not sure if this has anything to do with the segfault.

Finally, when I compile the debug version and run pacmixer in gdb I get the following backtrace:

[New Th ead 0xb08c4420 (LWP 29761)]
Program received signal SIGSEGV, Segmentation fault.0c4420 (LWP 29762)]
[Switching to Thread 0xb00c4420 (LWP 29762)] [Thread 0xb08c4420 (LWP 297610xb6c833a8 in ?? () from /usr/lib/libgnustep-base.so.1.22
(gdb) bt
#0 0xb6c833a8 in ?? () from /usr/lib/libgnustep-base.so.1.22
#1 0xb6d3d5a8 in ?? () from /usr/lib/libgnustep-base.so.1.22
#2 0x00010dcc in callback_add_func (self_=0xb6ab1000, name=0xb6ab2258 "", type=1072456340, idx=0,

data=0xb00c3944) at src/middleware.m:43

#3 0x00018c90 in _cb_sink (c=0xe2178, info=0xb00c39a8, eol=0, userdata=0xdd498)

at src/backend.c:23

#4 0xb6af64bc in ?? () from /usr/lib/arm-linux-gnueabihf/libpulse.so.0

Cannot access memory at address 0x1
#5 0xb6af64bc in ?? () from /usr/lib/arm-linux-gnueabihf/libpulse.so.0

Cannot access memory at address 0x1
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Sometimes cruft can get left on the terminal

I've seen this most commonly while holding down an arrow key to quickly bring the level of a control up/down - basically it looks like some control codes (colors or whatever) get printed onto the screen rather than interpreted "properly", and it can end up remaining on the screen regardless of what you do. For example:

pacmixer_cruft

Generally you can clean it up by using F1-F5 to change the rendered controls. I may end up looking into this myself, though I've added a ^L hotkey which completely redraws the screen in my big ol' pull request here: #15 ... I may just make do with that.

GNUstep folder?

why does it always generate the folder called GNUStep in the Home directory?

Is there a way to make it a hidden folder like all the other config files?

Add possibility for max volume.

Using the volume-wheel on my keyboard I'm able to to set the volume way too high, to the point of extreme distortion of the sound output. It would be great if max-volume could be set in config.

pacmixer crashes in settings dialog

hi,

thanks for pacmixer! i've compiled the program on debian testing and it works as expected except the settings dialog: it show no settings and crashes as soon as i use the 'l' key or the right arrow key
with the message : Uncaught exception NSRangeException, reason: Index 0 is out of range 0 (in 'objectAtIndex:')

pacmixer-log.txt

if you need the debug log, i can recompile and attach that

Uncaught exception NSInvalidArgumentException

Hello,
i hope you still develop this, it's exactly what i need and totally awesome :)

But when i go to settings tab and want to change the card's profile, pacmixer crashes with
"Uncaught exception NSInvalidArgumentException, reason: Can not determine type information for -[Options down:]"

Log contents (deleted before, opened pacmixer, let it crash, contents below):

[2015-08-13 22:26:17](src/backend.c:175):B:server state changed to 1
[2015-08-13 22:26:17](src/backend.c:175):B:server state changed to 2
[2015-08-13 22:26:17](src/backend.c:175):B:server state changed to 3
[2015-08-13 22:26:17](src/backend.c:175):B:server state changed to 4
[2015-08-13 22:26:17](src/middleware.m:89):M:volumeChanged20_0_0 observer added
[2015-08-13 22:26:17](src/middleware.m:89):M:volumeChanged20_0_1 observer added
[2015-08-13 22:26:17](src/middleware.m:100):M:muteChanged20_0 observer added
[2015-08-13 22:26:17](src/middleware.m:101):M:20:Internes Audio Analog Stereo received
[2015-08-13 22:26:17](src/main.mm:83):D:20:Internes Audio Analog Stereo passed
[2015-08-13 22:26:17](src/widgets/widget.mm:43):F:20:Internes Audio Analog Stereo posted
[2015-08-13 22:26:17](src/widgets/widget.mm:159):F:20:Internes Audio Analog Stereo options added
[2015-08-13 22:26:17](src/middleware.m:141):M:volumeChanged20_0 observer added
[2015-08-13 22:26:17](src/middleware.m:89):M:volumeChanged22_2_0 observer added
[2015-08-13 22:26:17](src/middleware.m:89):M:volumeChanged22_2_1 observer added
[2015-08-13 22:26:17](src/middleware.m:100):M:muteChanged22_2 observer added
[2015-08-13 22:26:17](src/middleware.m:101):M:22:Monitor of Internes Audio Analog Stereo received
[2015-08-13 22:26:17](src/main.mm:83):D:22:Monitor of Internes Audio Analog Stereo passed
[2015-08-13 22:26:17](src/widgets/widget.mm:43):F:22:Monitor of Internes Audio Analog Stereo posted
[2015-08-13 22:26:17](src/middleware.m:141):M:volumeChanged22_2 observer added
[2015-08-13 22:26:17](src/main.mm:83):D:0:Internes Audio passed
[2015-08-13 22:26:17](src/middleware.m:141):M:activeOptionChanged0_4 observer added
[2015-08-13 22:26:17](src/widgets/widget.mm:211):F:20:Internes Audio Analog Stereo set as default
[2015-08-13 22:26:17](src/widgets/widget.mm:211):F:22:Monitor of Internes Audio Analog Stereo set as default

maybe you (or somebody) knows how to fix it :)

System:
Lenovo ThinkPad L412
Manjaro XFCE (4.2-rc Kernel)
Soundchip: Intel HDA / ALC269 Analog

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.