Skip to content
Snippets Groups Projects

soc-qcom-sdm845: Clearer audio on earpiece in pipewire

Closed Imported Administrator requested to merge OP6-earpiece-pipewire into master
5 unresolved threads

Previously the audio was really stuttery and playing at the wrong speed on the earpiece. I experimented with some values and got it sounding much clearer.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Administrator added 1 commit · Imported

    added 1 commit

    • 5f6ee070 - oneplus-enchilada: clearer audio on earpiece in pipewire

    Compare with previous version

    By Paul Sajna on 2024-02-06T05:08:48

  • Administrator added 1 commit · Imported

    added 1 commit

    • 29a04dbb - oneplus-enchilada: clearer audio on earpiece in pipewire

    Compare with previous version

    By Paul Sajna on 2024-02-06T05:17:36

  • Administrator added 1 commit · Imported

    added 1 commit

    • 0983aa95 - oneplus-enchilada: clearer audio on earpiece in pipewire

    Compare with previous version

    By Paul Sajna on 2024-02-06T07:25:50

  • Administrator added 1 commit · Imported

    added 1 commit

    • acc1babd - oneplus-enchilada: clearer audio on earpiece in pipewire

    Compare with previous version

    By Paul Sajna on 2024-02-06T07:28:44

  • Administrator added 1 commit · Imported

    added 1 commit

    • fc823732 - oneplus-enchilada: clearer audio on earpiece in pipewire

    Compare with previous version

    By Paul Sajna on 2024-02-06T07:29:24

  • Administrator requested review from @calebccff · Imported

    requested review from @calebccff

    By Luca Weiss on 2024-02-06T16:48:51

    • Author Owner

      Testing team, would be great if you could test this! Specially on devices different to the OP6

      • Qualcomm Snapdragon 845/850 (SDM845/SDM850):
        • oneplus-enchilada (@Breakfastisready, @CarbonatedCaffeine, @Susurrus, @antonok, @crowdtier, @panzersajt, @retourmy)
        • oneplus-fajita (@Susurrus, @fdlamotte)
        • shift-axolotl (@Antoniomaciej)
        • xiaomi-beryllium (@anjandev, @panzersajt)

      By Pablo Correa Gomez on 2024-02-07T07:39:13

      Edited by Ghost User
    • Author Owner

      Hi, I will surely test this as I have lots of issues with pipewire on my op6, when making a call there is either no sound or highly saturated sound so it is not usable (and that's why I'm currently using pulse) ...

      But testing this will take time (I need to have two hours ahead), the only way I found to get sound back in calls (using pulse) is to first flash a phosh/edge image make a call and flash back my sxmo image ... I don't have control over the sound volume in pulse :disappointed:

      By fdlamotte on 2024-02-07T07:39:13

    • Author Owner

      Some notes for testing. I tested by calling my voicemail and using it's "record greeting / playback" feature. Probably most carriers have this. Also if you want to take modem issues and other call problems out of the equation you can select the "Make a Phone Call" configuration in pipewire/pavucontrol and then use the recorder that's built into plasma mobile. https://pkgs.alpinelinux.org/package/edge/community/aarch64/krecorder

      By Paul Sajna on 2024-02-07T08:07:05

      Edited by Administrator
    • Author Owner

      Thanks, that is more or less what I do when testing phone calls

      But switching between pulse and pipewire sometimes goes easy and sometimes turns bad. So I need to plan the worst case (I think an hour slot is ok for that).

      I'd love to have lots of time to do the tests. Or maybe if I can revive my op6t I'll have a test phone and will be able to test thing incrementally without caring about not having a working phone ;)

      By fdlamotte on 2024-02-07T09:30:41

    • Author Owner

      ok, did some tests before lunch ;)

      I switched to pipewire and installed all the proposed packages in MR 4792 ... (had to remove alpine-sdk due to issues between libc and musl ...)

      Audio did not work at first during calls. But I opened pavucontrol and it started working (saturated), I could lower the volume and it became ok, but sound goes if I quit pavucontrol

      Tried to record sound with gnome-sound-recorder, it works when on the "phone call" profile but recording and playback does not work in "HiFi" profile (stays blocked).

      It seems to be the same with krecorder (but I can't really use it since there is no icons in the buttons, I must miss some package but won't install full plasma desktop since then it breaks lots of things in my install. At some point I could use kde apps, but now the only way I've found is to use flatpaks)

      Some of my isues must be related to the fact I use sxmo

      Since I can make calls in current state, I'll try to find a way to make other things working (and calls working without launching pavucontrol).

      I'll keep you informed

      By fdlamotte on 2024-02-07T11:40:04

    • Author Owner

      I've just zapped the MR and I confirm that earpiece is highly glitched without it. So the MR seems to work.

      Now I'd like to know how to make the sound work in other context using pipewire (I'm quite sure I already had it working before)

      By fdlamotte on 2024-02-07T15:30:26

    • Author Owner

      Audio did not work at first during calls. But I opened pavucontrol and it started working (saturated), I could lower the volume and it became ok, but sound goes if I quit pavucontrol

      I think this is related to the existing device switching issues, which are not solved by this MR. But once the device is properly selected and there aren't other audios competing for devices and such, it works.

      By Paul Sajna on 2024-02-07T16:05:04

    • Author Owner

      Your comment makes sense.

      I've been able to record and playback sounds with gnome-sound-recorder. But I need to quit pavucontrol and wait a bit...

      So when using earpiece pavucontrol must be opened, and when using hifi mode it must be closed ...

      also after reapplying mr4792 the sound is ok again through earpiece (one thing though is that I must lower it to 20)

      By fdlamotte on 2024-02-07T16:51:27

    • Author Owner

      Just an update ... I've tried a clean install with pipewire

      Same behaviour with pavucontrol ... but when on earpiece if the sound is too loud (saturated) saturation doesn't go when lowering the volume. I have to lower the volume and restart the call

      By fdlamotte on 2024-02-07T17:33:25

    • Author Owner

      I'm sorry, but in the end I don't get consistent results ...

      It does not always work and I made it working but can't always reproduce it

      For instance, after using the recorder, if I make a call, it saturates (at a level of 14)

      Sorry but I can't let my phone in that state, I must revert to pulse (and might have to rebuild an image for that)

      There is good progress though ...

      By fdlamotte on 2024-02-07T17:53:42

    • Author Owner

      one thing though is that I must lower it to 20

      I also noticed the volume scale has way too much room and can be set far too high. I believe that would require a device tree or kernel change to correct.

      By Paul Sajna on 2024-02-07T20:09:53

    • Please register or sign in to reply
  • Administrator
    Administrator @root started a thread on the diff
19 19 }
20 20 )
21 21
22 -- Disable suspend for Voice Call devices
22 -- Rules for Voice Call devices
23 23 table.insert(alsa_monitor.rules,
24 24 {
25 25 matches = {
26 26 {
27 { "node.name", "matches", "alsa_output.*.Voice_Call*__sink" },
27 { "node.name", "matches", "alsa_output.*.Voice_Call*__sink" }
  • Author Owner

    The commit message needs update, to reflect this affects all sdm845 devices. Or does this only affect the enchilada?

    By Pablo Correa Gomez on 2024-02-06T20:10:51

  • Author Owner

    It affects all sdm845. If needed I could move the file to device-oneplus-enchilada.

    By Paul Sajna on 2024-02-06T20:25:23

  • Author Owner

    Ideally we should have a solution for all of them. Let's wait for the testing team to come back to us :smile:

    By Pablo Correa Gomez on 2024-02-06T22:08:50

  • Author Owner

    Commit message updated.

    By Paul Sajna on 2024-02-07T01:39:08

  • Please register or sign in to reply
  • Administrator added request-for-test label · Imported

    added request-for-test label

  • Administrator added 1 commit · Imported

    added 1 commit

    • a52bab4a - soc-qcom-sdm845: clearer audio on earpiece in pipewire

    Compare with previous version

    By Paul Sajna on 2024-02-07T01:37:32

  • Administrator changed title from oneplus-enchilada: Clearer audio on earpiece in pipewire to soc-qcom-sdm845: Clearer audio on earpiece in pipewire · Imported

    changed title from oneplus-enchilada: Clearer audio on earpiece in pipewire to soc-qcom-sdm845: Clearer audio on earpiece in pipewire

    By Paul Sajna on 2024-02-07T01:38:36

  • Administrator added 36 commits · Imported

    added 36 commits

    Compare with previous version

    By Paul Sajna on 2024-02-07T03:29:23

    • Author Owner

      I'm happy to test, but more clear testing instructions would be helpful. Does this apply to any media or just calls? Does this apply to bluetooth or only wired headphones?

      By Bryant Mairs on 2024-02-07T15:53:27

      Edited by Ghost User
    • Author Owner

      Any media. Neither bluetooth nor wired headphones. "earpiece" refers to the top of the phone speaker which you use when holding the phone up to your head for a call. It can be tested without involving calls by just selecting "make a call" as the audio configuration in pavucontrol or another pulse manager. The earpiece can be tested as just an output by playing music through it from your music app. But we may want to verify the microphone is working as well. Which is why I suggested record/playback using krecorder. Or if you want to complicate things and use a more real-world scenario, you can try calling your voicemail and recording a greeting and listening back to it.

      By Paul Sajna on 2024-02-07T15:53:27

    • Author Owner

      Thanks a lot for commenting, and sorry the instructions were not clear. The first step is to install pw-pulse if possible in your UI. Then check if there are any audio problems. Finally, mrtest this MR and see if the situation improves.

      By Pablo Correa Gomez on 2024-02-10T13:34:12

    • Please register or sign in to reply
    • Author Owner

      I tested for the shift-axolotl on edge and phosh. There was no noticeable change (therefore, nothing breaks). I suppose this is normal, since, as I understand, phosh still uses pulseaudio. Therefore the question is how to really test this. Should I try to add pipewire-pulse? Doing a quick test, I think the package is blocked when using phosh. Is there someway to test this without having to completely switch UI or install a new image with plasma or sxmo?

      By antoniomaciej on 2024-02-10T13:30:09

      Edited by Ghost User
    • Author Owner

      I guess gnome-mobile should work. Maybe we should discuss on whether we should drop that requirement on our side, to make it easier for people to test pipewire. Unfortunately, no solution as of now.

      By Pablo Correa Gomez on 2024-02-10T13:30:09

    • Please register or sign in to reply
  • Administrator approved this merge request · Imported

    approved this merge request

    By f_ on 2024-02-09T20:06:36

  • Administrator added 27 commits · Imported

    added 27 commits

    Compare with previous version

    By Paul Sajna on 2024-02-11T22:37:40

  • Author Owner

    It's working better without this now. Not sure what changed exactly but I don't think this is needed anymore.

    By Paul Sajna on 2024-02-23T18:43:37

  • Administrator closed · Imported

    closed

  • Please register or sign in to reply
    Loading