我如何在我的pi 3上获取USB发言者? -- pi-3 领域 raspberrypi 相关 的问题

How do I get USB speakers working on my Pi 3?


简体版||繁體版
5
vote

问题

中文

这可能听起来像重复的问题,但类似问题的答案不是解决我的问题。我已将Movitech S-150数字扬声器从USB电缆插入连接到我的PI 3的动力USB集线器3.扬声器显示它们在"数字" 上出现在"数字" 上,并在控制和电缆上出现"数字" 。我的 aplay -l 输出是

  **** List of PLAYBACK Hardware Devices **** card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]   Subdevices: 8/8   Subdevice #0: subdevice #0   Subdevice #1: subdevice #1   Subdevice #2: subdevice #2   Subdevice #3: subdevice #3   Subdevice #4: subdevice #4   Subdevice #5: subdevice #5   Subdevice #6: subdevice #6   Subdevice #7: subdevice #7 card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]   Subdevices: 1/1   Subdevice #0: subdevice #0 card 1: AUDIO [USB  AUDIO], device 0: USB Audio [USB Audio]   Subdevices: 1/1   Subdevice #0: subdevice #0   

我使用 sudo nano /usr/share/alsa/alsa.conf defaults.ctl.card 0 defaults.pcm.card 0 值更改为1,因为我读取了类似问题的答案。我不知道扬声器是否正常工作或PI无法识别它们。我使用了GUI音频设备设置(在首选项下)将控制器设置为PCM,适用于 BCM2835 Alsa(Alsa Mixer)(默认) USB音频(ALSA MIXER) 。 有没有办法在没有查找&amp的情况下测试扬声器的输出;使用带有 aplay 的mp3文件?

我发布 wget goo.gl/XJuOUW -O example.mp3 --no-check-certificate 并得到 -

  # A sample configuration for dhcpcd. # See dhcpcd.conf(5) for details.  # Allow users of this group to interact with dhcpcd via the control socket. #controlgroup wheel  # Inform the DHCP server of our hostname for DDNS. hostname  # Use the hardware address of the interface for the Client ID. clientid # or # Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361. # Some non-RFC compliant DHCP servers do not reply with this set. # In this case, comment out duid and enable clientid above. #duid  # Persist interface configuration when dhcpcd exits.  persistent  # Rapid commit support. # Safe to enable by default because it requires the equivalent option set # on the server to actually work. option rapid_commit  # A list of options to request from the DHCP server. option domain_name_servers, domain_name, domain_search, host_name option classless_static_routes # Respect the network MTU. This is applied to DHCP routes. option interface_mtu  # Most distributions have NTP support. #option ntp_servers  # A ServerID is required by RFC2131. require dhcp_server_identifier  # Generate SLAAC address using the Hardware Address of the interface #slaac hwaddr # OR generate Stable Private IPv6 Addresses based from the DUID slaac private  # Example static IP configuration:  profile static_eth0 interface eth0 static ip_address=192.168.1.101/24 static routers=192.168.1.1 static domain_name_servers=127.0.0.1 0  

我然后发布了O # A sample configuration for dhcpcd. # See dhcpcd.conf(5) for details. # Allow users of this group to interact with dhcpcd via the control socket. #controlgroup wheel # Inform the DHCP server of our hostname for DDNS. hostname # Use the hardware address of the interface for the Client ID. clientid # or # Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361. # Some non-RFC compliant DHCP servers do not reply with this set. # In this case, comment out duid and enable clientid above. #duid # Persist interface configuration when dhcpcd exits. persistent # Rapid commit support. # Safe to enable by default because it requires the equivalent option set # on the server to actually work. option rapid_commit # A list of options to request from the DHCP server. option domain_name_servers, domain_name, domain_search, host_name option classless_static_routes # Respect the network MTU. This is applied to DHCP routes. option interface_mtu # Most distributions have NTP support. #option ntp_servers # A ServerID is required by RFC2131. require dhcp_server_identifier # Generate SLAAC address using the Hardware Address of the interface #slaac hwaddr # OR generate Stable Private IPv6 Addresses based from the DUID slaac private # Example static IP configuration: profile static_eth0 interface eth0 static ip_address=192.168.1.101/24 static routers=192.168.1.1 static domain_name_servers=127.0.0.1 1 并得到

  # A sample configuration for dhcpcd. # See dhcpcd.conf(5) for details.  # Allow users of this group to interact with dhcpcd via the control socket. #controlgroup wheel  # Inform the DHCP server of our hostname for DDNS. hostname  # Use the hardware address of the interface for the Client ID. clientid # or # Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361. # Some non-RFC compliant DHCP servers do not reply with this set. # In this case, comment out duid and enable clientid above. #duid  # Persist interface configuration when dhcpcd exits.  persistent  # Rapid commit support. # Safe to enable by default because it requires the equivalent option set # on the server to actually work. option rapid_commit  # A list of options to request from the DHCP server. option domain_name_servers, domain_name, domain_search, host_name option classless_static_routes # Respect the network MTU. This is applied to DHCP routes. option interface_mtu  # Most distributions have NTP support. #option ntp_servers  # A ServerID is required by RFC2131. require dhcp_server_identifier  # Generate SLAAC address using the Hardware Address of the interface #slaac hwaddr # OR generate Stable Private IPv6 Addresses based from the DUID slaac private  # Example static IP configuration:  profile static_eth0 interface eth0 static ip_address=192.168.1.101/24 static routers=192.168.1.1 static domain_name_servers=127.0.0.1 2  

通过我的PI 3的GUI偏好,我已经设置了 bcm2835 alsa(Alsa Mixer)(默认) USB音频(Alsa Mixer)

英文原文

This may sound like a duplicate question, but the answers to similar questions are not solving my problem. I have plugged the USB cable from my Logitech S-150 digital speakers into a powered USB hub connected to my Pi 3. The speakers show that they're on - "DIGITAL" appears on the one with the controls and cable. My aplay -l output is

**** List of PLAYBACK Hardware Devices **** card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]   Subdevices: 8/8   Subdevice #0: subdevice #0   Subdevice #1: subdevice #1   Subdevice #2: subdevice #2   Subdevice #3: subdevice #3   Subdevice #4: subdevice #4   Subdevice #5: subdevice #5   Subdevice #6: subdevice #6   Subdevice #7: subdevice #7 card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]   Subdevices: 1/1   Subdevice #0: subdevice #0 card 1: AUDIO [USB  AUDIO], device 0: USB Audio [USB Audio]   Subdevices: 1/1   Subdevice #0: subdevice #0 

I used sudo nano /usr/share/alsa/alsa.conf to change the defaults.ctl.card 0 defaults.pcm.card 0 values to 1 as I read in an answer to a similar problem. I don't know if the speakers are working or the Pi is not recognizing them. I have used the GUI Audio Device Settings (under Preferences) to set the Control to PCM for both bcm2835 ALSA (Alsa mixer)(Default) and USB AUDIO (Alsa mixer). Is there a way I can test the speakers' output without finding & using an MP3 file with aplay?

I issued wget goo.gl/XJuOUW -O example.mp3 --no-check-certificate and got -

-2016-04-21 14:55:57--  http://goo.gl/XJuOUW Resolving goo.gl (goo.gl)... 2607:f8b0:4002:c05::66, 216.58.217.238 Connecting to goo.gl (goo.gl)|2607:f8b0:4002:c05::66|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://raw.githubusercontent.com/raspberrypilearning/burping-jelly-baby/master/sounds/la.mp3 [following] --2016-04-21 14:55:58--  https://raw.githubusercontent.com/raspberrypilearning/burping-jelly-baby/master/sounds/la.mp3 Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 23.235.44.133 Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|23.235.44.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 17260 (17K) [audio/mpeg] Saving to: xe2x80x98example.mp3xe2x80x99  example.mp3         100%[=====================>]  16.86K  --.-KB/s   in 0.001s   2016-04-21 14:55:59 (27.5 MB/s) - xe2x80x98example.mp3xe2x80x99 saved [17260/17260] 

I then issued omxplayer example.mp3 and got

Audio codec mp3 channels 1 samplerate 11025 bitspersample 16 Subtitle count: 0, state: off, index: 1, delay: 0 have a nice day ;) 

Through my Pi 3's GUI Preferences, I've set both bcm2835 ALSA (Alsa mixer) (Default) and USB AUDIO (Alsa Mixer).

  
       
       

回答列表

2
 
vote

刚刚有一个类似的问题并像这样解决它(在这个教程):

找到您的播放设备:

在播放硬件设备列表中找到扬声器。写下卡号和设备号。

  aplay -l   

在主目录(/ home / pi)中创建名为.asoundrc的新文件。确保它具有正确的从属定义扬声器;使用下面的配置,但替换 <card number> <device number> 与您在上一步中写下的数字。为PCM.Speaker执行此操作。

  sudo pigpiod # if not already running ... pigs i2co 1 0x5A 0 # returns a handle, 0 for first open ... pigs i2crd 0 9 # assuming 0 is handle returned by open ... pigs i2cc 0 # close when finished, assuming 0 is handle returned by open 0  
 

