AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题

问题[alsa](unix)

Martin Hope
jaimet
Asked: 2024-04-27 21:09:35 +0800 CST

alsa配置文件(如~/.asoundrc)是用什么语言编写的?

  • 5

以下是 alsa 配置文件的简短片段 ( /usr/share/alsa/pcm/default.conf):

pcm.!default {
        @args [ CARD ]
        @args.CARD {
                type string
                default {
                        @func getenv
                        vars [
                                ALSA_PCM_CARD
                                ALSA_CARD
                        ]
                        default {
                                @func refer
                                name defaults.pcm.card
                        }
                }
        }
...

这种语言是否存在于 之外alsa?如果存在,它是什么语言?

alsa
  • 1 个回答
  • 18 Views
Martin Hope
kr37
Asked: 2023-12-11 13:19:27 +0800 CST

如何为8通道Zoom R16设置ices2配置文件

  • 5

我是ices2和icecast2的新手,但确实设法建立了一个流,使我可以在耳塞中听到自己的声音。所以,该系统取得了一些基本的成功。现在,真正的目标:

我们希望使用 Zoom R16 录音机的音频接口功能流式传输 8 种不同的语言。通过arecord --dump-hw-params hw1,0在 R16 上执行,它返回:

Recording WAVE 'hw1,0' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "default":
--------------------
ACCESS:  RW_INTERLEAVED
FORMAT:  U8 S16_LE S16_BE S24_LE S24_BE S32_LE S32_BE FLOAT_LE FLOAT_BE MU_LAW A_LAW S24_3LE S24_3BE
SUBFORMAT:  STD
SAMPLE_BITS: [8 32]
FRAME_BITS: [8 1024]
CHANNELS: [1 32]
RATE: [1 384000]
PERIOD_TIME: (2 4294967295)
PERIOD_SIZE: [1 1398102)
PERIOD_BYTES: [128 1398102)
PERIODS: [3 1024]
BUFFER_TIME: (7 4294967295]
BUFFER_SIZE: [3 4194304]
BUFFER_BYTES: [384 4194304]
TICK_TIME: ALL
--------------------

问题1:中间有空格的数字是什么意思SAMPLE_BITS: [8 32]?这是否意味着样本位可以是 8、16 或 32?

问题2:如何解决“EROR input-alsa/alsa_open_module Sample format not available: Invalid argument”

当我尝试启动ices2时,它就退出了,日志显示:

[2023-12-10  20:48:46] INFO ices-core/main IceS 2.0.3 started...
[2023-12-10  20:48:46] EROR input-alsa/alsa_open_module Sample format not available: Invalid argument
[2023-12-10  20:48:46] EROR input/input_loop Couldn't initialise input module "alsa"
[2023-12-10  20:48:46] INFO ices-core/main Shutdown complete

我用于ices2的配置文件是:

<?xml version="1.0"?>
<ices>

    <!-- run in background  -->                     <background>0</background>

    <!-- where logs go. -->                            <logpath>/var/log/ices2</logpath>
                                                       <logfile>ices.log</logfile> 
    <!-- size in kilobytes -->                         <logsize>2048</logsize>
    <!-- 1=error, 2=warn, 3=infoa ,4=debug -->        <loglevel>4</loglevel>
    <!-- logfile is ignored if this is set to 1 --> <consolelog>0</consolelog>

    <!-- optional filename to write process id to -->  <pidfile>/var/log/ices2/ices.pid</pidfile> 

    <stream>
        <!-- metadata used for stream listing -->
        <metadata>
            <name>8 Languages</name>
            <genre>Dharma Teaching</genre>
            <description>Translation of 2024 International Spring Festival</description>
            <url>http://localhost/</url>
        </metadata>

        <!--    Input module.

            This example uses the 'alsa' module. It takes input from the
            ALSA audio device (e.g. line-in), and processes it for live
            encoding.  -->
        <input>
            <module>alsa</module>
            <param name="rate">48000</param>
            <param name="channels">8</param>
            <param name="device">hw:1,0</param>
            <param name="periods">2</param>
            <!-- Read metadata (from stdin by default, or -->
            <!-- filename defined below (if the latter, only on SIGUSR1) -->
            <param name="metadata">1</param>
            <param name="metadatafilename">testES</param>
        </input>

        <!--    Stream instance.

            You may have one or more instances here.  This allows you to
            send the same input data to one or more servers (or to different
            mountpoints on the same server). Each of them can have different
            parameters. This is primarily useful for a) relaying to multiple
            independent servers, and b) encoding/reencoding to multiple
            bitrates.

            If one instance fails (for example, the associated server goes
            down, etc), the others will continue to function correctly.
            This example defines a single instance doing live encoding at
            low bitrate.  -->

        <instance>
            <!--    Server details.

                You define hostname and port for the server here, along
                with the source password and mountpoint.  -->

            <hostname>localhost</hostname>
            <port>8000</port>
            <password>hackme</password>
            <mount>/spanish.ogg</mount>
            <yp>1</yp>   <!-- allow stream to be advertised on YP, default 0 -->

            <!--    Live encoding/reencoding:

                channels and samplerate currently MUST match the channels
                and samplerate given in the parameters to the alsa input
                module above or the remsaple/downmix section below.  -->

            <encode>  
                <quality>0</quality>
                <samplerate>24000</samplerate>
                <channels>8</channels>
            </encode>

            <!-- stereo->mono downmixing, enabled by setting this to 1 -->
            <downmix>0</downmix>

            <!-- resampling.
            
                Set to the frequency (in Hz) you wish to resample to, -->
             
            <resample>
                <in-rate>48000</in-rate>
                <out-rate>24000</out-rate>
            </resample>
        </instance>

    </stream>
