我插入了移动耳机(带麦克风的入耳式扬声器),但这个问题仍然弹出。
未知音频设备
您插入了哪种设备?
耳机 | 耳机 | 麦克风
取消 | 声音设置
文件系统中是否有地方可以对我的此设置进行硬编码?
anjanesh@anjanesh-Latitude-3560:~$ dpkg -l | grep -i jack
ii libjack-jackd2-0:amd64 1.9.9.5+20130622git7de15e7a-1ubuntu1 amd64 JACK Audio Connection Kit (libraries)
我的 Dell Latitude 3560 笔记本电脑上装有 Ubuntu 14.04 LTS。
答案1
我找到了这个窗口的源代码。它是unity-settings-daemon
位于的插件第 99 行plugins/media-keys/what-did-you-plug-in/dialog-window.c
(在dialog_create
函数中,稍后调用wdypi_dialog_run
):
88 gtk_window_set_title(GTK_WINDOW(d->dialog), _("Unknown Audio Device"));
...
99 d->label = gtk_label_new(_("What kind of device did you plug in?"));
...
103 d->hp_btn = create_icon_button(WDYPI_DIALOG_HEADPHONES, _("Headphones"), "audio-headphones");
...
106 d->hs_btn = create_icon_button(WDYPI_DIALOG_HEADSET, _("Headset"), "audio-headset");
...
110 d->mic_btn = create_icon_button(WDYPI_DIALOG_MICROPHONE, _("Microphone"), "audio-input-microphone");
...
115 d->cancel_btn = gtk_dialog_add_button(GTK_DIALOG(d->dialog), _("Cancel"), GTK_RESPONSE_CANCEL);
116 d->settings_btn = gtk_dialog_add_button(GTK_DIALOG(d->dialog), _("Sound Settings…"), GTK_RESPONSE_YES);
该对话框由 PulseAudio 事件显示参见 plugins/media-keys/gsd-media-keys-manager.c 第 2720 行:on_control_card_info_updated
调用pa_backend_card_changed
(然后它调用get_headset_ports
):
static headset_ports get_headset_ports(const pa_card_info *c)
{
headset_ports h = {NULL, NULL, NULL};
int i;
for (i = 0; i < c->n_ports; i++) {
pa_card_port_info *p = c->ports[i];
if (!strcmp(p->name, "analog-output-headphones"))
h.headphones = p;
else if (!strcmp(p->name, "analog-input-microphone-headset"))
h.headsetmic = p;
else if (!strcmp(p->name, "analog-input-microphone"))
h.headphonemic = p;
}
return h;
}
最后显示与on_wdypi_popup
和wdypi_dialog_run
。
在已安装的系统中,此短语(“你插入的是什么设备?”) 可以在以下位置找到:
unity-settings-daemon: /usr/lib/unity-settings-daemon/usd-test-media-keys
unity-settings-daemon: /usr/lib/unity-settings-daemon-1.0/libmedia-keys.so
根据源代码单击“声音设置”将打开unity-control-center sound
。
注意:该libjack-jackd2-0:amd64
软件包已预先安装在干净的 Ubuntu 14.04 LTS 上。
$ aptitude why libjack-jackd2-0:amd64
i gstreamer1.0-plugins-good Depends libjack-jackd2-0 (>= 1.9.5~dfsg-14) | libjack-0.116
$ aptitude why gstreamer1.0-plugins-good
i rhythmbox Depends gstreamer1.0-plugins-good (>= 1.0.6)
声音由 PulseAudio 维护,然后由 Unity Settings Daemon 维护。