You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

树莓派Google Assistant热词版Segmentation fault问题求助

Troubleshooting Segmentation Fault in googlesamples-assistant-hotword (When Demo Works)

Hey there, let's break down why you're hitting a segmentation fault with the hotword-enabled Assistant tool while the basic demo runs fine. Since the demo works, we can focus on differences between the two tools—primarily the hotword service's continuous audio capture, model dependencies, and permission requirements. Here are the most likely causes and how to debug them:

1. Mismatched Audio Hardware/Configuration

The googlesamples-assistant-hotword tool relies on continuous, low-latency audio capture for wake word detection, which is far more sensitive to system audio settings than the demo's on-demand capture. Even if your mic works for the demo, it might fail here due to:

  • Power-saving modes on USB microphones that cut off idle capture
  • Mismatched sample rates (the hotword tool expects 16kHz/16-bit mono by default)
  • Incorrect default input device selection

Debug Steps:

  • List your audio devices to confirm specs:
    arecord --list-devices
    
  • Force the hotword tool to use your specific mic with:
    googlesamples-assistant-hotword --audio-input-device plughw:X,Y
    
    (Replace X,Y with your mic's device numbers from the arecord output)
  • Disable any power-saving settings for your audio input device (check your system's sound settings or kernel modules).

2. Corrupted or Missing Hotword Model Files

Unlike the demo, the hotword tool requires pre-trained wake word models (e.g., "OK Google") to function. If these models weren't downloaded correctly during setup, the tool might crash with a segfault instead of a clear error message.

Debug Steps:

  • Locate your Assistant SDK data directory (typically ~/.config/google-oauthlib-tool/ or the folder where you installed the SDK) and check for model files with non-zero sizes.
  • Re-run the hotword setup process to re-download models:
    python -m pip install --upgrade google-assistant-sdk[samples]
    
    Then re-authenticate to ensure model files are pulled correctly.

3. Library or Kernel Compatibility Issues

Segmentation faults often stem from memory access errors, which can happen if the hotword service binary conflicts with your system's libraries or kernel version. The demo is a lightweight script, but the hotword tool runs a background service that's more sensitive to dependency mismatches.

Debug Steps:

  • Update your system libraries (for Debian/Ubuntu-based systems):
    sudo apt update && sudo apt upgrade libasound2 libssl-dev libgrpc-dev
    
  • Run the hotword tool with verbose logging to catch pre-segfault errors:
    GOOGLE_APPLICATION_CREDENTIALS=your_credentials.json googlesamples-assistant-hotword --verbose
    
  • Temporarily disable security modules like AppArmor or SELinux (with caution) to rule out permission-blocked memory access.

4. Incomplete OAuth Permissions

The hotword tool requires broader API scopes than the basic demo. If your OAuth credentials don't include the full Assistant SDK prototype scope, the tool might crash instead of throwing a permission error.

Debug Steps:

  • Go to your Google Cloud Console, navigate to your OAuth 2.0 Client ID, and verify it includes the scope:
    https://www.googleapis.com/auth/assistant-sdk-prototype
  • Re-generate your credentials file and re-authenticate with the full scope:
    google-oauthlib-tool --client-secrets your_client_secrets.json --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless
    

内容的提问来源于stack exchange,提问作者İlhan Akıllı

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 08:49:33