Jump to content

How to control audio volume by command on Orange Pi One Armbian?


Mori

Recommended Posts

I'm using Orange Pi One with Armbiab 5.14.

And trying to use GPIO (keys) for volume up and down, making game console.

Of course, I could read GPIOs status by Wiring Pi, but I couldn't control volume by command.

I tried amixer with various parameters, but not change HDMI volume. I'm not sure the usage detail of amixer on Armbian.

Please advise me how to change volume by command.

It's OK to control by C source, because use C program to read GPIOs!

Link to comment
Share on other sites

you may be able to adjust the volume of the PCM channel in the mixer. that will have the same effect. pure digital audio connections [hdmi, spdif, etc] are fixed. volume is adjusted at the output rather than source

 

Tapatalk thinks its important to tell you im using tapatalk from a phone.

Link to comment
Share on other sites

Thanks for your advise. I understood that HDMI audio level is fixed and I have to change other volume, like "PCM".

At first, I checked alsa devices by amixer. Result was following,

$ amixer
Simple mixer control 'hdmi audio format Function',0
  Capabilities: enum
  Items: 'null' 'pcm' 'AC3' 'MPEG1' 'MP3' 'MPEG2' 'AAC' 'DTS' 'ATRAC' 'ONE_BIT_AUDIO' 'DOLBY_DIGITAL_PLUS' 'DTS_HD' 'MAT' 'WMAPRO'
  Item0: 'pcm'

Then tried to check alsamixer. Displayed "sndhdmi" device and press F6: select sound card.

$ alsamixer

Card: sndhdmi
Chip:
Item: hdmi audio format Function [pcm]

Sound Card
-  (default)
0  audiocodec
1  sndhdmi
enter device name...

I put below command, but result was error. It means "default" has no "Lineout volume control", right?

$ amixer set 'Lineout volume control' 1-
amixer: Unable to find simple control 'Lineout volume control',0

I expect I have to change line out volume on sound card 0:audiocodec.

How do you think and how to change it?

I'm studying ALSA sample code now...

 

Link to comment
Share on other sites

Today I installed pulse audio and pavucontrol for GUI setting.

Both can change volume level. I used following command,

$ pactl set-sink-volume 1 100%
$ pactl set-sink-volume 1 0%

I expect,  1: means HDMI audio and 0:means analog audio line out.

But I7m not sure about analog line out, because Orange Pi One does not have it officially.

I will solder them directly and check it later.

 

Thank you for all of advise. I close this thread.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines