FDH2 / UxPlay

AirPlay Unix mirroring server
GNU General Public License v3.0
1.34k stars 71 forks source link

Sound muffles if volume changed #274

Closed eliklein02 closed 3 months ago

eliklein02 commented 4 months ago

Hi, I'm using it like this "uxplay -nohold -as pulsesink -db -1:30" (yes I have pulseaudio) and if I play around with the volume on my phone, it becomes much louder and becomes muffled. Any ideas? Thank you

fduncanh commented 3 months ago

"-db -1:30"

is this a typo ? "-db -30:0" is the default

-db L:H L must be negative. H can be either sign, must be larger than L (positive or less negative)

gstreamers volume is set this way and values of gst_volume greater than 10 are treated as 10

gst_volume = pow(10.0, 0.05*db);

so H >+20 is treated as +20

eliklein02 commented 3 months ago

No it’s not a typo, I thought the first one is the low and the second is high. :-) What should I do?


From: fduncanh @.> Sent: Wednesday, February 28, 2024 7:36:43 PM To: FDH2/UxPlay @.> Cc: Eli Klein @.>; Author @.> Subject: Re: [FDH2/UxPlay] Sound muffles if volume changed (Issue #274)

"-db -1:30"

is this a typo ? "-db -30:0" is the default

— Reply to this email directly, view it on GitHubhttps://github.com/FDH2/UxPlay/issues/274#issuecomment-1970168584, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARLGCORNIMTTI4FLWDUPSPLYV7ERXAVCNFSM6AAAAABD67DDISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZQGE3DQNJYGQ. You are receiving this because you authored the thread.Message ID: @.***>

fduncanh commented 3 months ago

The -db option was introduced after the issue #250

The default range is -db -30:0 This is amplitude gain decibels.

I dont know enough about audio to advise what gain you should use, it probably depends on what kind of audio system you have.

https://www.hollyland.com/blog/tips/what-is-gain-in-audio

increasing the upper gain limit certainly makes the maximum volume audio louder, but may introduce distortion ("clipping") ???

just experiment with it. (or leave it at default if you don't know what you are doing) Try -db -30:20 (a 50db range) or -db -10:20 (same 30db range as default but shifted up by +20db.).

The upper setting should not be greater than +20 , as gstreamer doesn't accept anything more. +10db doubles the perceived sound volume.

The volume profile give by option "-taper" might also be useful: this modifies how the volume settings on the client change loudness, but doesn't change the decibel range. If the range from L to H has H = L +30db,
each 50% decrease in the "tapered" volume setting halves the perceived sound volume.