Author Topic: distorted audio when closed (buffer byte shift?)  (Read 7753 times)

sobukus

  • Newbie
  • *
  • Posts: 27
    • View Profile
distorted audio when closed (buffer byte shift?)
« on: April 11, 2023, 04:02:53 am »
Hi,

a friend has used a Cosmo for some years. It's on the latest stock firmware. This is nobody who wants to tweak the thing, no special sauce … just a user. Recently, the Cosmo decided to play any notification sound when the lid is closed in a very distorted manner. Sounds like the volume is too high and we get hard clipping (not sure if it's the speakers or a previous mixer stage doing the clipping, probably the latter).

The notification sounds fine when the device is open. So somehow a different volume setting is applied when open or closed? Is this a feature?! I only really used a Gemini so far and do not remember such issue. I gather it might be related to CoDI, which can influence volume for media playing, I read. Also, there's CosmoCtl which enables some volume control via the  front rocker button, but only for rooted devices?!

Well, bad volume setting is just a guess I have. The one maybe unusual thing the user did was to configure a custom recording as notification/ringing sound. They told me that after this the issue of distorted notification sounds occured. It persists after changing to a stock sound bit.

Any setting we could try? Is this a bug that might get fixed by a factory reset only? Or never? It is rather unsettling to have the device rattle around wildly instead of softly announcing new messages or a call.
« Last Edit: April 11, 2023, 06:53:10 am by sobukus »

sobukus

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: distorted notification sound when closed
« Reply #1 on: April 11, 2023, 06:52:39 am »
We did some more testing. The distortion seems to be of the kind that you get when the pointer into a PCM buffer is shifted by a byte. There's constant distortion and the desired sound is discernible somewhat with varying volume behind it.

We can start playback of a music file (MP3) in opened mode and it continues smooth playback after closing the device. I can also change the playback volume in CoDi. BUT: Once the playback is paused and then resumed via CoDi, the distortion is there. When I now change the volume, I can discern the music getting quieter/louder, but the distortion/noise stays loud.

Ringtone and notification are both affected, but the amount of perceived distortion varies depending on the intended sound.

It seems that any playback of audio that starts while the device is closed (regardless of CoDi being active or not) gets mistreated in the buffering with a byte shift. Reminds me a bit of that issue of audio being out of phase … maybe there's still some bug in the kernel driver, even? Or rather the userspace audio processing? This started happening after adding custom ringtones, probably. We removed the corresponding Ringtones and Notifications folders on the internal storage and used various standard sounds, but that does not change things back regarding the playback issue.

There is a period of rather loud baselevel noise before/after the notification sound is played, too. How is the handling of audio playback differing here from a normal Android device? Phone calls themselves (via the earpiece speakers) are fine.

Also: The phone does not vibrate at all when closed. When open, it rings and vibrates on calls or notifications as configured. Something is messed up there. Anyone experienced something like this? Is a factory reset (annoying to the user) likely to fix this?