From owner-freebsd-multimedia@FreeBSD.ORG Wed May 16 16:09:57 2012 Return-Path: Delivered-To: multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57C961065673; Wed, 16 May 2012 16:09:57 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (unknown [IPv6:2a03:6f00:1::5c35:743c]) by mx1.freebsd.org (Postfix) with ESMTP id DC7818FC08; Wed, 16 May 2012 16:09:56 +0000 (UTC) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76) (envelope-from ) id 1SUgnT-00075v-8d; Wed, 16 May 2012 20:09:55 +0400 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id 256B2B84E; Wed, 16 May 2012 20:09:55 +0400 (MSK) Received: by hades.panopticon (Postfix, from userid 1000) id 1668170D; Wed, 16 May 2012 20:09:55 +0400 (MSK) To: FreeBSD-gnats-submit@freebsd.org From: Dmitry Marakasov X-send-pr-version: 3.113 X-GNATS-Notify: Message-Id: <20120516160955.1668170D@hades.panopticon> Date: Wed, 16 May 2012 20:09:55 +0400 (MSK) Cc: multimedia@FreeBSD.org Subject: [PATCH] audio/jack: ALSA driver is broken X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2012 16:09:57 -0000 >Submitter-Id: current-users >Originator: Dmitry Marakasov >Organization: >Confidential: no >Synopsis: [PATCH] audio/jack: ALSA driver is broken >Severity: serious >Priority: low >Category: ports >Class: sw-bug >Release: FreeBSD 9.0-RELEASE amd64 >Environment: System: FreeBSD hades.panopticon 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 10 01:33:18 MSK 2012 >Description: ALSA driver is broken: --- % jackd -d alsa jackd 0.121.3 Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others. jackd comes with ABSOLUTELY NO WARRANTY This is free software, and you are welcome to redistribute it under certain conditions; see the file COPYING for details could not open driver .so '/usr/local/lib/jack/jack_alsa.so': /usr/local/lib/jack/jack_alsa.so: Undefined symbol "clock_nanosleep" could not open driver .so '/usr/local/lib/jack/jack_alsa_midi.so': /usr/local/lib/jack/jack_alsa_midi.so: Undefined symbol "clock_nanosleep" jackd: unknown driver 'alsa' --- The cause: --- % grep -R clock_nanosleep work work/jack-audio-connection-kit-0.121.3/drivers/alsa-midi/alsa_rawmidi.c: clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, NULL); --- but this function is not supported on FreeBSD: --- % grep clock_nanosleep /usr/include/time.h /* XXX missing: clock_nanosleep() */ --- and though jack builds: --- /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I/usr/local/include -I../../config -I../.. -I../.. -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -g -O2 -pipe -march=nocona -fno-strict-aliasing -I../../config -I../.. -I../.. -D_ REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -g -MT alsa_rawmidi.lo -MD -MP -MF .deps/alsa_rawmidi.Tpo -c -o alsa_rawmidi.lo alsa_rawmidi.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I/usr/local/include -I../../config -I../.. -I../.. -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -g -O2 -pipe -march=nocona -fno-strict-aliasing -I../../config -I../.. -I../.. -D_REENTRANT -D_POSIX_PTHREAD_SEMANT ICS -Wall -g -MT alsa_rawmidi.lo -MD -MP -MF .deps/alsa_rawmidi.Tpo -c alsa_rawmidi.c -fPIC -DPIC -o .libs/alsa_rawmidi.o alsa_rawmidi.c: In function 'midi_thread': alsa_rawmidi.c:856: warning: implicit declaration of function 'clock_nanosleep' --- the driver is unuseable. Port maintainer (multimedia@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: CVS) >How-To-Repeat: Try to use ALSA driver >Fix: Since the second argument of clock_nanosleep (flags) is 0, ts still specifies a relative time, so theoretically the call may be replaced with simple nanosleep(&ts, NULL). I'm, however, unaware of differences between CLOCK_MONOTONIC and other clock types, as well as which of them is used by FreeBSD's nanosleep(), so it may have implications.