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

OS X support? #316

Open
ronilaukkarinen opened this issue May 25, 2017 · 32 comments
Open

OS X support? #316

ronilaukkarinen opened this issue May 25, 2017 · 32 comments

Comments

@ronilaukkarinen
Copy link

Would love to use this on my Macbook Pro. Any thoughts for OS X support? homebrew has most of the packages and OS X is mostly unix after all.

@juanrubio
Copy link
Member

Hi Roni,

I think it would be great to have OS X support. Unfortunately, I don't own any OS X device, so right now I'm trying to prioritise those platforms that I'm more familiar with. Snap packaging (almost there) and dockerization are next in my list. I believe OS X would run on Virtualbox, so I will leave this issue open in case someone wants to contribute any patches or I have some time to work on it.

Thanks for showing interest!

@juanrubio juanrubio added this to the v0.11.0 milestone Oct 21, 2017
@a06kin
Copy link

a06kin commented Nov 24, 2017

Hi @juanrubio

I have OSX device. Now I'm trying to compile using autoreconf and make. I will give some update and I will definitely ask questions;

Update for now:

  • autoreconf -ifs
configure.ac:85: warning: macro 'AM_PATH_LOG4C' not found in library
configure.ac:87: error: possibly undefined macro: AM_PATH_LOG4C
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/local/Cellar/autoconf/2.69/bin/autoconf failed with exit status: 1

TODO: brew install log4c

  • autoreconf -ifs

DONE

  • ./configure
checking python module: soundcloud... no
configure: error: failed to find required module soundcloud
configure: error: ./configure failed for libtizsoundcloud
configure: error: ./configure failed for soundcloud
configure: error: ./configure failed for clients

TODO: easy_install soundcloud

  • ./configure
checking for uuid_generate in -llibuuid... no
checking for uuid >= 2.19.0... no
configure: error: Package requirements (uuid >= 2.19.0) were not met:

No package 'uuid' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables UUID_CFLAGS
and UUID_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
configure: error: ./configure failed for libtizplatform

TODO: brew install ossp-uuid -> FAIL with version
TODO: PKG_CHECK_MODULES([UUID], [uuid >= 2.19.0]) -> 1.6.2

@juanrubio
Copy link
Member

Hey!,
@a06kin, thanks for trying!

Unfortunately, I don't have an OSX device and my attempts at using a VirtualBox VM have not been very fruitful. So if you get to a working recipe to build on a mac, I would love to have that added to the project docs somewhere!

@a06kin
Copy link

a06kin commented Dec 2, 2017

I have some updates

  • autoreconf -ifs && ./configure
checking for dbus-1 >= 0.60... no
configure: error: You need the DBus libraries (version 0.6 or better)
	http://www.freedesktop.org/wiki/Software_2fdbus
configure: error: ./configure failed for libtizrmproxy
configure: error: ./configure failed for rm

TODO: brew install dbus

  • ./configure
checking for dbus-c++-1 >= 0.6.0-pre1... no
configure: error: Package requirements (dbus-c++-1 >= 0.6.0-pre1) were not met:

No package 'dbus-c++-1' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables DBUS_CFLAGS
and DBUS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
configure: error: ./configure failed for libtizrmproxy
configure: error: ./configure failed for rm

TODO: compile&install https://github.com/andreas-volz/dbus-cplusplus

  • ./configure
checking for oggz >= 1.1.1... no
configure: error: Please install liboggz version 1.1.1 or later.
configure: error: ./configure failed for ogg_demuxer
configure: error: ./configure failed for plugins

TODO: brew install liboggz

  • ./configure
checking for opusfile >= 0.5... no
configure: error: Please install libopusfile version 0.5 or later.
configure: error: ./configure failed for opusfile_decoder
configure: error: ./configure failed for plugins

TODO: brew install opusfile

  • ./configure
checking for sndfile >= 1.0.25... no
configure: error: Package requirements (sndfile >= 1.0.25) were not met:

No package 'sndfile' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBSNDFILE_CFLAGS
and LIBSNDFILE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
configure: error: ./configure failed for pcm_decoder
configure: error: ./configure failed for plugins

TODO: brew install libsndfile

  • ./configure
checking for alsa... no
configure: error: Package requirements (alsa) were not met:

No package 'alsa' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables ALSA_CFLAGS
and ALSA_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
configure: error: ./configure failed for pcm_renderer_alsa
configure: error: ./configure failed for plugins

OSX has no alsa; Only CoreAudio;
I need to check code and rewrite parts with alsa;

@juanrubio
Copy link
Member

juanrubio commented Dec 2, 2017

There are two OpenMAX IL pcm renderers in Tizonia, one based on Alsa and the other based on PulseAudio.

I don't know if it is feasible to install PulseAudio on OSX. Apparently there is a formula which appears to be active?
http://brewformulas.org/Pulseaudio

If this is a viable route, then a top-level configure option could be added to disable the Alsa renderer on OSX. For testing purposes, you can disable locally by removing pcm_renderer_alsa from both configure.ac and Makefile.am files located in this directory:

https://github.com/tizonia/tizonia-openmax-il/tree/master/plugins

@juanrubio
Copy link
Member

Let me know if PulseAudio is doable on OSX, and I'll add a top-level "--disable-alsa" configure option.

@a06kin
Copy link

a06kin commented Dec 3, 2017

@juanrubio PulsaAlsa is ok on osx;
I found pcm_renderer_alsa; But I can't get simple way to disable it;

--disable-alsa will be great

@a06kin
Copy link

a06kin commented Dec 3, 2017

Oh. Just read your first comment; I will try "removing pcm_renderer_alsa from both configure.ac and Makefile.am";
Will give you feedback;

@a06kin
Copy link

a06kin commented Dec 3, 2017

OSX don' have epoll;
I found that you have support for KQUEUE;

@juanrubio how to set up to use kqueue?

@a06kin
Copy link

a06kin commented Dec 3, 2017

Some updates

  • ./configure
checking for alsa... no
configure: error: Package requirements (alsa) were not met:

No package 'alsa' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables ALSA_CFLAGS
and ALSA_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
configure: error: ./configure failed for pcm_renderer_alsa
configure: error: ./configure failed for plugins

TODO: disable alsa

  • ./configure

DONE

  • make
ld: library not found for -lboost_python

TODO: brew install boost-python

  • make
error: too many arguments to function call, expected 1, have 2

TODO: fix code (ignore argument) !!!BAD TEMPORARY SOLUTION!!!

  • make
fatal error: 'sys/epoll.h' file not found

TODO: support for KQUEUE

  • make
error: use of undeclared identifier 'MSG_NOSIGNAL'

TODO: set MSG_NOSIGNAL to 0

  • make
fatal error: 'fishsound/constants.h' file not found

TODO: brew install libfishsound

  • make
fatal error: 'vpx_decoder.h' file not found

Strange. libvpx is installed;
vpx is not in -I/usr/include/vpx;

TODO: fix Makefile.am

  • make
fatal error: 'fileref.h' file not found

Same as vpx_decoder
TODO: fix Makefile.am

  • make

DONE

  • make install

DONE

@a06kin
Copy link

a06kin commented Dec 3, 2017

I compiled and install tizonia;

But on start

tizonia --youtube-audio-stream https://www.youtube.com/watch?v=Eg6f4ZFRpsI

I get

Assertion failed: (p_queue_), function post_cmd, file tizgraphmgr.cpp, line 409.
[1]    39867 abort      tizonia --youtube-audio-stream https://www.youtube.com/watch\?v\=Eg6f4ZFRpsI

@juanrubio
Copy link
Member

juanrubio commented Dec 3, 2017

OK, I've created an issue for the top-level configure option

#402

So you've managed to get all the dependencies and workarounds in place to get Tizonia to build. That's great progress!.

As for the crash, we need to figure out what's going on.

First step would be to enable logging to see if that gives us a clue:

  • under config/src you will find a log4crc file.
  • copy this file to "$HOME/.log4crc" (note the dot)
  • then either uncomment the following line
<!--         <category name="root" priority="error" appender="tizlogfile"/> -->

and replace tizlogfile with stdout or leave tizlogfile and just customise this to log on a location of your choosing:

	<appender name="tizlogfile" type="rollingfile" logdir="/tmp" prefix="tizonia.log" layout="tiz" rollingpolicy="tizrolling" />

Of course, a gdb backtrace would be super useful too (I believe it can be installed with homebrew too). You can run like this:

$ gdb --args tizonia --youtube-audio-stream "https://www.youtube.com/watch?v=Eg6f4ZFRpsI"

When it crashes, press b, to get the backtrace.

Thanks!

@juanrubio
Copy link
Member

juanrubio commented Dec 4, 2017

Let me know if PulseAudio is doable on OSX, and I'll add a top-level "--disable-alsa" configure option.

This is now implemented in #402. But please note that the actual option is --without-alsa, i.e.

./configure --without-alsa

@tizonia tizonia removed this from the v0.11.0 milestone Feb 11, 2018
@KyleChamberlin
Copy link

@juanrubio @a06kin

It looks like this has gone largely dormant, is there any active work being done here? I would be happy to pick up where @a06kin left off. I read through the thread here, is there any other documentation I should check out?

Thanks in advance for any help bringing me up to speed.

@juanrubio
Copy link
Member

juanrubio commented Aug 29, 2018

@KyleChamberlin :

It would be awesome if someone could pick this up. So thanks in advance if you can do it.

From what I remember, @a06kin was able to compile and install Tizonia (with various functionalities disabled) and he got his first crash while using one of the YouTube options. So I guess one way to start is to try to reproduce up to that point and obtain some backtraces from the crash with GDB. With that, we could investigate the root cause and plan for the next step.

This is the main document to read for building instructions etc.
https://github.com/tizonia/tizonia-openmax-il/blob/master/BUILDING.md

This comment has some info on how to enable logging in Tizonia, etc, which will be essential for this task.

And if there's anything you need, don't hesitate to ask!

@ronilaukkarinen
Copy link
Author

Any progress on this? would really like to try this out.

@tizonia
Copy link
Collaborator

tizonia commented May 19, 2019

@ronilaukkarinen

Thanks for the interest. I would love to see this going somewhere too!. Unfortunately, there has not been any progress in a long time. I do not own a Mac device, so I'm really unable to help here...

@ronilaukkarinen
Copy link
Author

I understand, but still decided to ping as I'm constantly searching for some lighter way to listen music via command line and this would be perfect (always ending up to browse this repo, hah). I have a Macbook I use daily in both free time and for work (web development) but Linux/unix-programming is not my strongest suit. I could try to build and test more in some point if that helps, maybe next weekend or so.

@tizonia
Copy link
Collaborator

tizonia commented May 25, 2019

@ronilaukkarinen

Yes, I think that would definitely help. Please use this thread to record your findings. I would be able to provide some support, like adding configure option to disable features that are not fully functional, etc. It would be good to get to the point where at least the core parts of the app/framework are buildable. That would make further steps easier.

@kikieri
Copy link

kikieri commented Jul 20, 2019

Fall in love with this player please make it on MacOSX happen? How can the community help? Is there any new progress?

@tcheronneau
Copy link

Hey @juanrubio @tizonia,
I'm trying to pick up from where it was.
It's quite long and not so easy.
I'll try and come back to you if/when needed and will keep all my steps documented.

@tcheronneau
Copy link

So I've manage to build it.
But of course with some change more or less important so not working at the end.
@tizonia is there a way to have the KQUEUE ? Because epoll is not supported on OSX and it's not working since I've totally removed from include.
The others changes should not impact the app in my opinion.

@tizonia
Copy link
Collaborator

tizonia commented Sep 5, 2019

Hi @tcheronneau!,

First of all, many thanks for looking into the OS X port. This is really amazing, lots of people keep asking for OS X support. I don't own an Apple device but I'll try to help where I can.

There seems to be a way to select the kqueue backend in libev. I've looked around, and I have found this:
ocsigen/lwt#87 (comment)

Please have a look at the entire thread. The solution seems to be linked at the bottom.

I hope it helps!

@tcheronneau
Copy link

So I managed to make it work with kqueue.
Now I've the same error as @a06kin :
Assertion failed: (p_queue_), function post_cmd, file tizgraphmgr.cpp, line 409.

@tcheronneau
Copy link

So I've tried to setup log files or put stdout but I think tizonia does not read the file log4crc.
In fact I can't make the config file work neither.
I've also tried to debug with gdb but nothing is showed.

@tcheronneau
Copy link

Hey @tizonia I'll probably your help to debug this one.

@DominicCodespoti
Copy link

@tcheronneau Hey, I managed to get Mac OSX support working on my device through playing around with the Docker convenience script and installing pulseaudio on the host device through brew. I pushed the changes I made to get it working on my other account here: dominic-codespoti/docker-tizonia-mac-support@395cc90

@lgbaldoni
Copy link
Contributor

I've just submitted an initial meson PR.
I tried building it on OSX and it seems to me most things are available from homebrew, but I got stuck on a compilation issue involving pthread_setname_np().

Perhaps the people who've managed to fix the source could share their modifications so that the meson script can be adapted?

By the way, the newer libuuid 2.34 is also buildable. Assuming it's necessary, someone could create and submit a bottle.

@ronilaukkarinen
Copy link
Author

@DominicCodespoti That's really awesome! As I'm a docker newbie, could you provide step-by-step instructions how to run this on a mac? I'm dying to stream some music via command line. Thanks in advance!

@matthewarmand
Copy link
Member

Hey all, this isn't a native solution but thanks in large part to @DominicCodespoti 's efforts, the docker-tizonia repo now has Mac OSX support.

The README now contains instructions specific to Mac setup, and the docker-tizonia helper script now recognizes Mac host machines and will behave accordingly. That script along with the setup instructions should work fine with the latest image available in DockerHub, which is running the latest release of Tizonia (0.21.0).

@ronilaukkarinen , assuming you've installed and set up Docker based on their docs, the instructions in the README along with the helper script should be enough to get you up and running; feel free to reach out if you have any additional questions or trouble.

@ronilaukkarinen
Copy link
Author

@matthewarmand Nice, thanks a lot for your effort! I'll give it a go soon!

@irishgordo
Copy link

@matthewarmand @DominicCodespoti

Rad!
I'll check it out too soon!

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

No branches or pull requests

10 participants