Request: a command to change sound volume

paolone · 9048

aha

  • Junior Member
  • **
    • Posts: 66
    • Karma: +41/-0
Reply #15 on: November 29, 2018, 02:22:55 AM
The original request was about a cli command, which I'll try to make. If somebody else wants to create a GUI for it, they can.
Great!
Thank you both! I am looking forward for it!



paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #16 on: November 29, 2018, 08:28:59 AM
The original request was about a cli command, which I'll try to make. If somebody else wants to create a GUI for it, they can.
What do you think about this one? :-)

It will basically work like this:

1. at the beginning, it will launch your command without values, to get the current volume (a numeric value between 0 and 100)
2. the knob in the slide will move accordingly
3. if I tick Mute, your command with the 0 value will be shot immediately
4. if Unmute, your command with the initial value will be shot
5. when exiting the value in the knob will be applied

The "AHI Mixer" button already opens prefs/AHI, this will let user do the fine tuning without opening Prefs every time. I will have to manage things in a way that exiting it won't change volume in this case, if necessary.




Devlin

  • Newbie
  • *
    • Posts: 23
    • Karma: +0/-0
  • Shadowlord
Reply #17 on: December 03, 2020, 11:21:51 AM
Has any progress been made on this? I'd much like to be able to adjust the volume globally instead of per-unit.

WYSE Z90D7 mini-PC, 8GB RAM (2.5G usable) - VESA (needs a radeon driver)
Sapphire Edge HD2 net-top, 2GB RAM - native//nouveau

My Games for Windows and Linux: https://devlin.itch.io/


aGGreSSor

  • Member
  • ***
    • Posts: 184
    • Karma: +25/-0
    • russian transit
Reply #18 on: December 05, 2020, 05:11:43 PM
Would this be portable to AROS?
http://aminet.net/package/util/cdity/Mixer
This commodity has an interface for ReAction (need to rewrite for MUI/Zune), ARexx  support (have to throw away arexx.c, arexx.h) and then a personal hell begins for each card. I don't think it will appear for AROS anytime soon. The quest is interesting, but it will take a lot of time.  ::)

Supports emu10kx, fm801, sb128, cmi8738, cs4281, Aureon 5.1 sky, M-Audio Revolution 5.1, ess1938/solo-1 chips, and A1-XE onboard sound (VIA686B) if you have the AC'97 codec chip onboard.
The problem is that it isn't something universal, systemic. it's such a branched crutch.


paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #19 on: December 08, 2020, 04:39:09 AM
Has any progress been made on this? I'd much like to be able to adjust the volume globally instead of per-unit.


As I've said: the GUI is ready. The command that's supposed to do the job, not. I'm sorry.


aGGreSSor

  • Member
  • ***
    • Posts: 184
    • Karma: +25/-0
    • russian transit
Reply #20 on: December 08, 2020, 05:23:06 AM
Has any progress been made on this? I'd much like to be able to adjust the volume globally instead of per-unit.
As I've said: the GUI is ready. The command that's supposed to do the job, not. I'm sorry.
What means: the GUI is ready? How does it look, where can you see it?
There the problem is that each sound card is processed individually (although unified).
In principle, you can take sb128_ctrl.c and attach an CLI interface to it, then you can hang it on FKey.
This should work in VMware Player (only), but the sound is so awful that I don't see much point in it.
I think this is completely unsuitable for the distribution Besides, how many have this sb128 on real hardware?
This is an unsatisfactory solution, but I don't know another one.
« Last Edit: December 08, 2020, 05:28:37 AM by aGGreSSor »



paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #21 on: December 08, 2020, 07:28:53 AM
Has any progress been made on this? I'd much like to be able to adjust the volume globally instead of per-unit.
As I've said: the GUI is ready. The command that's supposed to do the job, not. I'm sorry.
What means: the GUI is ready? How does it look, where can you see it?
There the problem is that each sound card is processed individually (although unified).


Sure! See it in attachment.


My point is that if AHI can have a single slider for master volume, even if this setting comes from different modules for each sound card, we can also have a CLI command doing exactly the same thing. And re-use of open source code should be encouraged by its openess itself. I am ready to release my LUA GUI with any open license if necessary.



aGGreSSor

  • Member
  • ***
    • Posts: 184
    • Karma: +25/-0
    • russian transit
