pulseaudio

linux linein 录音

会有一股神秘感。 提交于 2020-10-30 11:49:34
-- 预先找到linein 输入端口的序号和名称 -- 录音服务启动的时候,先执行以下脚本,切换一下默认设备 #!/usr/bin/env bash PRUN=`ps aux |grep pulseaudio | grep -v grep |wc -l` echo "pulseaudio ps cnt: ${PRUN}" if [ "${PRUN}"x == "0"x ] then echo "start pulseaudio...." /usr/bin/pulseaudio --start --log-target=syslog fi echo "set default mic to line in..." #pacmd set-source-port 1 analog-input-linein pacmd set-source-port alsa_input.pci-0000_00_1b.0.analog-stereo analog-input-linein pacmd list-sources |grep -e "index" -e "line" 来源: oschina 链接: https://my.oschina.net/mingyuejingque/blog/4695340

Manjaro 蓝牙连接问题

痴心易碎 提交于 2020-07-24 18:33:13
1 问题描述 蓝牙不能连接,或者连接上了没有声音。 2 解决方案 首先确保相应软件包存在: sudo pacman -S bluez bluez-utils pulseaudio-bluetooth pavucontrol pulseaudio-alsa pulseaudio-bluetooth-a2dp-gdm-fix 然后启动蓝牙以及pulseaudio服务: systemctl enable bluetooth systemctl start bluetooth pulseaudio -k # 确保没有pulseaudio启动 pulseaudio --start # 启动pulseaudio服务 然后可以以图形化的方式或者命令行方式就可以连接蓝牙了,这里演示一下命令行方式: bluetoothctl #连接交互命令 power on #开启控制器电源,默认关闭 devices #获取要配对设备的MAC agent on #打开代理 pair MAC_ADDRESS #配对,输入MAC地址即可配对,建议使用Tab connect MAC_ADDRESS #连接,建议使用Tab 最后一步是指定蓝牙音频输出,也就是连接上了如果蓝牙没有声音可能是这一步没有设置,终端输入: pavucontrol 来源: oschina 链接: https://my.oschina.net/u

Qt - No audio output device - Yocto/poky

自古美人都是妖i 提交于 2020-07-23 06:28:38
问题 I'm trying to play a WAV audio file with Qt (QSound, QSoundeffect) on an ARM based Atmel board (sama5d31ek). I've build the rootfs (and Qt SDK for cross-compiling) with Yocto/poky. When playing with QSound I get the following log message: using null output device, none available . I'm getting nothing when running: foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) qDebug() << "Device name: " << deviceInfo.deviceName(); I can play the file via

Qt - No audio output device - Yocto/poky

大憨熊 提交于 2020-07-23 06:26:21
问题 I'm trying to play a WAV audio file with Qt (QSound, QSoundeffect) on an ARM based Atmel board (sama5d31ek). I've build the rootfs (and Qt SDK for cross-compiling) with Yocto/poky. When playing with QSound I get the following log message: using null output device, none available . I'm getting nothing when running: foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) qDebug() << "Device name: " << deviceInfo.deviceName(); I can play the file via

bluetooth在linux应用开发

三世轮回 提交于 2020-04-30 21:07:25
linux 内 Bluetooth 的协议栈为 BlueZ , http://www.bluez.org/ 。 在 4.46 上, BlueZ 实现了对 A2DP Sink 的支持,而之前的版本只支持 A2DP Source 。 主机实现到 HCI 层,底层由蓝牙芯片实现。 HCI 层实现的是蓝牙芯片与主机通讯的方式。目前一般是 串口或者 USB 通讯 。所谓的 USB 也不是真正意义上的 USB 通讯,而是类似与 USB 转串口的方式,即通过驱动模拟 USB 设备实现串口通讯。目前 USB 蓝牙适配器 基本都是这种设备模式。 PC 端实现了 L2CAP, SDP, RFCOMM 协议,以及 USB 转串口的驱动。 Windows XP SP2 操作系统以上版本的都内置了这些协议栈,还有如 WIDCOMM 等公司提供的第三方协议栈。 实际中只需在市场上购买这种蓝牙适配器( USB 接口),然后通过配置内核蓝牙的接口驱动(即上图中的 HCI 层驱动),这样相应的蓝牙协议( linux 官方版本是 bluez )就已经在内核中了,这就相当于内核驱动中已经支持了相应的蓝牙协议( SDP,RFCOMM... ),有了驱动就需要接口库提供给应用程序使用,这里用到的接口库是开源的 bluez ,其实就是要在内核之上移植 bluez 及工具 bluez-utils 。 bluez 分为两部分

How to find the right RAW format

自古美人都是妖i 提交于 2020-01-15 05:08:45
问题 I have this code SNDFILE *sf; SF_INFO info; int num_channels; int num, num_items; int *buf; int f,sr,c; int i,j; FILE *out; /* Open the WAV file. */ info.format = (SF_FORMAT_RAW | SF_FORMAT_PCM_16); info.samplerate = 44100; info.channels = 2; sf = sf_open("test.raw",SFM_READ,&info); if (sf == NULL) { printf("Failed to open the file. ( %d )\n",sf_perror(sf)); exit(-1); } /* Print some of the info, and figure out how much data to read. */ f = info.frames; sr = info.samplerate; c = info.channels

How to find the right RAW format

大兔子大兔子 提交于 2020-01-15 05:08:06
问题 I have this code SNDFILE *sf; SF_INFO info; int num_channels; int num, num_items; int *buf; int f,sr,c; int i,j; FILE *out; /* Open the WAV file. */ info.format = (SF_FORMAT_RAW | SF_FORMAT_PCM_16); info.samplerate = 44100; info.channels = 2; sf = sf_open("test.raw",SFM_READ,&info); if (sf == NULL) { printf("Failed to open the file. ( %d )\n",sf_perror(sf)); exit(-1); } /* Print some of the info, and figure out how much data to read. */ f = info.frames; sr = info.samplerate; c = info.channels

Error playing audio file from Java via PulseAudio on Ubuntu

一笑奈何 提交于 2019-12-30 07:21:33
问题 The message on the shell is: Exception in thread "main" java.lang.IllegalArgumentException: Invalid format at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.createStream(PulseAudioDataLine.java:142) at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.open(PulseAudioDataLine.java:99) at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.open(PulseAudioDataLine.java:283) at org.classpath.icedtea.pulseaudio.PulseAudioClip.open(PulseAudioClip.java:402) at org.classpath.icedtea.pulseaudio

linux pactl card list in headless devices for pulseaudio

前提是你 提交于 2019-12-26 03:54:16
问题 in a headless device where only root user is available, pulse audio server starts automatically in startup using pulseaudio -D --disallow-exit. It runs fine so far. When the system starts the bluetooth headspeaker connects automatically. upon giving hcitool con I see the device hcitool con connections: ACL 00:0B:D5:F5:xx:xx:xx handle 11 state 1 im Master auth encrypt upon giving pactl list cards I get empty output Note that i start dbus with following command before i run pulseaudio eval

How to process audio stream in realtime

为君一笑 提交于 2019-12-25 08:36:48
问题 I have a setup with a raspberry pi 3 running latest jessie with all updates installed in which i provide a A2DP bluetooth sink where i connect with a phone to play some music. Via pulseaudio, the source (phone) is routed to the alsa output (sink). This works reasonably well. I now want to analyze the audio stream using python3.4 with librosa and i found a promising example using pyaudio which got adjusted to use the pulseaudio input (which magically works because its the default) instead of a