</ices>

但总的来说,我想知道的是:

问题 3:需要在配置文件中添加哪些内容,以便记录器的通道 1 可以作为西班牙语进行流式传输,通道 2 作为法语进行流式传输,通道 3 作为德语进行流式传输,...通道 8。我假设我实际上需要 8 个不同的配置文件并运行ices2的8个实例,但如何选择正确的通道?

编辑:我还可以说这适用于录制 8 通道 wav 文件:

arecord -D hw:1,0 -f S32_LE -r 48000 -c 8 testr16.wav
alsa
  • 1 个回答
  • 25 Views
Martin Hope
TSG
Asked: 2023-12-01 02:24:49 +0800 CST

在两个进程之间共享音频输出设备

  • 5

两个进程是否可以共享(混合)音频流,每个进程都尝试将音频发送到单个输出设备?

我正在运行 AlmaLinux 9,并且仅与基本 ALSA 配对。但如果需要,我可以添加(返回)管道线。

我想使用“aplay”进行测试,但该解决方案应该适用于任何进程的音频输出。

alsa
  • 1 个回答
  • 14 Views
Martin Hope
JWZ1996
Asked: 2023-08-02 22:22:47 +0800 CST

Bluez + BlueAlsa:未收到 AVRCP 命令

  • 5

使用 dbus-monitor 时我看不到任何 AVRCP 通信。没有任何信号或属性发生变化。

我使用Bluez 5.68和BlueAlsa v4.1.0-7-ge6218b5

记录 BT 扬声器连接:

Aug 02 10:18:03 nuc058 kernel: input: Grundig JAM (AVRCP) as /devices/virtual/input/input21
Aug 02 10:18:03 nuc058 systemd-logind[557]: Watching system buttons on /dev/input/event4 (Grundig JAM (AVRCP))

我可以看到这些命令与hci-dump.

我确认我可以将这些命令发送到我的手机。我只是无法从 DBus 层上的扬声器和耳机接收任何内容。

我应该从哪里开始检查?

alsa
  • 1 个回答
  • 10 Views
Martin Hope
TSG
Asked: 2023-07-19 06:24:09 +0800 CST

缺少 /dev/dsp

  • 5

我已经安装了 Cepstral Swift(语音测试),当我运行应该输出音频的命令时,我收到错误

oss_audio: failed to open audio device /dev/dsp

我确保还安装了 OSS:

dnf install alsa-utils alsa-plugins-oss

但仍然是同样的错误。我可以确认设备 /dev/dsp 不存在。我尝试安装 padsp 工具(将 OSS 音频路由到 PA),但该工具不适用于 AlmaLinux 9

alsa
  • 1 个回答
  • 21 Views
Martin Hope
Daniel
Asked: 2023-06-28 02:58:56 +0800 CST

通过 UDP 通过网络发送 (alsa) 音频

  • 6

据我了解,这会以 wav 格式将单声道记录 300 秒到名为“mic_rec”的命名管道

rec arecord -D hw:4,0 -d 300 -f cd -t wav -c 1 mic_rec

这会将在命名管道“mic_rec”中找到的任何内容通过 tcp 发送到端口 8111

cat mic_rec |netcat -l -p 8111

UDP协议

cat mic_rec |netcat -u -l -p 8111

使用 TCP 接收(有效):

netcat 192.168.2.29 8111 |vlc -

使用 UDP 接收(不):

netcat -u 192.168.2.29 8111 |vlc -

这(使用 TCP)可以工作,但有大约 2 秒的延迟。所以我的第一个想法就是使用 -u 参数切换到 UDP。但这似乎不起作用,我在接收端听不到任何声音。我错过了什么?

Pulseaudio 似乎有一种更简单的方法来做到这一点。但据我所知,我使用的设备(NanoPi Neo 1.4)不支持该功能。

alsa
  • 1 个回答
  • 20 Views
Martin Hope
vinthewrench
Asked: 2022-06-15 19:33:43 +0800 CST

设计建议:用于汽车收音机应用程序的 ALSA 四声道

  • 0

我正在用 C++(开源)为树莓派开发一个汽车收音机应用程序;https://github.com/vinthewrench/carradio

我在 ALSA api 和 Signstek USB DAC 上取得了一些成功,但我想要一些关于如何解决与使用 4 个扬声器相关的问题的建议。

我的代码目前只知道左右通道,并且 snd_pcm_writei 调用“默认”设备。

我相信我可以添加另一个 USB DAC 给我 4 个通道(正面和背面),但我不清楚如何编写代码来与所有 4 个对话。我怀疑答案是创建某种形式的混合虚拟设备前通道和后通道并执行 snd_pcm_open 并调用该设备。

那么问题来了?配置 ALSA 以集成前后通道并让 ALSA 完成所有混音工作的正确方法是什么?

我对如何设置 ALSA 仍然一无所知,而且一直在反复试验。

非常感谢。

raspberry-pi alsa
  • 1 个回答
  • 20 Views
Martin Hope
Time4Tea
Asked: 2022-05-28 07:14:12 +0800 CST

Alsa 定序器问题 - 没有文件 /dev/snd/seq

  • 1

我的 Alsa 音序器似乎有问题。我正在使用抛物线(Arch 变体)并且我不使用 Pulseaudio,我直接使用 Alsa。我正在尝试通过具有 MIDI 音频的 Wine 玩游戏。我安装了流体合成器,它可以工作 - 我可以播放一个 MIDI 文件,听起来不错。但是,如果我启动流体合成服务器并运行aplaymidi -l,我会收到以下错误:

$ aplaymidi -l
ALSA lib seq_hw.c:466:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory

我没有/dev/snd/seq文件,这似乎是应该存在的,与 Alsa 音序器有关。有谁知道为什么该文件可能不存在以及我可以尝试哪些解决方案?

编辑:

为了回答评论中的问题,这里是/proc/config.gz处理序列器的部分的输出:

$ zgrep -A 5 -B 5 SEQUENCER /proc/config.gz
# CONFIG_SND_CTL_VALIDATION is not set
# CONFIG_SND_JACK_INJECTION_DEBUG is not set
CONFIG_SND_VMASTER=y
CONFIG_SND_DMA_SGBUF=y
CONFIG_SND_CTL_LED=m
CONFIG_SND_SEQUENCER=m
CONFIG_SND_SEQ_DUMMY=m
CONFIG_SND_SEQUENCER_OSS=m
CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
CONFIG_SND_SEQ_MIDI_EVENT=m
CONFIG_SND_SEQ_MIDI=m
CONFIG_SND_SEQ_MIDI_EMUL=m
CONFIG_SND_SEQ_VIRMIDI=m

所以看起来Alsa音序器被编译为一个模块,我可能只需要加载那个模块。

alsa midi
  • 1 个回答
  • 305 Views
Martin Hope
Emmanuel Lepage Vallee
Asked: 2022-01-24 00:30:35 +0800 CST

我的 USB 音频输入通道最大输出/剪辑约为 15%

  • 1

我有一个 M-track 8 音频设备(8 个 I/O)。它适用于播放。但是,麦克风(48 伏 XLR 麦克风)几乎没有发出任何声音。录制时,它们在任何应用程序中的音量上限为 15%。

  • 根据混频器频谱分析仪,它们工作得很好。
  • 如果我将 m-track 输入重定向到模拟输出并使用内置麦克风进行录制,那么它可以正常工作
  • 如果我在 macOS 或 Windows 中录制,它可以正常工作。

所以问题出在 ALSA 或驱动程序的某个地方。这是一个普通的 USB 音频类设备,因此驱动程序不太可能出现问题(在 Gentoo、Ubuntu 20.04 和 Ubuntu 18.04 live-usb 中重现)。

  • alsamixer显示所有输入为 100%
  • pavucontrol以 100% 显示所有输入
  • 我尝试添加一些.asoundrc配置来强制 96kHz,但它什么也没做
  • 该问题与麦克风增强无关。信号超弱

混音器-c2:

Simple mixer control 'Mic',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right - Rear Left - Rear Right - Front Center - Woofer - Side Left - Side Right
  Limits: Capture 0 - 127
  Front Left: Capture 127 [100%] [0.00dB] [on]
  Front Right: Capture 127 [100%] [0.00dB] [on]
  Rear Left: Capture 127 [100%] [0.00dB] [on]
  Rear Right: Capture 127 [100%] [0.00dB] [on]
  Front Center: Capture 127 [100%] [0.00dB] [on]
  Woofer: Capture 127 [100%] [0.00dB] [on]
  Side Left: Capture 127 [100%] [0.00dB] [on]
  Side Right: Capture 127 [100%] [0.00dB] [on]
Simple mixer control 'Mic',1
  Capabilities: cvolume cvolume-joined cswitch cswitch-joined
  Capture channels: Mono
  Limits: Capture 0 - 127
  Mono: Capture 127 [100%] [0.00dB] [on]
Simple mixer control 'M-Audio M-Track Eight',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right - Rear Left - Rear Right - Front Center - Woofer - Side Left - Side Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 121 [95%] [-6.00dB] [on]
  Front Right: Playback 121 [95%] [-6.00dB] [on]
  Rear Left: Playback 127 [100%] [0.00dB] [on]
  Rear Right: Playback 127 [100%] [0.00dB] [on]
  Front Center: Playback 127 [100%] [0.00dB] [on]
  Woofer: Playback 127 [100%] [0.00dB] [on]
  Side Left: Playback 127 [100%] [0.00dB] [on]
  Side Right: Playback 127 [100%] [0.00dB] [on]
Simple mixer control 'M-Audio M-Track Eight',1
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 127
  Mono: Playback 127 [100%] [0.00dB] [on]

lsusb -vv -d 0763:4003

Bus 001 Device 049: ID 0763:4003 M-Audio 
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x0763 M-Audio
  idProduct          0x4003 
  bcdDevice            1.05
  iManufacturer           1 
  iProduct                3 
  iSerial                 0 
  bNumConfigurations      2
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0148
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         3
      bFunctionClass          1 Audio
      bFunctionSubClass       0 
      bFunctionProtocol      32 
      iFunction               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol     32 
      iInterface              3 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               2.00
        bCategory               8
        wTotalLength       0x00a7
        bmControls           0x00
      AudioControl Interface Descriptor:
        bLength                 8
        bDescriptorType        36
        bDescriptorSubtype     10 (CLOCK_SOURCE)
        bClockID               41
        bmAttributes            3 Internal programmable clock 
        bmControls           0x07
          Clock Frequency Control (read/write)
          Clock Validity Control (read-only)
        bAssocTerminal          0
        iClockSource            9 
      AudioControl Interface Descriptor:
        bLength                 8
        bDescriptorType        36
        bDescriptorSubtype     11 (CLOCK_SELECTOR)
        bClockID               40
        bNrInPins               1
        baCSourceID(0)         41
        bmControls           0x03
          Clock Selector Control (read/write)
        iClockSelector          8 
      AudioControl Interface Descriptor:
        bLength                17
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             2
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bCSourceID             40
        bNrChannels             8
        bmChannelConfig    0x00000000
        iChannelNames          19 
        bmControls         0x0000
        iTerminal               6 
      AudioControl Interface Descriptor:
        bLength                42
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                10
        bSourceID               2
        bmaControls(0)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(1)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(2)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(3)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(4)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(5)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(6)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(7)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(8)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        iFeature                0 
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID            20
        wTerminalType      0x0301 Speaker
        bAssocTerminal          0
        bSourceID              10
        bCSourceID             40
        bmControls         0x0000
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                17
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0201 Microphone
        bAssocTerminal          0
        bCSourceID             40
        bNrChannels             8
        bmChannelConfig    0x00000000
        iChannelNames          19 
        bmControls         0x0000
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                42
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                11
        bSourceID               1
        bmaControls(0)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(1)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(2)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(3)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(4)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(5)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(6)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(7)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(8)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        iFeature                0 
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID            22
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID              11
        bCSourceID             40
        bmControls         0x0000
        iTerminal               7 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              4 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              4 
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           2
        bmControls           0x00
        bFormatType             1
        bmFormats          0x00000001
          PCM
        bNrChannels             8
        bmChannelConfig    0x00000000
        iChannelNames          11 
      AudioStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bSubslotSize            4
        bBitResolution         24
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               1
        AudioStreaming Endpoint Descriptor:
          bLength                 8
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bmControls           0x00
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay         0x0008
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes           17
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Feedback
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval               4
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              5 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              5 
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink          22
        bmControls           0x00
        bFormatType             1
        bmFormats          0x00000001
          PCM
        bNrChannels             8
        bmChannelConfig    0x00000000
        iChannelNames          19 
      AudioStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bSubslotSize            4
        bBitResolution         24
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               1
        AudioStreaming Endpoint Descriptor:
          bLength                 8
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bmControls           0x00
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay         0x0008
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       254 Application Specific Interface
      bInterfaceSubClass      1 Device Firmware Update
      bInterfaceProtocol      1 
      iInterface             10 
      Device Firmware Upgrade Interface Descriptor:
        bLength                             9
        bDescriptorType                    33
        bmAttributes                        7
          Will Not Detach
          Manifestation Tolerant
          Upload Supported
          Download Supported
        wDetachTimeout                    250 milliseconds
        wTransferSize                      64 bytes
        bcdDFUVersion                   1.10
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0148
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         3
      bFunctionClass          1 Audio
      bFunctionSubClass       0 
      bFunctionProtocol      32 
      iFunction               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol     32 
      iInterface              3 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               2.00
        bCategory               8
        wTotalLength       0x00a7
        bmControls           0x00
      AudioControl Interface Descriptor:
        bLength                 8
        bDescriptorType        36
        bDescriptorSubtype     10 (CLOCK_SOURCE)
        bClockID               41
        bmAttributes            3 Internal programmable clock 
        bmControls           0x07
          Clock Frequency Control (read/write)
          Clock Validity Control (read-only)
        bAssocTerminal          0
        iClockSource            9 
      AudioControl Interface Descriptor:
        bLength                 8
        bDescriptorType        36
        bDescriptorSubtype     11 (CLOCK_SELECTOR)
        bClockID               40
        bNrInPins               1
        baCSourceID(0)         41
        bmControls           0x03
          Clock Selector Control (read/write)
        iClockSelector          8 
      AudioControl Interface Descriptor:
        bLength                17
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             2
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bCSourceID             40
        bNrChannels             8
        bmChannelConfig    0x00000000
        iChannelNames          19 
        bmControls         0x0000
        iTerminal               6 
      AudioControl Interface Descriptor:
        bLength                42
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                10
        bSourceID               2
        bmaControls(0)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(1)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(2)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(3)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(4)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(5)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(6)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(7)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(8)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        iFeature                0 
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID            20
        wTerminalType      0x0301 Speaker
        bAssocTerminal          0
        bSourceID              10
        bCSourceID             40
        bmControls         0x0000
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                17
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0201 Microphone
        bAssocTerminal          0
        bCSourceID             40
        bNrChannels             8
        bmChannelConfig    0x00000000
        iChannelNames          19 
        bmControls         0x0000
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                42
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                11
        bSourceID               1
        bmaControls(0)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(1)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(2)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(3)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(4)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(5)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(6)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(7)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls(8)     0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        iFeature                0 
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID            22
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID              11
        bCSourceID             40
        bmControls         0x0000
        iTerminal               7 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              4 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              4 
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           2
        bmControls           0x00
        bFormatType             1
        bmFormats          0x00000001
          PCM
        bNrChannels             8
        bmChannelConfig    0x00000000
        iChannelNames          11 
      AudioStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bSubslotSize            4
        bBitResolution         24
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               1
        AudioStreaming Endpoint Descriptor:
          bLength                 8
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bmControls           0x00
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay         0x0008
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes           17
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Feedback
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval               4
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              5 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              5 
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink          22
        bmControls           0x00
        bFormatType             1
        bmFormats          0x00000001
          PCM
        bNrChannels             8
        bmChannelConfig    0x00000000
        iChannelNames          19 
      AudioStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bSubslotSize            4
        bBitResolution         24
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               1
        AudioStreaming Endpoint Descriptor:
          bLength                 8
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bmControls           0x00
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay         0x0008
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       254 Application Specific Interface
      bInterfaceSubClass      1 Device Firmware Update
      bInterfaceProtocol      1 
      iInterface             10 
      Device Firmware Upgrade Interface Descriptor:
        bLength                             9
        bDescriptorType                    33
        bmAttributes                        7
          Will Not Detach
          Manifestation Tolerant
          Upload Supported
          Download Supported
        wDetachTimeout                    250 milliseconds
        wTransferSize                      64 bytes
        bcdDFUVersion                   1.10

