Chinese and English Voice Input on Ubuntu with Fcitx5-VInput and Alibaba Bailian

10 minute read

Published:

I wanted voice input on Ubuntu that could handle Chinese and English in the same sentence, including technical terms such as EtherCAT, PLC, Siemens, and Ubuntu. I already used Fcitx5 with a US keyboard and Wubi.

The working setup uses Fcitx5-VInput Lite with Alibaba Bailian cloud speech recognition. I hold Right Alt to speak, release it to finish, and the recognized text appears in the focused input field. Wubi remains available as before.

This post records the setup with fcitx5-vinput-lite version 2.3.25-1ppa1~noble1 on Ubuntu. Provider names and cloud model availability may change; the configuration below reflects the setup used in September 2026.

What Each Component Does

The input path is:

Microphone
    -> VInput daemon
    -> Bailian streaming speech recognition
    -> Fcitx5 VInput addon
    -> Focused application's input field

Fcitx5 handles desktop input integration. VInput captures audio and connects it to a recognition provider. Bailian runs the speech recognition model in the cloud.

The Lite package supports cloud recognition without installing the local ONNX runtime. The full package is the option for local recognition. For this cloud setup, I did not need to download a local speech model. See the project’s installation instructions.

VInput also supports LLM post-processing, but that is a separate step. I left it out initially so I could evaluate the speech recognizer’s own output.

Install VInput Lite

This assumes Fcitx5 is already installed and working in desktop applications. For Ubuntu 24.04, the project documents this PPA:

sudo add-apt-repository ppa:xifan233/ppa
sudo apt update
sudo apt install fcitx5-vinput-lite

If the PPA is already configured, only the installation command is needed.

Enable and start the user service:

systemctl --user enable --now vinput-daemon.service

If Fcitx5 was already running when the addon was installed, restart it to load the addon. This command replaces the existing instance and runs the new instance in the background, returning control to the terminal:

fcitx5 -rd

-r means --replace, not reload; -d runs Fcitx5 as a daemon. The local fcitx5 --help output confirms these options. This replaces the Fcitx5 process; it does not restart the VInput daemon.

With only fcitx5 -r, the new instance stays in the foreground and does not return a shell prompt while it runs. That is expected behavior. Pressing Ctrl+C terminates that instance and can stop input methods from working. If that has already happened, run fcitx5 -rd to start it again in the background.

Logging out and back in is another way to load the addon when Fcitx5 starts with the desktop session. If VInput already works, skip this restart step; it is not needed before each use.

Check the package, addon, and service:

dpkg-query -W fcitx5-vinput-lite
fcitx5-diagnose | grep -i vinput
systemctl --user status vinput-daemon.service --no-pager

My diagnostic output included:

Vinput 2.3.25

That confirms VInput appears in the diagnostic report. It does not establish that cloud recognition has been configured successfully.

VInput Is an Addon, Not Another Keyboard Layout

The Fcitx configuration window still listed only these active input methods:

Keyboard - English (US)
Wubi

That was expected. The installed VInput addon declares Category=Module; it does not need to be added as an ordinary input method alongside Wubi. Look under Addons for its Fcitx settings, and use vinput-gui for the recognition provider configuration.

Likewise:

fcitx5-remote -n

may return keyboard-us. This reports the current input method, not whether the VInput addon is installed or whether its cloud connection works.

Create a Bailian API Key

There are two Alibaba Cloud services that are easy to confuse:

ServiceConsole and credentials relevant here
Alibaba Cloud Model Studio / BailianThe cloud model platform used by this VInput provider; requires a Bailian API key
Intelligent Speech Interaction 2.0A separate speech service, whose console offers a temporary AccessToken

I initially opened the Intelligent Speech Interaction console at nls-portal.console.aliyun.com. Its temporary AccessToken is not the credential for the Bailian provider configured here. A free trial on that service also does not establish a free allowance for Bailian models.

To obtain the correct key:

  1. Open the Bailian console and sign in to an Alibaba Cloud account.
  2. Select China (Beijing), also labeled North China 2 (Beijing), and activate the service if prompted.
  3. Complete any account verification required by the console.
  4. Open API Key, create a key in the default workspace, and copy it into VInput locally.

Keys and endpoints are region-specific. A key from another region should not be paired with the Beijing endpoint below. The official API key guide explains the account, workspace, and region options.

Creating the key is free; model calls can incur usage charges. Check the selected model’s price, free allowance, and expiry in the console before regular use. VInput being free software does not make the cloud service free. See Bailian’s service overview.

Add the Streaming Recognition Provider

Open the VInput configuration application:

vinput-gui

Use its resource catalog to add the provider with this identifier:

bailian-qwen-audio3-stream

Alternatively, add it from the terminal:

vinput provider add bailian-qwen-audio3-stream

It appeared in my GUI as Bailian Qwen-Audio (Streaming). Use the provider identifier to distinguish it from bailian-stream: the adapters use different WebSocket protocols, so their names are not interchangeable. The Qwen-Audio provider documentation describes the required adapter.

Select the provider under Control → ASR Providers, click Edit, and enter these values in Env, one entry per line:

VINPUT_ASR_API_KEY=YOUR_BAILIAN_API_KEY
VINPUT_ASR_MODEL=qwen-audio-3.0-asr-flash-streaming
VINPUT_ASR_URL=wss://dashscope.aliyuncs.com/api-ws/v1/inference

Replace YOUR_BAILIAN_API_KEY with the actual key. Keep it out of screenshots, blog posts, and Git commits.

The model ID is an ASR model, not a general chat model. Alibaba’s speech recognition model guide currently recommends this model for real-time recognition and lists support for Chinese, English, and recognition context. I chose it for this workflow; I did not run a comparative accuracy benchmark.

The prompt supplies domain vocabulary to the recognizer. It is not an LLM rewriting stage or a separately provisioned weighted hotword dictionary, and it cannot guarantee correct spelling of every technical term.

The adapter documents the URL above as the legacy Beijing endpoint. It also supports workspace-specific endpoints. If using that route, omit the explicit URL and set VINPUT_ASR_WORKSPACE_ID as described in the adapter documentation; an explicit URL takes precedence.

Leave Optional Settings at Their Defaults First

The provider form also exposes these environment variables:

VariableInitial setting and purpose
VINPUT_ASR_LANGUAGELeave unset to avoid sending an explicit language hint
VINPUT_ASR_ENABLE_PUNCTUATIONKeep the default; this specifically controls semantic punctuation and sentence splitting
VINPUT_ASR_VAD_SILENCE_DURATION_MSKeep the default silence threshold for sentence splitting
VINPUT_ASR_TIMEOUTKeep the default network timeout
VINPUT_ASR_FINISH_GRACE_SECSKeep the default wait for final results after recording ends
VINPUT_ASR_WORKSPACE_IDNot needed when using the explicit URL above

These are configuration settings, not additional products to buy. Optional rows can remain blank in this adapter. Leaving the punctuation setting at its default does not mean that the transcript must contain no punctuation.

For the first test, I kept language hints unset and used the vocabulary prompt. Language hint behavior depends on the model; there is no universal rule that specifying Chinese prevents English recognition.

Save, Activate, and Dictate

In the configuration window:

  1. Save the provider edits and click Save Settings.
  2. Select Bailian Qwen-Audio (Streaming) and click Activate if available.
  3. Click Restart in the daemon section and wait for Running: idle.

The command-line equivalents for selecting the provider and restarting the daemon are:

vinput provider use bailian-qwen-audio3-stream
systemctl --user restart vinput-daemon.service

Click inside a text editor or chat input field. Hold Right Alt, speak, and release it to finish. Wait for the recognized text to be inserted.

My Fcitx addon settings used:

TriggerMode=Both

[TriggerKey]
0=Alt_R

[MenuKey]
0=Shift_R

With these settings, Right Alt supports both hold-to-talk and tap-to-toggle recording. Right Shift opens the VInput menu. These bindings can be changed, so check the addon configuration if your installation behaves differently.

A useful test is a sentence containing Chinese, English, and a domain-specific name, such as saying that a PLC uses EtherCAT to control three servo axes. Check whether the result preserves the technical terms before adding optional LLM correction.

Troubleshooting the Initial Setup

The daemon runs, but the log says ASR is disabled. Before I selected the cloud provider, the Lite build reported:

running with ASR disabled (Local ASR support is disabled in this Lite build.)

The service was alive, but the selected local backend could not work in the Lite build. Adding and activating the cloud provider resolved this setup issue.

The GUI says “configured,” but no text appears. Configuration status alone does not prove that authentication or model access works. Make a short recording, then inspect the daemon log:

journalctl --user -u vinput-daemon.service -n 50 --no-pager

For authentication errors, verify that the key comes from Bailian, matches the endpoint region, and has access to the selected model. For quota errors, check that model’s allowance and billing status in Bailian. Redact credentials before sharing logs.

Recording does not start or captures silence. Confirm that an application input field has focus and that Fcitx5 is working there. Check the Right Alt binding, then select the intended microphone under Capture Device in vinput-gui.

Recognition works, but technical words are wrong. Refine the domain prompt and test with the same sentences. Microphone quality, background noise, pronunciation, and the model all affect the result. Add LLM correction only after the basic transcription path works; it can introduce extra latency, cost, and unwanted wording changes.

The completed setup lets me dictate into desktop applications while retaining my existing keyboard and Wubi input methods. The essential pieces were the cloud-capable Lite package, the correct Bailian adapter, a matching regional API key, and activating that provider before recording.