LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 03-20-2023, 09:52 AM   #1
Johpin
Member
 
Registered: May 2020
Posts: 46

Rep: Reputation: Disabled
Changing HDMI audio to jack headphone and vice versa using commands


To avoid using pavucontrol I want to use commands to change HDMI audio to jack headphone and vice versa. Under Raspberry Pi OS it runs nicely.

Under Raspberry Pi OS Bullseye:

pactl list | grep "Active Profile" gives:
Active Profile: output:analog-stereo
Active Profile: output:hdmi-stereo

Changing from HDMI audio to jack headphone:
pactl set-card-profile 1 off
pactl set-card-profile 0 output:analog-stereo

Under Slackware-arm 15:

pactl list | grep "Active Profile"
Active Profile: output:stereo-fallback
Active Profile: off

The version of pactl under Raspberry Pi OS is 14.2, Slackware-arm 15.0.

My impression is this is not useable. How could it be accomplished?

Last edited by Johpin; 03-21-2023 at 04:01 AM. Reason: Adding versions
 
Old 03-20-2023, 12:15 PM   #2
netcrawl
Member
 
Registered: Jan 2004
Location: British Columbia
Distribution: Slackware64-current, aarch64
Posts: 231

Rep: Reputation: 163Reputation: 163
"pacmd set-default-sink 2", assuming the headphone jack is index 2, works here on a pi 4.
 
Old 03-20-2023, 12:50 PM   #3
Johpin
Member
 
Registered: May 2020
Posts: 46

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by netcrawl View Post
"pacmd set-default-sink 2", assuming the headphone jack is index 2, works here on a pi 4.
I have tried sink 0 till 23. The only time I did not see the message "Sink x does not exist" was for 0 or 1, depending on audio was set on HDMI or headphone jack.

Last edited by Johpin; 03-20-2023 at 03:03 PM.
 
Old 03-20-2023, 01:08 PM   #4
netcrawl
Member
 
Registered: Jan 2004
Location: British Columbia
Distribution: Slackware64-current, aarch64
Posts: 231

Rep: Reputation: 163Reputation: 163
On mine, "pacmd list-sinks" shows 3 sinks available, 0 and 1 are HDMI and 2 is the headphone jack.
 
Old 03-20-2023, 03:05 PM   #5
Johpin
Member
 
Registered: May 2020
Posts: 46

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by netcrawl View Post
On mine, "pacmd list-sinks" shows 3 sinks available, 0 and 1 are HDMI and 2 is the headphone jack.
Mine gives as output only index 0

Last edited by Johpin; 03-20-2023 at 03:21 PM.
 
Old 03-20-2023, 06:49 PM   #6
netcrawl
Member
 
Registered: Jan 2004
Location: British Columbia
Distribution: Slackware64-current, aarch64
Posts: 231

Rep: Reputation: 163Reputation: 163
I know that you're trying to avoid using pavucontrol, but you might check it to see if all 3 profiles are available. If they're there, enable all 3 and you should be able to use cli to control outputs afterwards. Works for me, anyway.
 
Old 03-21-2023, 03:31 AM   #7
Johpin
Member
 
Registered: May 2020
Posts: 46

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by netcrawl View Post
I know that you're trying to avoid using pavucontrol, but you might check it to see if all 3 profiles are available. If they're there, enable all 3 and you should be able to use cli to control outputs afterwards. Works for me, anyway.
-set both profiles to stereo in pavucontrol
-reboot
-pacmd list-sinks -> No PulseAudio daemon running, or not running as session daemon.
-mplayer "something"-> I hear "plof'
-pacmd list-sinks | grep index
* index: 0
index: 1
-pacmd set-default-sink 1 -> swithes HDMI audio to headphone jack
-pacmd set-default-sink 0 -> swithes headphone jack to HDMI audio

Thanks Netcrawl!

Remark: Don't use pactl (as in Raspberry Pi OS Bullseye), but use pacmd.

Last edited by Johpin; 03-21-2023 at 03:38 AM. Reason: Adding remark
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Jack (Jack Audio Connection Kit), qjackctl, and HDMI output devices mishehu Slackware 13 10-26-2022 01:05 PM
No Audio in front or rear jack - HDMI Audio working - Ubuntu 18.04 magbest Linux - Newbie 5 07-21-2020 08:42 AM
[SOLVED] pactl command to switch from speakers to headphone wolfv Linux - Software 1 03-11-2018 04:27 AM
pulseaudio not accepting connections from pactl or pavucontrol ninrod Linux - Software 4 07-18-2017 11:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 09:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration