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 )

 
Reply to this topicStart new topic
> Pulseaudio wierdness
defunked
post Apr 27 2019, 07:40 AM
Post #1





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



Having updated to SF 3.0.3.8, I though I would see if anything had changed with the Pulse Audio speaker/headphone situation:

Speakers continue to operate when headphones are plugged in, and headphone are mono.

Unfortunately, no change with 3.0.3.8. However, I can still use shell commands to force the pulse audio system to switch:

pactl set-sink-port 0 output-wired_headphone
pactl set-sink-port 0 output-wired_headset
pactl set-sink-port 0 output-speaker

Note that headphones and headset both seem to route to only the headphone jack, resorting stereo operation. And I found a nice GUI program on open-repos simply called "audio output" which lets me change the audio output from the touch interface. So things are looking good.

All going well until I discover that using the Media application, every time a song finishes playing and a new one starts through the headphones, the volume drops by about 10 dB. If I switch pulse audio audio sink between output-wired_headphone and output-wired_headset, levels are restored. But I need to toggle after every song. Pulse Audio isn't showing any volume change. So I assume it's some hardware adaptation problem with a hardware course gain setting being reset in the audio codec IC.

Is anyone else seeing this? And idea what it might be?

Ethan...
Go to the top of the page
 
+Quote Post
vader
post Apr 29 2019, 04:59 AM
Post #2





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



QUOTE(defunked @ Apr 28 2019, 01:40 AM) *
Having updated to SF 3.0.3.8, I though I would see if anything had changed with the Pulse Audio speaker/headphone situation:

Speakers continue to operate when headphones are plugged in, and headphone are mono.


Same thing happened in 2.x as well. A bit dissapointing really.

QUOTE(defunked @ Apr 28 2019, 01:40 AM) *
Note that headphones and headset both seem to route to only the headphone jack, resorting stereo operation. And I found a nice GUI program on open-repos simply called "audio output" which lets me change the audio output from the touch interface. So things are looking good.


Good call! I've installed it as well now. The 10 dB problem seems to be across the board. I wrote a little sensors daemon which watched the headphone port and toggled the speakers/headphones appropriately. I had the same issue, and ended up removing it because I had to manually set it anyway.

I'll temper this next bit with the admission that I have been using linux since day 1 - and I actually mean the day Linus posted to comp.os.minix asking if anyone wanted to give his project a try. The two things I hate, no loathe most about modern linux are pulseaudio and systemd. Leaving systemd for another day, my reasons for disliking pulseaudio is that it is so grossly overcomplicated, and has many "features" which lay undiscovered until you really need it. Now I am actually a pretty good programmer, however I still haven't got sailfish (pulseaudio) audio working even close to well. When talking on the phone, the microphone and earpiece are on the same side. Such a simple thing to change you might ask.....I had the same 10dB issue, which resisted all automatic fixes and relied on swapping back and forth. Ironically, bluetooth headsets work flawlessly. I was seriously thinking of removing it and going back to alsa, but it is engrained in sailfish, so I ended up leaving it be.

Anyway, I feel better now I've had a little rant. I totally agree with "audio wierdness". Unfortunately it is mostly by design.
Go to the top of the page
 
+Quote Post
Adam Boardman
post Apr 29 2019, 06:19 AM
Post #3





Group: Members
Posts: 168
Joined: 29-December 17
Member No.: 815,489



QUOTE(vader @ Apr 29 2019, 01:59 PM) *
Now I am actually a pretty good programmer, however I still haven't got sailfish (pulseaudio) audio working even close to well.

You may want to take the pulseaudio (buster branch) work from gemian back to sailfish (as of 21st April commit its based upon the latest sfos droid module), I've added support for separation of mic/spk based upon orientation and there are plug-ins to support changing audio routing based upon plugging of devices, which seemed to work. You should update your android based system.img in /data/ to get stereo working on the speakers (I think that the gemian one also has all the stuff needed for sfos, Nikita would know for sure).

You'd need to compare the contents of gemian/pulseaudio/src/modules/droid/ and sfos/pulseaudio-modules-droid/src/droid/ (and ../common) we have slightly different directory structures but the files have the same names so shouldn't be too difficult to figure out what to compare to what and extract the bits you need. You'll also need to add the parts that poke '/proc/headphone_cs' from gemian-repowerd to sfos-mce or similar as that gives you the actual mic/spk-seperation.

We still have issues with the sensors service starting on boot in gemian so the orientation stuff needs a kick each reboot, would be interesting to hear if using the updated system.img has the same problems on sfos or not.

I don't usually monitor the sfos forum, so probably best to email me with any questions etc. This is the 'pretty good programmer' targeted version where I assume you know how to find all the sources etc.
Go to the top of the page
 
+Quote Post
vader
post Apr 29 2019, 01:41 PM
Post #4





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



QUOTE(Adam Boardman @ Apr 30 2019, 12:19 AM) *
You may want to take the pulseaudio (buster branch) work from gemian back to sailfish (as of 21st April commit its based upon the latest sfos droid module), I've added support for separation of mic/spk based upon orientation and there are plug-ins to support changing audio routing based upon plugging of devices, which seemed to work. You should update your android based system.img in /data/ to get stereo working on the speakers (I think that the gemian one also has all the stuff needed for sfos, Nikita would know for sure).

You'd need to compare the contents of gemian/pulseaudio/src/modules/droid/ and sfos/pulseaudio-modules-droid/src/droid/ (and ../common) we have slightly different directory structures but the files have the same names so shouldn't be too difficult to figure out what to compare to what and extract the bits you need. You'll also need to add the parts that poke '/proc/headphone_cs' from gemian-repowerd to sfos-mce or similar as that gives you the actual mic/spk-seperation.


Thanks for the heads up. I'll give it a go this weekend.
Go to the top of the page
 
+Quote Post
vader
post May 2 2019, 12:10 AM
Post #5





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



One other wierdness to watch out for - if you go back and forth between speaker and headphone, you will stop the phone ringtone (ie. it doesn't play any more). Luckily I had vibrate on, and saw the call, but the ringtone didn't play. I checked the ringtone volume and it was at max. Tried getting it back, but a reboot was required.

Hopefully pulseaudio can be fixed (or removed) in future iterations, as this is a deal breaker.
Go to the top of the page
 
+Quote Post
arisel
post May 2 2019, 11:44 PM
Post #6





Group: Members
Posts: 3
Joined: 21-July 18
Member No.: 826,590



QUOTE(vader @ May 2 2019, 09:10 AM) *
Hopefully pulseaudio can be fixed (or removed) in future iterations, as this is a deal breaker.


I know that might seem counter-intuitive as it further complicates things: But maybe just add jackd to the stack. On desktop systems I've had good luck for the last several years using pulseaudio-jack to build the stack as follows: alsa -> jackd -> pulseaudio. That way all the complex routing can be done in jack. Alsa I normally just use for some base volume, buffer and samplerate settings. Pulseaudio is only used for application volume settings.
Go to the top of the page
 
+Quote Post

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: 19th July 2019 - 08:39 AM