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

Add FreeBSD support #400

Closed
wants to merge 6 commits into from
Closed

Add FreeBSD support #400

wants to merge 6 commits into from

Conversation

valpackett
Copy link
Contributor

@valpackett valpackett commented Nov 23, 2018

(re: #283)

  • OSS backend works fine
  • ALSA backend is crackling (probably resampling related; that happens other apps too), do not use (wasn't used in jack1 either)
  • D-Bus works fine
  • tested with Carla, Cadence, qjackctl
  • using POSIX semaphores because I'm currently too lazy to write a thing for umtx (futex equivalent)
    • does any platform need O_RDWR in semaphores?
    • would any platform complain about beginning the semaphore path with /?
  • also needs -fPIC to build the OSS adapter, I'm not sure where in waf I should enable PIC

@7890 7890 added the FreeBSD Bug or feature related to using JACK on FreeBSD label Jan 16, 2019

namespace Jack
{
struct JackRequest;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tab

struct JackRequest;
struct JackResult;

class JackPosixMutex;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tab


static inline char CAS(volatile UInt32 value, UInt32 newvalue, volatile void* addr)
{
return atomic_cmpset_32((uint32_t*)addr, value, newvalue);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tab

@7890
Copy link
Contributor

7890 commented Feb 6, 2019

This PR looks good to me, I think we should probably merge it away. Are there any opinions from other FreeBSD users? If possible please also attach a full verbose build log.

@@ -0,0 +1 @@
../linux/driver.h
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to figure out something better for this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand. Is this about naming, licenses and such or about technical shortcomings?

@yurivict
Copy link

@myfreeweb Could you please squash all commits into one?

@valpackett
Copy link
Contributor Author

@yurivict hmm, why?

@7890 @falkTX can someone please answer the questions from the original post:

does any platform need O_RDWR in semaphores?

would any platform complain about beginning the semaphore path with /?

I'm not sure where in waf I should enable PIC

@yurivict
Copy link

@yurivict hmm, why?

Difficult to add 6 lines, need to maintain the proper order of patches, etc.
I tried to add them into the port but there are patching problems. You probably need to rebase.

Also, __FreeBSD_kernel__ isn't needed.

@valpackett
Copy link
Contributor Author

If you want to test in ports, you can just fetch from my branch. If you want to commit a port already… isn't it a bit early? :)

@7890
Copy link
Contributor

7890 commented Feb 17, 2019

From man sem_open:

Both read and write permission should be granted to each class of user that will access  the  semaphore.

This hints at that O_RDWR is correct.

From man sem_overview:

Named semaphores
A named semaphore is identified by a name of the form /somename; that is, a  null-terminated string  of  up to NAME_MAX-4 (i.e., 251) characters consisting of an initial slash, followed by one or more characters, none of which are slashes.

Like shared memory handles for shm_open, semaphores should start with a slash. I think this rule isn't strictly enforced, any name without slashes in the middle should work. I speculate that using a leading slash wouldn't be problematic on any platform. However there are different semaphore name length limits on different platforms (see OSX max. client name length).

@0EVSG
Copy link
Contributor

0EVSG commented Aug 8, 2021

@falkTX Could you please elaborate on your review above (freebsd/driver.h, Feb 6. 2019)?

If it's about using symlinks, there's the option of a relay #include with relative path.

Otherwise, it's probably also acceptable to drop the ALSA backend on FreeBSD, which refers to driver.h. As for uptime.h, either just duplicate it (it's small), or add the linux directory to the include paths when compiling the DBUS controller?

FYI, jack2 v1.9.16 is now in the FreeBSD ports, taken from a branch in my repo. It is based on these commits plus a separate, overhauled OSS driver taylored to FreeBSD. I intend to make an up-to-date pull request for that, thus my interest in how to fix this.

@yurivict
Copy link

yurivict commented Aug 8, 2021

FYI: Jack2 is now available in FreeBSD ports: https://www.freshports.org/audio/jack/

@0EVSG
Copy link
Contributor

0EVSG commented Dec 21, 2021

Closing this, superseded by #800 which includes most of the work in this pull request.
Thanks everybody for your contributions!

@0EVSG 0EVSG closed this Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FreeBSD Bug or feature related to using JACK on FreeBSD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants