OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio

IPB

Welcome Guest ( Log In | Register )

> Mono headphone output?
defunked
post Jul 23 2018, 08:06 AM
Post #1





Group: Members
Posts: 24
Joined: 21-July 18
Member No.: 826,576



I have come across two audio related problems with Sailfish CE on the Gemini. First, when headphones are plugged in to the device, the speakers continue to produce audio along with the headphone. It is my understanding that the Gemini has a single stereo audio DAC, but I expected the OS/driver to switch the output path from the speakers/amplifier to the headphones, when the headphones are inserted. In addition, the headphone are mono, along with the speakers.. That is certainly not right. I know the speakers are mono (and apparently phase inverted), but my understanding was that this hardware bug did not apply to the headphone jack. Has any one else noticed this behavior?

Bluetooth audio sending works fine.
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
andrewl
post Jul 24 2018, 11:24 PM
Post #2





Group: Members
Posts: 119
Joined: 3-January 18
Member No.: 815,731



QUOTE(defunked @ Jul 23 2018, 08:06 AM) *
d. In addition, the headphone are mono, along with the speakers.. That is certainly not right. I know the speakers are mono (and apparently phase inverted), but my understanding was that this hardware bug did not apply to the headphone jack. Has any one else noticed this behavior?


I don't think that problem is a Sailfish one, it's been reported with the shipped Android too.
Go to the top of the page
 
+Quote Post
vader
post Jul 25 2018, 02:26 PM
Post #3





Group: Members
Posts: 285
Joined: 21-January 18
Member No.: 816,775



QUOTE(andrewl @ Jul 25 2018, 05:24 PM) *
I don't think that problem is a Sailfish one, it's been reported with the shipped Android too.


It could still be software, because if you set the pulseaudio port to output-speaker+wired_headphone, then you get mono from the headphones. This is how the system (at least mine) was set up. The speakers and headphones played at the same time. When you set the port to output-wired_headphones, you get stereo - and quite nice at that.

I tried to fix it the standard way by sending a uevent upon headphone insertion, which is picked up by pulse, but it didn't work properly. The insertion would stop the speakers and only play in the headphones, but removing the headphones didn't enable the speakers again. I'm not a pulseaudio guru, so after a bit of playing/searching, I gave up.

I wrote my own simple headphone switcher which does work - I will try to package it up for others to use. I compiled inotifywait and wrote a simple script which waits on /sys/class/switch/h2w/, then reads the state file when something changes. A value of 2 means headphones inserted (pactl set-sink-port output-wired_headphone), and 0 means not inserted (pactl set-sink-port output-speaker). Seems to work well, and doesn't use CPU (the wait sleeps until something changes in that directory). I'm sure a pulseaudio guru could get the proper behaviour working, but this works for now smile.gif I added the startup to droid-hal-startup.sh, as systemd doesn't do the usual (better) rc/rc.local thing.

I am a debian guy, and have to work out how to package the utility - but when I do, I'll post it here.
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 25th May 2020 - 01:26 AM