Skip to content

Commit a345734

Browse files
committed
ready for 0.4.1
1 parent 7b58f6e commit a345734

File tree

4 files changed

+47
-29
lines changed

4 files changed

+47
-29
lines changed

README.md

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
C.A.V.A.
1+
C.A.V.A. (M.P.)
22
====================
33

4-
**C**onsole-based **A**udio **V**isualizer for **A**LSA (now also with MPD and Pulseaudio support!)
4+
**C**onsole-based **A**udio **V**isualizer for **A**LSA (**M**PD and **P**ulseaudio)
55

66
by [Karl Stavestrand](mailto:[email protected])
77

@@ -141,7 +141,7 @@ All distro specific instalations sources might be out of date.
141141
Capturing audio
142142
---------------
143143

144-
### From Pulseaudio monitor source (New, easy and experimental!)
144+
### From Pulseaudio monitor source (Easy, default if supported)
145145

146146
First make sure you have installed pulseaudio dev files and that cava has been built with pulseaudio support (it should be automatically if the dev files are found).
147147

@@ -152,7 +152,7 @@ If you're lucky all you have to do is to uncomment this line in the config file
152152
If nothing happens you might have to use a different source then the default. The default might also be your microphone. Look at the config file for help.
153153

154154

155-
### From ALSA-loopback device
155+
### From ALSA-loopback device (Tricky)
156156

157157
If you want to capture audio straight fom the output (not just mic or line-in), you must create an ALSA loopback interface, then output the audio simultaneously to both the loopback and your normal interface.
158158

@@ -311,3 +311,14 @@ By default a configuration file is located in `$XDG_CONFIG_HOME/cava/config` or
311311
5=0.5
312312

313313
![3_139](https://cloud.githubusercontent.com/assets/6376571/8670181/9db0ef50-29e8-11e5-81bc-3e2bb9892da0.png)
314+
315+
Thanks
316+
------
317+
318+
Contributors:
319+
* [Karl Stavestrand](mailto:[email protected]) - creator
320+
* [CelestialWalrus](https://github.com/CelestialWalrus)
321+
* [anko](https://github.com/anko)
322+
* [livibetter](https://github.com/livibetter)
323+
324+
Also thanks to [dpayne](https://github.com/dpayne/) for figuring out how to find the pulseaudio default sink name.

cava.c

+15-19
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ int bars = 25;
8484
int autobars = 1;
8585
int stereo = -1;
8686
int M = 2048;
87+
char supportedInput[255] = "'fifo'";
8788

8889

8990

@@ -157,13 +158,22 @@ FILE *fp;
157158
// config: parse ini
158159
dictionary* ini = iniparser_load(configPath);
159160

161+
//setting fifo to defaualt if no other input modes supported
162+
inputMethod = (char *)iniparser_getstring(ini, "input:method", "fifo");
163+
164+
//setting alsa to defaualt if supported
160165
#ifdef ALSA
161-
inputMethod = (char *)iniparser_getstring(ini, "input:method", "alsa");
166+
strcat(supportedInput,", 'alsa'");
167+
inputMethod = (char *)iniparser_getstring(ini, "input:method", "alsa");
162168
#endif
163-
#ifndef ALSA
164-
inputMethod = (char *)iniparser_getstring(ini, "input:method", "fifo");
169+
170+
//setting pulse to defaualt if supported
171+
#ifdef PULSE
172+
strcat(supportedInput,", 'pulse'");
173+
inputMethod = (char *)iniparser_getstring(ini, "input:method", "pulse");
165174
#endif
166175

176+
167177
#ifdef NCURSES
168178
outputMethod = (char *)iniparser_getstring(ini, "output:method", "ncurses");
169179
#endif
@@ -245,23 +255,9 @@ void validate_config()
245255

246256
}
247257
if (im == 0) {
248-
#ifdef PULSE
249258
fprintf(stderr,
250-
"input method '%s' is not supported, supported methods are: 'pulse', 'alsa' and 'fifo'\n",
251-
inputMethod);
252-
#endif
253-
#ifndef PULSE
254-
#ifdef ALSA
255-
fprintf(stderr,
256-
"input method '%s' is not supported, supported methods are: 'alsa' and 'fifo'\n",
257-
inputMethod);
258-
#endif
259-
#endif
260-
#ifndef ALSA
261-
fprintf(stderr,
262-
"input method '%s' is not supported, supported methods are: 'fifo'\n",
263-
inputMethod);
264-
#endif
259+
"input method '%s' is not supported, supported methods are: %s\n",
260+
inputMethod, supportedInput);
265261
exit(EXIT_FAILURE);
266262
}
267263

changelog

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2016-02-10 - 0.4.1
2+
3+
new features:
4+
- added auto pulseaudio source mode
5+
- pulsaudio is now default
6+
- cava is now cavamp
7+
- pushing 'r' now reloads audio
8+
- Added console title
9+
10+
bugfixes:
11+
- Error on Raspbian at run-time when running from installed path
12+
113
2015-11-22 - 0.4.0
214

315
- added pulseadio support

example_files/config

+5-6
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434

3535
[input]
3636

37-
# method of capturing audio, supported input methods are: 'pulse', 'alsa' or 'fifo'.
38-
# Defaults to 'alsa'
37+
# method of capturing audio, possible methods are: 'pulse', 'alsa' or 'fifo'.
38+
# Defaults to 'pulse', 'alsa' or 'fifo', in that order, dependent on what support cava was built with
3939
#
4040
# All input methods uses the same config variable 'source'
4141
# to define where it should get the audio.
@@ -45,16 +45,15 @@
4545
#
4646
# for alsa 'source' will be the capture device. Default: 'hw:Loopback,1'
4747
# for fifo 'source' will be the path to fifo-file. Default: '/tmp/mpd.fifo'
48+
; method = pulse
49+
; source = auto
50+
4851
; method = alsa
4952
; source = hw:Loopback,1
5053

5154
; method = fifo
5255
; source = /tmp/mpd.fifo
5356

54-
; method = pulse
55-
; source = auto
56-
57-
5857

5958

6059
[output]

0 commit comments

Comments
 (0)