karlstav / cava

Cross-platform Audio Visualizer
MIT License
4.34k stars 233 forks source link

FreeBSD/sndio issue #392

Closed plasmoduck closed 4 years ago

plasmoduck commented 4 years ago

Hi there, can you create a new feature for cava that picks up any audio input from alsa, pulseaudio etc. Say I'm listening to a music video on YouTube in my browser so cava can display the audio visualisation. Perhaps this feature can be started with a flag like 'cava -l' for listen.

karlstav commented 4 years ago

Not sure if I understand. Cava already picks up audio from specified alsa or pulseaudio interface.

If pulseaudio is installed it should use the default output automatically. This will work out of the box in most cases.

Are you suggesting to listen to all inputs it can find, simultaneously? And visualize everything? On top of each other?

plasmoduck commented 4 years ago

At the moment cava ONLY works with ncmpcpp. Can you make it work with firefox etc also? So if Im watching some video/audio through firefox cava with pick it up.

On Tue, Oct 13, 2020 at 11:17:40PM -0700, karl wrote:

Not sure if I understand. Cava already picks up audio from specified alsa or pulseaudio interface.

If pulseaudio is installed it should use the default output automatically. This will work out of the box in most cases.

Are you suggesting to listen to all inputs it can find, simultaneously? And visualize everything? On top of each other?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.*

karlstav commented 4 years ago

I think you got cava confused with the built in visualizer in ncmpcpp.

Just read the readme on capturing audio:

https://github.com/karlstav/cava#capturing-audio

plasmoduck commented 4 years ago

Hmm, doesn't work for me. It only works with ncmpcpp/mpc etc

karlstav commented 4 years ago

then go through the readme step-by-step or read more about audio in linux here:

https://www.ghacks.net/2017/08/16/linux-audio-explained/

If you still cant get it working, feel free to post a bug report. Create a new issue and use the included template.

plasmoduck commented 4 years ago

Yes I've been though the readme. Problem is I use FreeBSD with Pulseaudio on an old 'Late 2012, 27" Core i5 iMac" as there is no alsa etc in FreeBSD and the Apple hardware may be limiting me.

karlstav commented 4 years ago

I use FreeBSD with Pulseaudio

now you tell me. This is probably the cause of your problem. Can you give me the output of pacmd list-sinks and pacmd list-sources? There is also sndio, but I fear it might be broken

plasmoduck commented 4 years ago

No PulseAudio daemon running, or not running as session daemon. for both commands.

On Tue, Oct 20, 2020 at 12:30:03AM -0700, karl wrote:

I use FreeBSD with Pulseaudio

now you tell me. This is probably the cause of your problem. Can you give me the output of pacmd list-sinks and pacmd list-sources? There is also sndio, but I fear it might be broken

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.*

karlstav commented 4 years ago

that complicates things, I think maybe your best bet is the sndio input.

plasmoduck commented 4 years ago

I tried that, following the instructions on the cava guide. I issue the -dd -s default -m mon -s monitor command then the AUDIODEVICE=snd/0.monitor cava command and cava launches but doesn't pickup any sound except for mpd/mpc/ncmpcpp I'm at a loss with this I think. It's not such a big deal I guess. Just would have been nice to look at cava when playing music through my browser on youtube.

On Fri, Oct 23, 2020 at 09:24:25AM -0700, karl wrote:

that complicates things, I think maybe your best bet is the sndio input.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.*

plasmoduck commented 4 years ago

This is the settings I use to get sound out my headphones on FreeBSD /boot/loader.conf

hint.pcm.2.eq=1 hint.pcm.3.eq=1 hint.hdaa.1.gpio_config="0=keep 1=keep 2=set 3=set"

On Fri, Oct 23, 2020 at 09:24:25AM -0700, karl wrote:

that complicates things, I think maybe your best bet is the sndio input.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.*

karlstav commented 4 years ago

strange that mpd still works. how does your cava config look? Did you remember to comment out the mpd input? It you used that earlier.

plasmoduck commented 4 years ago

I'm using fifo input

method = fifo source = /tmp/audio.fifo sample_rate = 44100 sample_bits = 16

thats the only one that works

karlstav commented 4 years ago

I meant fifo input.

if you use fifo input cava will only work for applications that output to the selected fifo. Firefox can not do that.

Unfortunately the sndio input is poorly documented in cava, try to set:

method = sndio

and comment out everything else.

then follow the instructions here:

https://github.com/karlstav/cava#sndio

plasmoduck commented 4 years ago

I tried that, it doesn't work with default for 'sndiod -dd -s default -m mon -s monitor' how can I get a list of the outputs to try?

karlstav commented 4 years ago

I would not know, don't really know FreeBSD/sndio.

plasmoduck commented 4 years ago

All good. I might close this issue then. Thanks for the help.