Reply #22 on: December 08, 2020, 11:32:48 AM
My point is that if AHI can have a single slider for master volume, even if this setting comes from different modules for each sound card
My point is that:
Code: [Select]
for (Channel = 0; Channel < 6; Channel += 1)
{
   Volume(Channel, Percentage);
}
closes this question. The Volume function () can be viewed in sb128_ctrl.c
we can also have a CLI command doing exactly the same thing.
It's not difficult to make a CLI command from the code above.
And re-use of open source code should be encouraged by its openess itself.
Unfortunately I don't have a similar code for setting the volume in AHI, there is only open source code going into specific sound card and doing it there.
I am ready to release my LUA GUI with any open license if necessary.
In any case, it's more convenient than FKey.


aGGreSSor

  • Member
  • ***
    • Posts: 184
    • Karma: +25/-0
    • russian transit
Reply #23 on: December 08, 2020, 04:08:12 PM
If you have an idea how to control the sound of AHI (theoretically understandable - AHI_SetVol( channel, volume, pan, audioctrl, flags ); ), you can add this code to the source from the attachment and compile. This is the CLI application where you need to add this function.  ::)


see next answer
« Last Edit: December 09, 2020, 01:50:03 AM by aGGreSSor »



aGGreSSor

  • Member
  • ***
    • Posts: 184
    • Karma: +25/-0
    • russian transit
Reply #24 on: December 09, 2020, 01:47:45 AM
In fact I have no sound in AROS. Let's test.  ;D

1. Try to start playback at half volume.
2. Run SetVolume as shown below:
Code: [Select]
> SetVolume.exe -s 10
3. The volume should grow to maximum

Write about the results here. This doesn't work.
I don't understand how AHI works, this is the "scientific poke" method.
« Last Edit: December 09, 2020, 03:13:40 PM by aGGreSSor »



paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #25 on: December 10, 2020, 07:16:24 AM

Write about the results here. This doesn't work.
I don't understand how AHI works, this is the "scientific poke" method.


:D :D


Well, at least you tried! :-)


I am really happy you've tried to help me, thank you! Unluckily setvolume is not working as expected. :-|


I tried changing volume while madahi and mplayer were playing a MP3 file without success, its volume didn't change.


aGGreSSor

  • Member
  • ***
    • Posts: 184
    • Karma: +25/-0
    • russian transit
Reply #26 on: December 10, 2020, 08:24:40 AM
I understood a few points.

1) Not all drivers support changing the volume. If the volume can be changed, SetVolume will output: "Get volume: ANY" and output: "Get volume: FULL" when it is impossible.
2) AHI has flexible settings for what the application plays (including the volume), but AHI has no obvious way to change the volume of the entire system. AHI_SetVol() function only works with the fact that I started to play. I may be wrong, but I think I'm right.
3) There is a AHIGlobalPrefs structure which AHI operates. The global volume in it can be addressed through ahigp_ClipMasterVolume. Undocumented.
4) Also need to write a function for converting percentages to decibels. AHI has its own fun understanding of volume referring to low-end layer.
5) I looked at the AHI Prefs source, but until I was able to compile them, this is another obstacle: SetVolume needs some of them.

Thank you for testing, I figured out how to test it myself. :)
« Last Edit: December 10, 2020, 08:44:30 AM by aGGreSSor »



BSzili

  • Newbie
  • *
    • Posts: 44
    • Karma: +80/-0
    • My AROS, MorphOS and AmigaOS4 ports
Reply #27 on: December 14, 2020, 10:20:55 AM

Write about the results here. This doesn't work.
I don't understand how AHI works, this is the "scientific poke" method.


:D :D


Well, at least you tried! :-)


I am really happy you've tried to help me, thank you! Unluckily setvolume is not working as expected. :-|


I tried changing volume while madahi and mplayer were playing a MP3 file without success, its volume didn't change.
In my defense I tried too back in... was it two years ago? Gosh. I'm still having nightmares about iffparse.library.

This is just like television, only you can see much further.


miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #28 on: February 04, 2021, 09:14:18 AM
@paolone

Did you get you volume adjustments utility in c: yet?



paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #29 on: February 04, 2021, 09:44:56 AM
@paolone

Did you get you volume adjustments utility in c: yet?


Unluckily, no. Aggressor went really near to it, though. His command didn't work with SB128 driver used by vmware, even though it should havel at least theoretically, and it might have been working with other hardware I could not personally test.