You are not logged in.

#1 2012-05-11 03:16:53

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,097
Website

ponymix - CLI PulseAudio volume control

This project was previously known as pulsemix.

Like many of my other projects, I've written this because I've been unhappy with the current offerings and I felt I could do better.

This was basically a 1 day hack to create a simple CLI pulseaudio controller. It's quite rudimentary, but it gets the job done. I know there's various scripts around to do this via pacmd, but I dislike parsing command output when volume control should be straightforward. I know about pamixer, but I think it's insane to use boost for option parsing when something like getopt exists, and I don't really care for the interface it provides. Despite that, pamixer gets a bunch of credit for making this as easy as it was to duct tape together. As of this posting, it's ~450 lines of C with no dependencies beyond pulse.

usage: ponymix [options] <command>...

Options:
 -h, --help,        display this help and exit
 -s, --sink <name>  control a sink other than the default

Commands:
  list               list available sinks
  get-volume         get volume for sink
  set-volume VALUE   set volume for sink
  increase VALUE     increase volume
  decrease VALUE     decrease volume
  mute               mute active sink
  unmute             unmute active sink
  toggle             toggle mute
  set-sink SINKNAME  set default sink

AUR: http://aur.archlinux.org/packages.php?ID=61976
git: https://github.com/falconindy/ponymix

Feature requests and bug reports welcome.

Last edited by falconindy (2012-08-16 04:05:28)

Offline

#2 2012-05-11 04:35:16

MOPSTER
Member
From: Aruba
Registered: 2012-03-26
Posts: 15

Re: ponymix - CLI PulseAudio volume control

You seem to have put a link to cower in the package instead of to pulsemix, haha. Besides that this looks really great! is it  possible to set the volume above 100% with this? If it could, I'm sold and I'd even install pulse again!

Offline

#3 2012-05-11 15:44:19

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,097
Website

Re: ponymix - CLI PulseAudio volume control

Yeah, that should just magically work. There's currently no cap on how high you can go, so caveat emptor...

Last edited by falconindy (2012-05-11 15:45:38)

Offline

#4 2012-05-11 16:38:25

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: ponymix - CLI PulseAudio volume control

thanks, also like that it can get >100%.

found some problems though:
- "set-sink" doesn't work. it says "unknown action". seems like a check missing in string_to_verb()
- "list" only outputs one of my two sinks
- when I increase by n it actually increases by n-1 / when I decrease by n it actually decreases by n+1 . but that's a little nitpicking and not really a problem. wink

Offline

#5 2012-05-11 18:47:24

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,097
Website

Re: ponymix - CLI PulseAudio volume control

65kid wrote:

- "set-sink" doesn't work. it says "unknown action". seems like a check missing in string_to_verb()

Yep, spot on. Fixed.

65kid wrote:

- "list" only outputs one of my two sinks

Crappy linked list logic on my part. It should be fixed (and I really need to find a way to test this).

65kid wrote:

- when I increase by n it actually increases by n-1 / when I decrease by n it actually decreases by n+1 . but that's a little nitpicking and not really a problem. wink

Aww, my lazy rounding has been caught. It's less lazy now.

Thanks. In the meantime, I've also added a cap of 150% on volumes. Over that is probably not useful due to clipping. If you desperately want to go above this, set-volume is unbounded.

Offline

#6 2012-05-11 19:35:56

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: ponymix - CLI PulseAudio volume control

all fixed, thanks. smile

150% cap makes sense, pavucontrol also doesn't allow any higher.

Offline

#7 2012-05-12 05:38:46

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 6,856

Re: ponymix - CLI PulseAudio volume control

Haven't checked, but did you mention this project on the PA mailing list? Seems like something that should be put on their website.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#8 2012-11-23 22:14:49

MrTolkinghorn
Member
Registered: 2011-05-29
Posts: 8

Re: ponymix - CLI PulseAudio volume control

YES! thank you so much. I was having so much trouble finding a script to do this. I just needed something light weight and fast to go directly to the pulse audio and get the current volume or modify it / toggle the mute. Thank you so much.

Offline

Board footer

Powered by FluxBB