Request: a command to change sound volume

paolone · 4640

aha

  • Junior Member
  • **
    • Posts: 51
    • Karma: +1/-0
Reply #15 on: November 29, 2018, 09: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

  • Senior Member
  • ****
    • Posts: 454
    • Karma: +16/-0
Reply #16 on: November 29, 2018, 03:28:59 PM
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: 9
    • Karma: +0/-0
  • Shadowlord
Reply #17 on: December 03, 2020, 06:21:51 PM
Has any progress been made on this? I'd much like to be able to adjust the volume globally instead of per-unit.

AROS hardware: Sapphire Edge HD2 net-top, 2GB RAM

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


aGGreSSor

  • Member
  • ***
    • Posts: 178
    • Karma: +7/-0
    • russian transit
Reply #18 on: December 06, 2020, 12:11:43 AM
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

  • Senior Member
  • ****
    • Posts: 454
    • Karma: +16/-0
Reply #19 on: December 08, 2020, 11: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: 178
    • Karma: +7/-0
    • russian transit
Reply #20 on: December 08, 2020, 12:23:06 PM
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, 12:28:37 PM by aGGreSSor »



paolone

  • Senior Member
  • ****
    • Posts: 454
    • Karma: +16/-0
Reply #21 on: December 08, 2020, 02:28:53 PM
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: 178
    • Karma: +7/-0
    • russian transit
Reply #22 on: December 08, 2020, 06:32:48 PM
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: 178
    • Karma: +7/-0
    • russian transit
Reply #23 on: December 08, 2020, 11: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, 08:50:03 AM by aGGreSSor »



aGGreSSor

  • Member
  • ***
    • Posts: 178
    • Karma: +7/-0
    • russian transit
Reply #24 on: December 09, 2020, 08: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, 10:13:40 PM by aGGreSSor »



paolone

  • Senior Member
  • ****
    • Posts: 454
    • Karma: +16/-0
Reply #25 on: December 10, 2020, 02:16:24 PM

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: 178
    • Karma: +7/-0
    • russian transit
Reply #26 on: December 10, 2020, 03:24:40 PM
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, 03:44:30 PM by aGGreSSor »



BSzili

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

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: 748
    • Karma: +34/-2
Reply #28 on: February 04, 2021, 04:14:18 PM
@paolone

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



paolone

  • Senior Member
  • ****
    • Posts: 454
    • Karma: +16/-0
Reply #29 on: February 04, 2021, 04:44:56 PM
@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.