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

RFC: Consider changing the playback backend to libao #101

Closed
ezequielgarcia opened this issue Jul 5, 2017 · 8 comments
Closed

RFC: Consider changing the playback backend to libao #101

ezequielgarcia opened this issue Jul 5, 2017 · 8 comments

Comments

@ezequielgarcia
Copy link

Why?

Ripping off mpg123's playback logic is smart, but it requires maintaining mpg123 as a third-party dependency.

OK, really, why?

To be completely honest, mpg123 failed to output properly with some simple tests. I was wondering how much of a rabbit hole the debugging would be when I remembered that a problem often has many solutions.

Why libao?

Libao is a cross-platform audio library that allows programs to output audio using a simple API on a wide variety of platforms. It currently supports:

  • Null output (handy for testing without a sound device)
  • WAV files
  • AU files
  • RAW files
  • OSS (Open Sound System, used on Linux and FreeBSD)
  • ALSA (Advanced Linux Sound Architecture)
  • aRts (Analog RealTime Synth, used by KDE)
  • PulseAudio (next generation GNOME sound server)
  • esd (EsounD or Enlightened Sound Daemon)
  • Mac OS X
  • Windows (98 and later)
  • AIX
  • Sun/NetBSD/OpenBSD
  • IRIX
  • NAS (Network Audio Server)
  • RoarAudio (Modern, multi-OS, networked Sound System)
  • OpenBSD's sndio

The API is really simple.

My proposal

See https://www.npmjs.com/package/libao.

Thanks

Thanks to @TooTallNate for writing node-speaker, from which I took most of the binding code.

@TooTallNate
Copy link
Owner

This is great!

@LinusU
Copy link
Collaborator

LinusU commented Jul 6, 2017

Awesome!

@ezequielgarcia
Copy link
Author

@TooTallNate so... you guys open to this idea? should I prepare and submit a PR to see how it goes?

I just have Linux systems, so not sure how can we get some mac and windows testing. Also, I'm wondering how much breakage we will get by changing the backend. Maybe we can make it optional (mpg123 or libao, via some build time parameter) for now?

@Flowr-es
Copy link

Flowr-es commented Jul 6, 2017

I suggest to make a new major version. Than the switch will be done via semver :)

@LinusU
Copy link
Collaborator

LinusU commented Jul 7, 2017

I think we should make it a major version, I can test on macOS

ezequielgarcia added a commit to ezequielgarcia/node-speaker that referenced this issue Jan 31, 2018
This commit is quite invasive, but results in a much
more simplified code, by using libao's simpler API.

Moreover, mpg123 was having issues and not always
playing correctly, requiring extra (and annoying) care.

Reference: TooTallNate#101
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
ezequielgarcia added a commit to ezequielgarcia/node-speaker that referenced this issue Feb 1, 2018
This commit is quite invasive, but results in a much
more simplified code, by using libao's simpler API.

Moreover, mpg123 was having issues and not always
playing correctly, requiring extra (and annoying) care.

Reference: TooTallNate#101
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
ezequielgarcia added a commit to ezequielgarcia/node-speaker that referenced this issue Feb 1, 2018
This commit is quite invasive, but results in a much
more simplified code, by using libao's simpler API.

Moreover, mpg123 was having issues and not always
playing correctly, requiring extra (and annoying) care.

Reference: TooTallNate#101
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
ezequielgarcia added a commit to ezequielgarcia/node-speaker that referenced this issue Feb 1, 2018
This commit is quite invasive, but results in a much
more simplified code, by using libao's simpler API.

Moreover, mpg123 was having issues and not always
playing correctly, requiring extra (and annoying) care.

Reference: TooTallNate#101
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
ezequielgarcia added a commit to ezequielgarcia/node-speaker that referenced this issue Feb 1, 2018
This commit is quite invasive, but results in a much
more simplified code, by using libao's simpler API.

Moreover, mpg123 was having issues and not always
playing correctly, requiring extra (and annoying) care.

Reference: TooTallNate#101
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
ezequielgarcia added a commit to ezequielgarcia/node-speaker that referenced this issue Feb 1, 2018
This commit is quite invasive, but results in a much
more simplified code, by using libao's simpler API.

Moreover, mpg123 was having issues and not always
playing correctly, requiring extra (and annoying) care.

Reference: TooTallNate#101
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
ezequielgarcia added a commit to ezequielgarcia/node-speaker that referenced this issue Feb 1, 2018
This commit is quite invasive, but results in a much
more simplified code, by using libao's simpler API.

Moreover, mpg123 was having issues and not always
playing correctly, requiring extra (and annoying) care.

Reference: TooTallNate#101
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
@dsteinman
Copy link

Whatever happened with this? Is this working? Does it work in Mac, Windows, and Linux??

If your code is working, and is not and will not be merged into the main branch, I'd suggest publishing a new npm package named speaker-libao

@ezequielgarcia
Copy link
Author

@dsteinman Sorry, I am no longer working or interested in nodejs. Feel free to pick up this and do whatever you want with it! :)

@dsteinman
Copy link

@dsteinman Sorry, I am no longer working or interested in nodejs. Feel free to pick up this and do whatever you want with it! :)

Okay, I may do that. There's a whole bunch of problems with the speaker package and this patch may help. Thanks for writing it!

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

5 participants