pacmd list-sources inputs:

   index: 16
        name: <alsa_output.usb-M-Audio_M-Track_Eight-00.analog-surround-71.monitor>
        driver: <module-alsa-card.c>
        flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
        state: RUNNING
        suspend cause: (none)
        priority: 1040
        volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB,   rear-left: 65536 / 100% / 0.00 dB,   rear-right: 65536 / 100% / 0.00 dB,   front-center: 65536 / 100% / 0.00 dB,   lfe: 65536 / 100% / 0.00 dB,   side-left: 65536 / 100% / 0.00 dB,   side-right: 65536 / 100% / 0.00 dB
                balance 0.00
        base volume: 65536 / 100% / 0.00 dB
        volume steps: 65537
        muted: no
        current latency: 0.00 ms
        max rewind: 11 KiB
        sample spec: s32le 8ch 44100Hz
        channel map: front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right
                     Surround 7.1
        used by: 5
        linked by: 5
        configured latency: 40.00 ms; range is 8.00 .. 743.04 ms
        monitor_of: 7
        card: 5 <alsa_card.usb-M-Audio_M-Track_Eight-00>
        module: 27
        properties:
                device.description = "Monitor of M-Track Eight Analog Surround 7.1"
                device.class = "monitor"
                alsa.card = "2"
                alsa.card_name = "M-Track Eight"
                alsa.long_card_name = "M-Audio M-Track Eight at usb-0000:00:14.0-5.4, high speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "pci-0000:00:14.0-usb-0:5.4:1.0"
                sysfs.path = "/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.4/1-5.4:1.0/sound/card2"
                udev.id = "usb-M-Audio_M-Track_Eight-00"
                device.bus = "usb"
                device.vendor.id = "0763"
                device.vendor.name = "M-Audio"
                device.product.id = "4003"
                device.product.name = "M-Track Eight"
                device.serial = "M-Audio_M-Track_Eight"
                device.string = "2"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"

这是一段录音:

parecord -r --format=s24le --file-format=wav ./foo.wav

file ./foo.wav
./foo.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 24 bit, stereo 44100 Hz

声音来自麦克风并被夹在设备上(显示了 vu-meter 红色条)。

enter image description here

enter image description here

pulseaudio alsa
  • 1 个回答
  • 67 Views
Martin Hope
400 the Cat
Asked: 2022-01-19 20:41:52 +0800 CST

alsa:记录给定声卡上的所有内容

  • 1

有没有一种简单的、独立于应用程序的方法来在给定的声卡上录制音频?

假设我插入 USB 耳机,显示为/dev/snd/foo.

然后我使用缩放或Skype或任何其他应用程序拨打电话。

如果应用程序不允许本地录制,我可以在声卡级别独立录制音频吗?

我正在使用 alsa,并且我(天真地)想象可能有一些基础设施可以附加到或“镜像”声卡并将音频转储到文件中?我需要录制两个通道(麦克风、扬声器),所以可能需要一些混合?

我的操作系统是 Debian 10,我正在使用 alsa(不是 pulseaudio)

audio alsa
  • 1 个回答
  • 767 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve