首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何用单片机命令管理输出设备?

如何用单片机命令管理输出设备?
EN

Unix & Linux用户
提问于 2022-04-10 00:22:30
回答 2查看 3.1K关注 0票数 1

我的pc.I中有两个输出设备:headphoneline out,我可以选择其中一个作为输出标记,PulseAudio Volume Control.Can amixer做同样的工作,比如pulseaudio

我想选择speaker on card 1来播放音频。

代码语言:javascript
复制
amixer -c 1 set "speaker" On 
amixer: Unable to find simple control 'speaker',0    
amixer -c 1 set "speaker" 10db
amixer: Unable to find simple control 'speaker',0

他们两个都不能工作。

@MC68020 68020,无效命令:

代码语言:javascript
复制
debian@debian:~$   amixer -c 1 scontrols
Simple mixer control 'Master',0
Simple mixer control 'Headphone',0
Simple mixer control 'Headphone+LO',0
Simple mixer control 'PCM',0
Simple mixer control 'Front',0
Simple mixer control 'Front Mic',0
Simple mixer control 'Front Mic Boost',0
Simple mixer control 'Surround',0
Simple mixer control 'Center',0
Simple mixer control 'LFE',0
Simple mixer control 'Line',0
Simple mixer control 'Line Boost',0
Simple mixer control 'IEC958',0
Simple mixer control 'IEC958 Default PCM',0
Simple mixer control 'Capture',0
Simple mixer control 'Capture',1
Simple mixer control 'Auto-Mute Mode',0
Simple mixer control 'Channel Mode',0
Simple mixer control 'Input Source',0
Simple mixer control 'Input Source',1
Simple mixer control 'Loopback Mixing',0
Simple mixer control 'Rear Mic',0
Simple mixer control 'Rear Mic Boost',0
debian@debian:~$   amixer -c 1 sset Headphone  80%
amixer: Invalid command!
debian@debian:~$  amixer -c 1 set Headphone  80%
amixer: Invalid command!
debian@debian:~$  amixer -c 1 set "Headphone"  80%
amixer: Invalid command!
debian@debian:~$  amixer -c 1 sset "Headphone"  80%
amixer: Invalid command!

关于我朋友的更多信息:

代码语言:javascript
复制
debian@debian:~$  amixer -v 
amixer version 1.2.4
debian@debian:~$  amixer -c 1 sget Headphone
Simple mixer control 'Headphone',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
EN

回答 2

Unix & Linux用户

回答已采纳

发布于 2022-04-10 07:15:25

A/ You可能更喜欢使用半图形ncurses alsamixer 实用程序。然后按右上角F6中的通知启动它,以选择声卡,然后按下光标键,以设置您想要的控件的增益。

B/使用裸金属空气器,由于您所选择的控件对您的系统来说似乎是未知的,我建议您首先使用以下方法检查您的卡上可用的控件:

代码语言:javascript
复制
$ amixer -c 1 scontrols

然后,使用以下方法将希望的增益设置在特定控件上:

代码语言:javascript
复制
$ amixer -c 1 sset controllabel 80%

以设置此特定控件的增益。

顺便说一句:不要把控制标签放在双引号之间。

当心:任何控件都有不同的功能。这些功能取决于可能的设置。为了获取有关某些控件的功能的信息,开火:

代码语言:javascript
复制
$ amixer -c 1 sget some_control # adapt some_control

只有当控件获得卷能力时,它才会接受更改增益。如果如OP中所详述的那样,它具有开关功能,则提供的唯一可能性是将其打开或关闭:

票数 1
EN

Unix & Linux用户

发布于 2022-04-10 09:18:35

代码语言:javascript
复制
amixer -c 1 sget Master 
amixer -c 1 sset Master 90%
票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/698622

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档