Giter Site home page Giter Site logo

Pulseaudio, Yay or Nay? about cava HOT 12 CLOSED

karlstav avatar karlstav commented on July 17, 2024
Pulseaudio, Yay or Nay?

from cava.

Comments (12)

anko avatar anko commented on July 17, 2024

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?

from cava.

karlstav avatar karlstav commented on July 17, 2024

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.

from cava.

libf-de avatar libf-de commented on July 17, 2024

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

from cava.

karlstav avatar karlstav commented on July 17, 2024

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

anyone up for testing? @XorgMC

from cava.

jjrh avatar jjrh commented on July 17, 2024

@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"; )

from cava.

karlstav avatar karlstav commented on July 17, 2024

@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!

from cava.

libf-de avatar libf-de commented on July 17, 2024

@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 😐

from cava.

karlstav avatar karlstav commented on July 17, 2024

@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.

from cava.

jjrh avatar jjrh commented on July 17, 2024

@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?

from cava.

karlstav avatar karlstav commented on July 17, 2024

@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.

from cava.

jjrh avatar jjrh commented on July 17, 2024

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.

from cava.

karlstav avatar karlstav commented on July 17, 2024

pulseaudio is now implemented.

from cava.

Related Issues (20)

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.