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

Unable to Run #9

Closed
austinphilp opened this issue Apr 25, 2015 · 11 comments
Closed

Unable to Run #9

austinphilp opened this issue Apr 25, 2015 · 11 comments

Comments

@austinphilp
Copy link

gettting an error
error opening stream: Operation not permitted
cava: pcm_params.c:2288: snd_pcm_hw_refine: Assertion `pcm && params' failed.
Aborted (core dumped)
upon trying to start the program.

@ghost
Copy link

ghost commented Apr 25, 2015

Try using mpd's FIFO: cava -i fifo -p /tmp/mpd.fifo (/tmp/mpd.fifo is path to your mpd's fifo)

@karlstav
Copy link
Owner

Are you using a loopback interface?

If so are you using the correct alsa device with cava?

Cava uses hw:1,1 by default. can you give me the output of your 'aplay -l'?

@austinphilp
Copy link
Author

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC1150 Analog [ALC1150 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC1150 Digital [ALC1150 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

@austinphilp
Copy link
Author

using celestrial walrus' suggestion(except replacing mpd's fifo with piano bar's) works to start the application but the bars stay at minimal height and don't move. the connection to the fifo is comfirmed by pianobar

@karlstav
Copy link
Owner

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 (either with asounc.conf settings or pulseaudio's "combined-sink"). Look in the readme for more info.

Reading about pianopar's fifo here http://linux.die.net/man/1/pianobar, it doesn't look like pianobar's fifo is an audio output, but a control input. So I guess your stuck with the options above.

@livibetter
Copy link
Contributor

I think I just discovered an interesting way to test and run with FIFO for very rough testing. I don't have MPD and have no idea what data MPD feed into FIFO, never ran cava with FIFO input before.

I was thinking about send in some PCM audio, though not sure if that would work, better to check the code first before wasting time. So I opened up the cava.c and skimmed through the fifomusic function.

Immediately, I typed in this:

./cava -i fifo -p /dev/urandom

@austinphilp I believe that you could test with this, if you see bars bouncing that means cava does work with FIFO. As @karlstav stated, either you get some input or switch to MPD. (Does MPD have plugin for Pandora?)

Off-topic: since urandom is uniform, I was expecting to see most of bars are somewhat leveled, but they ain't. More or less like an uphill slope. Hmm, what are those frequency ranges of the bands/bars?

2015-04-29--19 33 25

(2015-04-29T11:43:24Z edited: I might be presuming the RNG's property over to the audio wrong)

@karlstav
Copy link
Owner

@livibetter that's indeed an interesting way to check the fifo input.

The reason for it not being level is because cava equalizes the Fourier-transformed audio signal quite heavily. If it didn't the higher frequencies would be almost invisible. I'm still not 100% sure why this is. But i have three theories:

  1. the FFT does something with the audio signal
  2. I'm using the fftw library wrong
  3. In most audio treble is generally lower then base in amplitude value.

@ghost
Copy link

ghost commented Apr 30, 2015

@livibetter see #8

@ghost
Copy link

ghost commented May 1, 2015

@livibetter @karlstav cava -i fifo -p /dev/null -b 60 gives somewhat weird output. /dev/zero is OK.

@livibetter
Copy link
Contributor

@CelestialWalrus the read reads zero bytes, so every iteration, whatever in buf[] is used, which is never initialized, if:

memset(buf, (signed char) 0, 1024);

It would look like using /dev/zero.

I think that else clause in the loop should be like:

else if (bytes > 0) {
  // ...
} else {
  // read zero bytes, sleep some time, or hogging CPU
}

Apologizing to @austinphilp, guess we are hijacking with /dev/*.

After @CelestialWalrus mentioned, /dev/null, I tried this:

cava -i fifo -p /dev/stdin

Press some keys, then [Enter] as a few times. Just for fun.

@karlstav
Copy link
Owner

karlstav commented May 4, 2015

closing this as it sort of drifted of topic. I hope @austinphilp made it work eventually, if you need more help just reopen or send me an email.

@karlstav karlstav closed this as completed May 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants