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

Pulseaudio, Yay or Nay? #66

Closed
karlstav opened this issue Aug 21, 2015 · 12 comments
Closed

Pulseaudio, Yay or Nay? #66

karlstav opened this issue Aug 21, 2015 · 12 comments
Labels

Comments

@karlstav
Copy link
Owner

Looking at other visualizer like projectM, I think pulseaudio is able to grab audio directly from sink. This would eliminate the need for the complicated 'alsa loopback'+'pulseaudio combined sink' setup.

Now I know a lot of people don't like pulseaudio. I use it, mostly because it came with my disrto and it works. The alsa part will of course be kept as an option.

I think this will also require a configure script that checks for the presence of alsa or pulseaudio and creates the makefile accordingly.

So is it worth it making cava able to use pulseaudio directly? Do people use pulseaudio?

@anko
Copy link
Contributor

anko commented Aug 21, 2015

I prefer ALSA, but an adapter specifically for PulseAudio makes sense if it eases config.

I think this will also require a configure script that checks for the presence of alsa or pulseaudio and creates the makefile accordingly.

Why? I'm not familiar with doing optional dependencies in C, but couldn't we always compile with both the ALSA and PA headers, and use whichever the user specifies in config?

@karlstav
Copy link
Owner Author

Why? I'm not familiar with doing optional dependencies in C, but couldn't we always compile with both the ALSA and PA headers, and use whichever the user specifies in config?

I think optional dependencies in C is pretty straight forward. The thing is that I don't want to make cava dependent on things that people don't want to install. I remember some years back when pulseaudio was implemented in to the ubuntu there was a lot of criticism and looks like there still is some. So I just wanted to but the question out there, see what people thought.

@libf-de
Copy link

libf-de commented Oct 4, 2015

I'm using pulseaudio (currently with pulseaudio-alsa and "default" device), so it would be really useful for me to see "real" pulseaudio integration

@karlstav
Copy link
Owner Author

an experimental pulseaudio support is now available in the config-scipt branch.

anyone up for testing? @XorgMC

@jjrh
Copy link

jjrh commented Nov 13, 2015

@karlstav There is a issue with how you create the stream,

pa_simple_new() failed: No such entity

I fixed this by doing

  if (!(s = pa_simple_new(NULL, "cava", PA_STREAM_RECORD, NULL, "audio for cava", &ss, NULL, &pb, &error))) {
    fprintf(stderr, __FILE__": pa_simple_new() failed: %s\n", pa_strerror(error));
    exit(EXIT_FAILURE);
  }

putting NULL instead of audio->source I don't really understand that stuff, only reason I figured this out is because I was playing with doing exactly what cava does with pulseaudio a couple days :)

http://freedesktop.org/software/pulseaudio/doxygen/simple_8h.html#add9a7dce4e15955d4296726c26206689

dev Sink (resp. source) name, or NULL for default

audio->source is: alsa_output.0.analog-stereo.monitor on my system.

There also doesn't appear to be a way to set this to do pulse with the -input flag. (I just hacked in inputMethod = "pulse"; )

@karlstav
Copy link
Owner Author

@jjrh all the options are now in the config file, you can change the source parameter there. Which will then be audio->source

cava now defaults to alsa_output.0.analog-stereo.monitor, I thought this whould be the monitor output of the default sink for most systems, but you are right I should use NULL instead. This will use the default source. Only problem is that this whould in most cases be the microphone, which is fun, but not really what we want. I guess what i actually want is to get the default SINK name and then append ".monitor" to it. Have to read more pulseaudio API first...

Also i should make a better error message.

Thanks for the feedback!

@libf-de
Copy link

libf-de commented Nov 14, 2015

@karlstav Working pretty good for me after finding out how to compile it 😆 but it differs really from the "classic" alsa version as you can see here: https://youtu.be/ifGube4V6sI
for my "eyes" the alsa version visualisation fits better to the music. and on first start, it visualized my microphone input, not the monitor (had to change it with pavucontrol) (no problem, just noticed). althrough, good work, keep it up 👍
both versions don't lag, it's just the recording on an 1st gen i5 😐

@karlstav
Copy link
Owner Author

@XorgMC it's hard to tell, try to compare it again, but use the same version of cava for alsa, also have both in either stereo or mono.

@jjrh
Copy link

jjrh commented Nov 16, 2015

@karlstav I think I had to go into pavucontrol and select the right sink, but after that it remembered.

Didn't know about the configuration stuff - I had only seen this project the other day looking for fft examples realized this is mostly what I was trying to accomplish but with pulseaudio.

Is the plan to remove the commandline options in favour of a config?

@karlstav
Copy link
Owner Author

@jjrh:

Is the plan to remove the commandline options in favour of a config?

yes, I like the idea of keeping it simple and having only one way to do things. But if alot of people object to this, maybe I'll bring the commandline options back.

@jjrh
Copy link

jjrh commented Nov 17, 2015

I would argue for command line options as for most people it's easier to copy and paste a command than it is to set a configuration file.

Having both is good, but I can appreciate the fact you now have to maintain two things now.

@karlstav
Copy link
Owner Author

pulseaudio is now implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants