Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orange Pi 3B: Vendor: Enable audio via headphone jack #7330

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

dust-7
Copy link
Contributor

@dust-7 dust-7 commented Oct 3, 2024

Description

In vendor kernel, audio via headphone jack does not work out of the box. Updating alsamixer configurations as hinted in vendor's build fixes this.

Also taking this chance to rename audio devices. This is especially useful for mainline kernel, which displays both HDMI and headphone jack audio devices as "Analog Output - Built-in Audio".

How Has This Been Tested?

Tested vendor and edge images on v2.1 board. On both images, audio works out of the box via HDMI and headphone jack. Audio device names updated accordingly.

  • Vendor build: ./compile.sh build BOARD=orangepi3b BRANCH=vendor BUILD_DESKTOP=yes BUILD_MINIMAL=no DESKTOP_APPGROUPS_SELECTED= DESKTOP_ENVIRONMENT=gnome DESKTOP_ENVIRONMENT_CONFIG_NAME=config_base KERNEL_CONFIGURE=no KERNEL_GIT=shallow RELEASE=noble
  • Edge build: ./compile.sh build BOARD=orangepi3b BRANCH=edge BUILD_DESKTOP=yes BUILD_MINIMAL=no DESKTOP_APPGROUPS_SELECTED= DESKTOP_ENVIRONMENT=gnome DESKTOP_ENVIRONMENT_CONFIG_NAME=config_base KERNEL_CONFIGURE=no KERNEL_GIT=shallow RELEASE=noble

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

@dust-7 dust-7 requested review from a team and igorpecovnik as code owners October 3, 2024 09:07
@github-actions github-actions bot added size/small PR with less then 50 lines Hardware Hardware related like kernel, U-Boot, ... BSP Board Support Packages labels Oct 3, 2024
@SuperKali SuperKali added Ready to merge Reviewed, tested and ready for merge 11 Milestone: Fourth quarter release labels Oct 3, 2024
@defencedog
Copy link
Collaborator

Excellent work

@defencedog
Copy link
Collaborator

Repeated build command with success! Audio out works & sound devices name are properly identified.

In mainline kernel 6.6 microphone was also detected & I was able to capture sounds. Here it is not :( I used same cable (Standard Nokia audio out/in combo)

git clone --depth=1 --branch=main https://github.com/armbian/build
cd build
wget -O config/boards/orangepi3b.csc https://github.com/armbian/build/raw/e4587ac85441cfd15bb6bc6470465ee31fc90430/config/boards/orangepi3b.csc
wget -O packages/bsp/common/usr/lib/armbian/armbian-audio-config https://github.com/armbian/build/raw/e4587ac85441cfd15bb6bc6470465ee31fc90430/packages/bsp/common/usr/lib/armbian/armbian-audio-config
 ./compile.sh build BOARD=orangepi3b BRANCH=vendor BUILD_DESKTOP=yes BUILD_MINIMAL=no DESKTOP_APPGROUPS_SELECTED='desktop_tools editors internet multimedia programming remote_desktop' DESKTOP_ENVIRONMENT=gnome DESKTOP_ENVIRONMENT_CONFIG_NAME=config_base KERNEL_CONFIGURE=no KERNEL_GIT=shallow RELEASE=noble EXTRAWIFI=yes  EXT=mesa-vpu SHARE_LOG=yes HEADERS_INSTALL=yes

@igorpecovnik igorpecovnik merged commit 9063695 into armbian:main Oct 4, 2024
2 checks passed
@defencedog
Copy link
Collaborator

@dust-7 I think the only remaining stuff for this SBC is capturing audio using 3.5mm jack. In this mainline kernel image it's is working properly https://github.com/defencedog/orangepi3b_v2.1/tree/main/MicroLinux_Armbian_Orangepi3b_jammy_edge_6.6.4

@dust-7
Copy link
Contributor Author

dust-7 commented Oct 5, 2024

Mic via headphone jack can work. You need to use PulseAudio Volume Control (pavucontrol) to manually select the right capture device. However, it only works occasionally, and when it does, the channel is noisy. I suspect that is due to the RK817 codec driver in vendor kernel.

I do not intend to investigate or improve the mic issue any further.

@Gi-0n
Copy link

Gi-0n commented Nov 1, 2024

@dust-7 really appreciate your contributions to the opi3b board. I have a question. I use armbian community 24.11-trunk 358 (the most recent) and it turns out that the audio through the jack is not detected. Whatever is corrected, I always have audio through HDMI and I don't have to be switching between (Analog output and headphone output). When I connect my headphones, I do notice noise (interference), something that didn't happen before. What adjustments should I make to solve the lack of audio through the 3.5mm jack?. Thanks

@dust-7
Copy link
Contributor Author

dust-7 commented Nov 1, 2024

I use armbian community 24.11-trunk 358 (the most recent)

Did you download the image (provide URL), build it (provide build command), or update from apt? Which distro?

... and I don't have to be switching between (Analog output and headphone output).

Don't understand what you're saying here.

When I connect my headphones, I do notice noise (interference)

For me, I have not heard noise from headphone jack before and after this commit.


How this commit enables audio via headphone jack is by selecting the correct Playback Path in AlsaMixer. You can verify this like so:

  1. Go to terminal.
  2. Type alsamixer.
  3. Press F6, then select default:0 rockchip-rk809 (this selects the headphone jack sound card).
  4. Verify item Playback Path has value HP.
    Screenshot from 2024-11-02 03-14-26
  5. Verify audio coming out via headphone jack using command: speaker-test -Dhw:rockchiprk809 -c2.

@defencedog
Copy link
Collaborator

@Gi-0n this noble release works. Only microphone doesn't work as @dust-7 don't plan to.pursue it further
orangepi3b_v2.1/Armbian_Noble_rk6.1.75 at main · defencedog/orangepi3b_v2.1
https://github.com/defencedog/orangepi3b_v2.1/tree/main/Armbian_Noble_rk6.1.75

@Gi-0n
Copy link

Gi-0n commented Nov 2, 2024

By following the 5 steps I was able to activate the audio, the playback path had another configuration. I use Armbian 24.11 trunk-358 updated by apt. Thanks for the indication @dust-7 @defencedog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11 Milestone: Fourth quarter release BSP Board Support Packages Hardware Hardware related like kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines
Development

Successfully merging this pull request may close these issues.

5 participants