Headphone jack & audio switching
#1
I'm running the unofficial debian build (link here) on my Pinebook Pro. Mine is a bit different though since I've switched to sid rather than Debian testing.

I've been having some troubles with getting audio to switch over to _exclusively_ play through headphones when they are plugged in. For whatever reason they seem to play back through the speakers AND headphones.

This kind of defeats the purpose of putting headphones in, and I'm at a bit of an impasse. I've tried using alsamixer, but no matter what I change there is no entry for the audio jack at all, and it seems as though there is some config that is broken.

Any tips for resetting the audio config on my install? I am hoping to avoid reinstalling the system at all costs since it's a bit of a hassle.
  Reply
#2
The fix may soon be a simple 'update' away, if not now, likely soon.
I believe auto-detect is working on some of the Debian releases/distro's
      LINUX = CHOICES
         **BCnAZ**
               Idea
   Donate to $upport
your favorite OS Team
  Reply
#3
(06-28-2020, 11:19 AM)bcnaz Wrote: The fix may soon be a simple 'update' away,  if not now,  likely soon.
    I believe auto-detect is working on some of the Debian releases/distro's
Is there a thread, bug report, or some other indication of when that may happen and what work is required?
  Reply
#4
Not a 'bug report' per se,

>  rather,  I recently saw a post on a Mobian thread,  a comment that the earphone socket now 'just works'

So I figure all or most other distros will soon have it also.
      LINUX = CHOICES
         **BCnAZ**
               Idea
   Donate to $upport
your favorite OS Team
  Reply
#5
In the old days there was a mechanical extra set of contacts in the headphone jack to disconnect the speakers when you plug headphones in.  That could be retrofitted in here, need to replace the jack and do some wiring.

This is close, not sure if it has the switches.  The ones with 3 connections don't, the ones wth 5 connections do.  Your junkbox may have some https://www.radioshack.com/products/1-8-...phone-jack  I haven't looked at the mounting in the PBP, there are half a dozen different types.

Here's a pack of 10 of them for $5.40.  I like these because you can see the contacts.  https://www.aliexpress.com/item/91256825...web201603_  You can watch the speaker connections open when you plug headphones in.

10 for $1.50 https://www.aliexpress.com/item/32775967...web201603_  But the shipping price is high.  I'm not sure if that's tariff or not, I ordered a pack of LEDs the other day with free shipping.  Something like 10 LEDs shipped to the US for $1.50.

[Image: HTB14yAhXNrvK1RjSszeq6yObFXaq.jpg]

I  was surprised that that didn't happen, also that nothing in alsamixer could help.
  Reply
#6
I can't seem to find it right now, but I've seen in Manjaro a package that vends a systemd service, an acpid event definition, and two scripts - one toggles headphones and built-in speakers on/off, and another that sets them correctly on boot. And it works correctly on my machine, so the issue seems to be less of an audio jack hardware and more of a some weird non-standard solution on how the event is interpreted in hardware/software, requiring extra hacks like said Manjaro package.
This message was created with 100% recycled electrons
  Reply
#7
This looks related.  https://github.com/GalliumOS/galliumos-d...issues/318
  Reply
#8
Eureka!  The answer is closer than we think: It's in the mrfixit stretch.  When I went to Daniel Thompson's Bullseye I didn't notice the problem right away so I didn't think about the software change.  But I still have stretch on my emmc so  I just pulled out my SD  and booted from it.  Started playing something, plugged in headphones and the speakers stopped working.

The mrfixit stretch is on github I think, maybe there's a changelog that lists it or maybe somebody can ask him. https://github.com/mrfixit2001/debian_desktop/releases His kernel stuff is at https://github.com/mrfixit2001/mainline-kernel

Actually on his Github page it says Boston, that's a 3 hour drive from here. Never met him.

It's probably something in "Endless number of tweaks for smooth desktop performance" which I don't see details of. Possibly it's in acpi. There was a lot very right in the mrfixit version like faster text scrolliing and this which I miss about the Thompson Bullseye. Which of course is a deboostrap script and it might be possible to have local customizations get applied. If I type dmesg in an rxvt window it scrolls for about a minute, there's no GPU involved I think.

There's not a lot of acpi stuff on there, I don't see the jack.sh that the Gallium link talks about above or an /etc/acpi directory. And they're mostly fixated on pulseaudo which I work at getting rid of.

Arch blames it on Pulseaudio, I'd have to boot into Stretch again to see if there's any pulseaudio https://bbs.archlinux.org/viewtopic.php?id=228087
  Reply
#9
This turns it off but it stays off when you unplug the headphones:
Code:
amixer -c0 cset numid=28 0

numid=28,iface=MIXER,name='Speaker Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
So you could script turning it on and off but at least you get privacy.

For manual control a couple quick scripts.  Headphones stay on until you unplug them. 
Create them with your favorite editor someplace in your path, sudo may be required:
Code:
cat spon
#!/bin/bash
# Turn laptop speakers (always card 0) on
amixer -q -c0 cset numid=28 on &> /dev/null

cat spoff
!/bin/bash
# Turn laptop speakers (always card 0) off
amixer -q -c0 cset numid=28 0 &> /dev/null

chmod +x sp*

Alsamixer reads the state of the speaker switch but can't change it.  amixer is in alsa-utils.

Until somebody moves it here's a linked image to a block diagram.  Datasheets are easy to find by searching.
[Image: INrljx6.gif]
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Audio on Armbian Hobbes42 1 1,343 08-04-2023, 01:18 AM
Last Post: Humid Stylus
  Audio Driver on the pbp korreckj328 5 2,720 05-01-2023, 12:58 PM
Last Post: korreckj328
  Any chance of fixing the audio issues on the new batch PBP(it can't be just me...) crazyquark 0 1,059 09-30-2022, 10:15 AM
Last Post: crazyquark
  manjaro on pinebook pro low audio quality over jack alcck 1 1,440 09-22-2022, 11:31 AM
Last Post: petersen77
  No audio on Pinebook Pro with Fedora? foobar 1 1,884 08-22-2022, 12:12 PM
Last Post: snorwood
  trouble switching window managers junefish 0 1,245 01-23-2022, 03:57 PM
Last Post: junefish
Exclamation PSA: Poor audio quality / es8316 codec "stereo enhancement" haskal 4 6,283 01-01-2021, 01:40 AM
Last Post: pato3
  Fixing audio after deep sleep: Work Thread Syonyk 2 4,550 06-29-2020, 10:21 PM
Last Post: Syonyk
  Which distro for reasonable audio? brentashley 3 4,801 06-11-2020, 10:42 PM
Last Post: xmixahlx
  Headphone didn't work linuxfreund 0 2,135 06-08-2020, 08:28 AM
Last Post: linuxfreund

Forum Jump:


Users browsing this thread: 1 Guest(s)