我有一个安装了jack-audio-connection-kit-1.9.9.5的gentoo amd64 Linux系统。
我尝试使用以下代码获取可用插孔输入设备列表:
#include <jack/jack.h>
#include <glib-2.0/glib.h>
const char **jack_get_input_devices() {
const char **ports;
const char *client_name = "tuxinstudio";
const char *server_name = NULL;
jack_options_t options = JackNoStartServer;
jack_status_t status;
jack_client_t *client;
client = jack_client_open(client_name,options,&status,server_name);
if (client == NULL) {
g_debug("jack client open failed. status 0x%2.0x",status);
}
if (status & JackServerStarted) {
g_debug("JACK server started\n");
}
if (status & JackNameNotUnique) {
client_name = jack_get_client_name(client);
g_debug("unique name `%s' assigned\n", client_name);
}
ports = jack_get_ports (client, NULL, NULL,JackPortIsPhysical|JackPortIsInput);
if (ports == NULL) {
g_debug("no physical capture ports\n");
}
g_print("sizeof ports: %lu",sizeof ports);
return ports;
}
看来千斤顶无法连接到dbus服务器。
这是执行的输出:
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
jack_get_ports called with a NULL client
如何解决此问题?
答案 0 :(得分:0)
问题出在jackdbus服务器上,我没有正确启动它。
我有一张火线声卡。 所以现在我使用以下内容:alsa_control start ds firewire
然后它就能正确连接到插孔。