ALSA Mixer control

Post your Gambas programming questions here.
Post Reply
GrantXTV
Posts: 17
Joined: Tuesday 31st October 2023 9:20pm

ALSA Mixer control

Post by GrantXTV »

Hi All,

I have found some code to change the ALSA volume level and I am making good use of it, now I am looking for more of a general mixer code. One issue is I now have an audio offset delay from the video I am sending across by UDP, I found I can fix this by setting a -1500 ms latency offset via ALSA mixer.

How would I do this from within Gambas to remotely set the latency offset of a default audio device?
vuott
Posts: 263
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: ALSA Mixer control

Post by vuott »

What code are you using to change the ALSA volume level ?
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
GrantXTV
Posts: 17
Joined: Tuesday 31st October 2023 9:20pm

Re: ALSA Mixer control

Post by GrantXTV »

Hi Vuott,

I found this link and I did a English translate to get a better understanding of how to change ALSA volume levels.

https://www.gambas-it.org/wiki/index.ph ... er_di_ALSA

I hope this is helpful?
vuott
Posts: 263
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: ALSA Mixer control

Post by vuott »

Ah, yes, I wrote that page.

I :? suppose you use that code in the 'receiving' program to change the level of ALSA mixer.

You would have to check whether there is a function in the Gambas resources, pertaining to the mixer, that also allows you to manage latency.
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
GrantXTV
Posts: 17
Joined: Tuesday 31st October 2023 9:20pm

Re: ALSA Mixer control

Post by GrantXTV »

Yes, it is in the receiver part, controlling the main mixer level.

As for "a function in the Gambas resources", where would I start on this and where would I look to rework the mixer level for latency (if possible)?

As this is very new to me, working with the ALSA setup.
vuott
Posts: 263
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: ALSA Mixer control

Post by vuott »

GrantXTV wrote: Saturday 6th January 2024 7:47pm As for "a function in the Gambas resources", where would I start on this and where would I look to rework the mixer level for latency (if possible)?
In ALSA A.P.I.:

https://www.alsa-project.org/alsa-doc/a ... er_8h.html
https://www.alsa-project.org/alsa-doc/a ... mixer.html

Ehmmm... but... do you know C language ?


GrantXTV wrote: Saturday 6th January 2024 3:47pm I found I can fix this by setting a -1500 ms latency offset via ALSA mixer.
How do you do this?
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
GrantXTV
Posts: 17
Joined: Tuesday 31st October 2023 9:20pm

Re: ALSA Mixer control

Post by GrantXTV »

No, I have worked with C in the passed in editing code, but my programming history is in BASIC, Such as Spectrum Basic, QBasic, PICBasic, Visual Basic and now Gambas.

I set the latency offset directly from the mixer from within Ubuntu as within this image, I hope this is helpful?
Image

From the desktop (Volume, Audio Mixer, Output Devices, Advanced).
Attachments
ALSA mixer.png
ALSA mixer.png (29.86 KiB) Viewed 1842 times
vuott
Posts: 263
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: ALSA Mixer control

Post by vuott »

GrantXTV wrote: Saturday 6th January 2024 10:54pm I hope this is helpful?
Darn, we should find out how (the specific external ALSA function) that program handles latency.
We should read its source file. :|
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
vuott
Posts: 263
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: ALSA Mixer control

Post by vuott »

Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
GrantXTV
Posts: 17
Joined: Tuesday 31st October 2023 9:20pm

Re: ALSA Mixer control

Post by GrantXTV »

I will take a look as these links, to get some idea of what is going on and see what is possible.
Post Reply