Just had a similar issue and solved it like this (found in this tutorial):

Find your playback devices:

Locate your speaker in the list of playback hardware devices. Write down the card number and device number.

aplay -l 

Create a new file named .asoundrc in the home directory (/home/pi). Make sure it has the right slave definitions speaker; use the configuration below but replace <card number> and <device number> with the numbers you wrote down in the previous step. Do this for pcm.speaker.

pcm.!default {   type asym   playback.pcm "speaker" }  pcm.speaker {   type plug   slave {     pcm "hw:<card number>,<device number>"   } } 
 
 
 
 
2
 
vote

这个解决了我的问题:

我们所要做的就是告诉Raspbian看看默认音频的"卡片#1" 。卡#0是内置的音频,所以这相当简单。

tun sudo nano /usr/share/alsa/alsa.conf并寻找以下两行:

defaults.ctl.card 0

defaults.pcm.card 0

将"0" 更改为"1" ,然后保存文件。就是这样!

https://学习.adafruit.com / USB-Audio-Cards-an-Raspberry-Pi /更新-Alsa-config

 

This solved my problem:

All we have to do is tell Raspbian to look at "card #1" for the default audio. Card #0 is the built in audio, so this is fairly straightforward.

Tun sudo nano /usr/share/alsa/alsa.conf and look for the following two lines:

defaults.ctl.card 0

defaults.pcm.card 0

Change both xe2x80x9c0xe2x80x9d to xe2x80x9c1xe2x80x9d and then save the file. Thatxe2x80x99s it!

https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/updating-alsa-config

 
 
0
 
vote

上面的答案(8:41回答8月7日)解决了我的USB扬声器设备问题,在Raspberry PI 4上用OS Raspbian GNU / Linux 10(Buster) (从亚马逊购买扬声器:一款UKHONK MINI USB扬声器即插即用,用于笔记本电脑和amp; PC,产品型号:HK-5002和USB列表中称为Gembird,但可能没有在线提到)。

USB扬声器安装的Adafruit指南(为14:47在4月4日回答的人员工作)没有为我独自工作。

谢谢你的提示! (但是,没有重新启动PI ...)

 

The answer above (answered Oct 7 '17 at 8:41) solved my USB speaker device problem on Raspberry Pi 4 with OS Raspbian GNU/Linux 10 (buster) (bought the speaker from Amazon: a UKHONK Mini USB Speaker Plug-and-Play for Notebook&PC, product model: HK-5002 and in USB listing referred to as GEMBIRD, but probably not mentioned online).

The Adafruit guide for USB speaker installation (that worked for the person that answered on Apr 4 '19 at 14:47) did not work alone for me.

Thanks for the tips! (Have not, however, rebooted the Pi yet...)

 
 

相关问题

1  混淆SSH情况,删除主持人?  ( Confusing ssh situation remove host ) 
我最近ssh进入我的一个远程服务器,就像我这样做。它质疑主机键的真实性,并提示我是否仍然想连接。我选择了是的,一旦我完成了工作我断开连接。然后稍后我正在更新我的Linux操作系统,所以我重新启动了我的机器,在我登录时完成了一个有趣的看操作,我尚未将其设置为todo 这是我所看到的(用i.p. partailly罚款...

12  覆盆子PI模型B 3超频?  ( Raspberry pi model b 3 overclocking ) 
今天覆盖覆盆子PI型号B 3,我相信我们都非常兴奋,看看这个新PI的速度。标准时钟是1.2GHz,但我想进一步推挤我。我知道PI 3使用64位BCM2837处理器,但我找不到BCM2837上的任何情况表,因为它的所有搜索结果都是关于PI 3. 这个新处理器是否有任何超频能力?或者是pi零,它出现在它的最大时钟速度?...

0  PI 3B WiFi接口失败  ( Pi 3b wifi interface fail ) 
我的pi-3b与Ubuntu 16.04闪烁,使用无线工具和 WPA_Supplicant 也安装。 我的问题是我无法得到 wlan0 要动态地(dhcp)或静态地被系统识别。 我在 / etc / network /接口中使用以下配置数据: source-directory /etc/network/inter...

8  如何安装Kuman 3.5英寸显示器?  ( How can i install the kuman 3 5 inch display ) 
我有一个完美的覆盆子pi 3型号b,在16 gb sd卡上具有Raspbian分布。我用HDMI-to-DVI连接器连接了一个屏幕,鼠标和键盘,我也有SSH访问权限。此外,我得到了一个kuman 3.5英寸触摸显示,我想在它上使用它。我通过互联网读自己,我知道我无法同时使用屏幕和HDMI屏幕。所以我将屏幕连接到正确的...

1  此模块只能在覆盆子PI上运行! [关闭]  ( This module can only be run on a raspberry pi ) 
关闭。这个问题是 off-topic 。它目前不接受答案。 想要改进这个问题?更新问题,所以它是主题 for raspberry pi堆栈交换。 ...

9  覆盆子pi需要多少力量?  ( How much power does a raspberry pi need ) 
我有一个覆盆子pi 3型号b,它似乎总是很低。你可以通过右上角的闪电看到这一点。 我通过将USB电源插入1A iPhone充电器而开始。它的工作,但闪电灯始终在那里。然后我尝试了一个2.1A端口,闪电螺栓仍然存在大部分时间(任何时候我点击或在PI打开了应用程序时,闲置会消失) 我想我有两个问题: 覆盆子PI需...

5  使用星号和免费PBX设置PBX,并在未来使用Skype,Pstn(Talk Talk UK)和GSM网关  ( Setting up pbx using asterisk and free pbx with skype pstn talk talk uk and ) 
我正在考虑在家里建立一个pbx。我合理的技术精明,但之前从未成立过PBX。那时似乎有很多信息,但我想知道有人可以: 感觉检查想法 给我一些里程碑。首先尝试设置此功能(不需要详细说明)。这样我就可以一步一步地测试事情,而不是过于越来越多的人 建议我是硬件是否工作或者我可能需要的其他东西 给出一些指针或链接,我可以遵循...

1  关机后留在高处  ( Leave a pin on high after shutdown ) 
我想知道是否;我留下了我的RPI的力量,但将其关闭。我可以在高处留一个别针吗? 很乐意一旦RPI Shifsddown就会让LED继续进行。我想知道我是否可以在没有中继的情况下做到这一点。 ...

2  如何在引导下运行持久性程序,该程序打印到控制台?  ( How to run a persistent program at boot which prints to console ) 
我有程序为一个用于驱动器项目而构建的,当PI启动时,我的PI需要开始读取。我已经替换了一个简单的C程序,而是调用位于根文件夹的MyLoopProgram〜。它每4秒钟打印出"跑步......" 。但我无法通过它运行并查看启动时的输出。我做错了什么? 我尝试了在root〜:处的程序编辑/etc/rc.local ....

1  如何在PIGPIO中设置RF频率?  ( How to set rf frequency in pigpio ) 
我正在使用 pigpio library 接收一个波形但我别看到了确保正确设置RF频率的方法。我正在使用Class Rx(),它应该读取在433 MHz上传输的信号,但我想更改此值。我搜索猪皮。但找不到它。 ...

1  覆盆子PI 3型号B V1.2 - 通过复合视频输出连接到旧电视  ( Raspberry pi 3 model b v1 2 connect to old tv via composite video output ) 
我有一个覆盆子pi 3型号b v1.2。它在我的电视上有很好的工作,拥有HDMI端口,但我试图将其挂钩到只有A / V和复合视频输入的电视。从我理解的是,我需要购买3.5毫米到A / V电缆,所以我可以插入3.5mm 4极复合视频和音频输出,如下图所示。 我已经完成了这个,我无法弄清楚如何在这个较旧电视上做它。...

2  如何在没有静态IP的情况下将WLAN0桥接到eth0?  ( How to bridge wlan0 to eth0 without a static ip ) 
我在我的宿舍里有互联网问题,我可以通过将宿舍的WiFi(WLAN0)缩小到以太网(eth0)来解决它们。我在线阅读了很多教程,但大多数都过时或在我的情况下适用。 因为我不拥有网络,我无法让自己一个静态的IP,并且还有一个登录门户,我必须每次连接到连接。 我读到由于硬件限制,WLAN0和ETH0之间无法在WLAN0和...

-1  .bashrc未加载/引导/执行|在远程SSH登录上识别  ( Bashrc not being loaded booted executed recognised on remote ssh login ) 
所以我创建了这个新用户,我将一个.bashrc文件复制到我的ras pi的默认'pi'用户到我刚刚创建的新用户。然后我用新用户登录,他们似乎没有工作,例如提示不是颜色,我的程序欢迎。尽管我在作为sudoer用户的时候做sudo nano .bashrc并没有跑步。线路我做了./welcome.exe 我通常不太好,...

0  远程桌面不适用于PI 3 Model B +  ( Remote desktop not working for pi 3 model b ) 
我正在尝试获取远程桌面,以便在我的pi 3 b +上工作,但它不起作用。这是我使用的代码: $ sudo apt-get remove xrdp vnc4server tightvncserver $ sudo apt-get install tightvncserver $ sudo apt-get ins...

3  为什么我的覆盆子PI 3型号B不再检测WiFi网络? [关闭]  ( Why does my raspberry pi 3 model b no longer detect wifi networks ) 
关闭。这个问题是 off-topic 。它目前不接受答案。 想要改进这个问题?更新问题,所以它是主题 for raspberry pi堆栈交换。 关...

1  覆盆子PI 3 B +的Kali Linux图像  ( Kali linux image for raspberry pi 3 b ) 
我从2018年购买了一个新的覆盆子pi 3 b +。我试图在kali linux的安装页面上安装Kali Linux,它说ARM图像适用于覆盆子PI 2和3.如果图像也应该工作在pi 3 b +? 我正确地安装了SD卡上的所有内容,但我得到了彩虹屏幕,PI无法启动。没有硬件failles,因为我可以成功加载它的Ras...

0  使用覆盆子PI 3接收短信GSM SIM900  ( Receive sms messages gsm sim900 using raspberry pi 3 ) 
我想使用raspberry pi 3向我的手机发送短信3.我使用了这个代码,但它向我展示了这个错误我不是为什么? MsgNo=fd[p[0]+1:q[1]] Index error:list index out of range 我认为由于P和Q中没有数据,但我不确定。 这是代码: 导入序列 导入...

7  PI 3无法使用GUI连接到企业WiFi  ( Pi 3 cannot connect to enterprise wifi using gui ) 
raspberry pi 3型号b跑raspbian"jessie with pixel" (发布2016-09-23)。 似乎需要除了PSK之外的身份验证的所有WiFi网络都在菜单中灰色。 这是什么原因?不支持司机或不支持GUI? 谢谢! ...

2  覆盆子PI 3蒙德巴3.2或更高版本  ( Mongodb 3 2 or higher on raspberry pi 3 ) 
我正在尝试在覆盆子pi上更新我的mongodb版本。 我遇到了以下命令 $ sudo apt-get install mongodb 到目前为止这么好。我可以通过在控制台中键入mongo来访问Mongo Shell。 我可以使用服务启动MongoDB: $ sudo service mongodb st...

0  RPI 3挂在HDMI上,但可以罚款  ( Rpi 3 hangs on hdmi out but can ssh fine ) 
我有一个我在一年前买的RPI 3,我只使用了3次HDMI。在我努力设置它之后,我直到今天才能拔掉HDMI。它通过启动的文本,但永远不会进入GUI。 但是我可以用腻子迅速进行。并且RPI最终在主分区上的FSCK命令上。它总是最终修复脏位"0x41" 。 甚至xtightvnc运行,我可以使用VNC查看器进行虚拟屏幕。我...

2  使用覆盆子pi 3控制伺服,但不移动  ( Control servo using raspberry pi 3 but not moving ) 
对于学生项目f​​unbots( https://github.com/melvinma/funbots ),我们使用PWM控制伺服的问题。我们有限的工具来诊断问题,请帮助。 设置: Raspberry PI(一个型号3B和一个模型2B) 电机(Hitech HS-422和TowerPro SG92R) 软件:W...

2  Hadoop在堆栈的覆盆子pi Zero W堆栈  ( Hadoop on stack of raspberry pi zero w stack ) 
可以一堆覆盆子pi zero有效地运行hadoop吗?将 9988876667 作为路由器节点更好,并为从节点使用pi zeros? 是IoT和数据处理未建议PI Zero的应用程序W? ...

1  如何在Windows 10 IOT核心内获得覆盆子PI的唯一标识符(创建者更新)  ( How do i get a unique identifier for a raspberry pi within windows 10 iot core ) 
我尝试了此方法(在 https://stackoverflow.com/a/31803247/2427812 )上10个IOT核心[版本10.0.15063](raspberry pi 3)获取硬件,但每次设备重新启动时getID()的结果会更改。 你知道为什么会发生这种情况吗? private static s...

0  试图从GPIO23读取,但它只读取0  ( Attempting to read from gpio23 but it only reads 0 ) 
我正在尝试遵循这个指南制作IR接收器/闪光灯。目前,我正在尝试在接收器结束时工作,但引脚在开始时读取0,而不是像指南说。 这里是我正在运行的python脚本来测试接收者。 import RPi.GPIO as GPIO import math import os from datetime import date...

1  PI 3的强烈红外发射器[已关闭]  ( Strong ir transmitter for pi 3 ) 
关闭。这个问题是 off-topic 。它目前不接受答案。 想要改进这个问题?更新问题,所以它是主题 for raspberry pi堆栈交换。 ...




© 2021 it.wenda123.org All Rights Reserved. 问答之家 版权所有