お知らせ

  • 利用規約を守って投稿してください。また、よくある質問および投稿の手引きも参照してください。
  • メッセージの投稿にはアカウントが必要です。未登録の方は、ユーザ登録ページからアカウントを作成することができます。
  • インデックス
  •  » ハードウェア
  •  » Ubuntu 22.04 LTS にて Focusrite USB オーディオインターフェースで利用可能なサンプリングレートが誤認識される

#1 2022-05-02 22:22:00

h1romas4
新しいメンバ
登録日: 2022-05-02

Ubuntu 22.04 LTS にて Focusrite USB オーディオインターフェースで利用可能なサンプリングレートが誤認識される

Ubuntu 20.04 LTS から Ubuntu 22.04 LTS アップグレード後に Focusrite 社の USB オーディオインターフェース(Focusrite Scarlett Solo USB)で利用可能なサンプリングレートが ALSA snd-usb-audio から誤認識されるようになりました。
(このため Jack などで 96KHz 等高いサンプリングレードが設定できなくなり弱っております…)

Ubuntu 20.04 LTS では Rates: が正しく 44100, 48000, 88200, 96000, 176400, 192000 と申告される:

コード:

$ uname -a
Linux hiromasa-t420s 5.13.0-40-generic #45~20.04.1-Ubuntu SMP Mon Apr 4 09:38:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

$ cat /proc/asound/USB/stream0
Focusrite Scarlett Solo USB at usb-0000:00:1d.0-1.2, high speed : USB Audio

Playback:
  Status: Stop
  Interface 1
    Altset 1
    Format: S32_LE
    Channels: 2
    Endpoint: 0x01 (1 OUT) (SYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000 # 【正しい】
    Data packet interval: 125 us
    Bits: 24
    Channel map: FL FR

Ubuntu 22.04 LTS ではRates: が 44100, 48000 のみとなってしまう:

コード:

$ uname -a
Linux thinkpad-p14s 5.15.0-27-generic #28-Ubuntu SMP Thu Apr 14 04:55:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

$ cat /proc/asound/USB/stream0
Focusrite Scarlett Solo USB at usb-0000:07:00.4-2, high speed : USB Audio

Playback:
  Status: Stop
  Interface 1
    Altset 1
    Format: S32_LE
    Channels: 2
    Endpoint: 0x01 (1 OUT) (SYNC)
    Rates: 44100, 48000 # 【誤認識】
    Data packet interval: 125 us
    Bits: 24
    Channel map: FL FR

カーネルのソースを追ってみて確信はないものの次のコミットが影響しているのかと考えましたが、"set of sampling rates per altsetting" 部分の知識がなく、うまく回避する方法が分かりませんでした。

ALSA: usb-audio: Filter out unsupported sample rates on Focusrite devices

コード:

/*
 * Many Focusrite devices supports a limited set of sampling rates per
 * altsetting. Maximum rate is exposed in the last 4 bytes of Format Type
 * descriptor which has a non-standard bLength = 10.
 */
static bool focusrite_valid_sample_rate(struct snd_usb_audio *chip,
                    struct audioformat *fp,
                    unsigned int rate)

正しい設定方法や調査方法など、ご助言いただけると幸いです。

オフライン

 

#2 2022-05-03 01:13:31

h1romas4
新しいメンバ
登録日: 2022-05-02

Re: Ubuntu 22.04 LTS にて Focusrite USB オーディオインターフェースで利用可能なサンプリングレートが誤認識される

調査を少し進めまして、次の snd-usb-audio workaround フラグを立てるとサンプリングレートが(フィルターされず?)全て返ってくるようになり、PulseAudio 経由で 44100, 48000 以外のサンプリングレートでサウンドの再生ができるようになりました。

quirk_flags

quirk_flags

    Contains the bit flags for various device specific workarounds. Applied to the corresponding card index.

            bit 0: Skip reading sample rate for devices

scarlett.confを追加し quirk_flags で Skip reading sampe rate for devices を指定:

コード:

$ cat /etc/modprobe.d/scarlett.conf
options snd_usb_audio vid=0x1235 pid=0x8211 device_setup=1 quirk_flags=0x1

Rates: 44100, 48000 が Rates: 44100, 48000, 88200, 96000, 176400, 192000 と正しく(?)なった。

コード:

sudo cat /proc/asound/USB/stream0
Focusrite Scarlett Solo USB at usb-0000:07:00.4-2, high speed : USB Audio

Playback:
  Status: Running
    Interface = 1
    Altset = 1
    Packet Size = 144
    Momentary freq = 96000 Hz (0xc.0000)
  Interface 1
    Altset 1
    Format: S32_LE
    Channels: 2
    Endpoint: 0x01 (1 OUT) (SYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000  #【全て返ってきた】
    Data packet interval: 125 us
    Bits: 24
    Channel map: FL FR

ただ jackd はうまく起動できないようです。

コード:

$ /usr/bin/jackd -dalsa -dhw:USB -r96000 -p1024 -n2
jackdmp 1.9.20
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2021 Filipe Coelho.
jackdmp 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
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
`default' server already active
Failed to open server

おそらく ALSA で "bit 0: Skip reading sample rate for devices" しているためだと思います。(フラグを外すと起動しますが、サンプリングレートに 48000 以上を指定しても 48000 に落とされます)

quirk_flags を使わないのが正しい対応方法かと思っておりますが、引き続き、なにかお気づきの点がありましたら、お教えいただけると幸いです。

オフライン

 

#3 2022-05-03 01:23:44

h1romas4
新しいメンバ
登録日: 2022-05-02

Re: Ubuntu 22.04 LTS にて Focusrite USB オーディオインターフェースで利用可能なサンプリングレートが誤認識される

ただ jackd はうまく起動できないようです。

大変失礼しました。前言撤回で、jacked が起動しないのは既に別の jackd が起動していたためでした。 先の投稿のコマンドラインでサンプリングレート 96000 指定で正しく起動できました。

自己完結してしまいましたが、Focusrite Scarlett Solo USB オーディオインターフェースで 48000 を超えるサンプリングレートが設定できない場合は、quirk_flags=0x1 を指定するのがいったんのワークアラウンドになりそうです。

コード:

$ cat /etc/modprobe.d/scarlett.conf
options snd_usb_audio vid=0x1235 pid=0x8211 device_setup=1 quirk_flags=0x1

ワークアラウンドではない対応方法などありましたら、お教えいただけると嬉しいです。

オフライン

 
  • インデックス
  •  » ハードウェア
  •  » Ubuntu 22.04 LTS にて Focusrite USB オーディオインターフェースで利用可能なサンプリングレートが誤認識される

Board footer

Powered by FluxBB