MPlayer volume control from the command line?
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    boot_wb
    Posts: 874 from 2007/4/9
    From: Kingston upon ...
    Afternoon folks,

    I'm in the process of setting up MorphOS as my default OS on my Mac mini, used mainly as a media player.

    I've set up a mime type for .avi files (entitled x-avi iirc), with the following Amigados command structure (for double-click events):
    "run >nil: <path>/mplayer -gui 1 %sp"

    This opens the file with MPlayer, activating the GUI.

    One minor problem: by default, the volume slider is set to 100%, which is quite deafening on my headphones. I can adjust the slider to the correct level, however when I restart MPlayer, the slider is back to 100%.

    Adjusting the overall volume level with AHI (system prefs/audio) seems to have no effect (even after restarting MPlayer). I'm aware that there is a bug relating to the "volume" module on the ambient titlebar, but didn't realise that this also meant that the volume levels in AHI were also currently unused for the Mac mini.

    So, my question is: is there a command line switch (or some other method) for setting the default volume level in MPlayer?

    Thanks in advance for any helpful hints :-)

    [ Edited by boot_wb on 2009/12/29 13:11 ]

    [ Edited by boot_wb on 2009/12/29 13:12 ]
    www.hullchimneyservices.co.uk

    UI: Powerbook 5,6 (1.67GHz, 128MB VRam): OS3.1, OSX 10.5.8
    HTPC: Mac Mini G4 (1,5GHz, 64MB VRam): OS3.1 (ZVNC)
    Audiophile: Efika 5200b (SB Audigy): OS3.1 (VNC + Virtual Monitor)

    Windows free since 2011!
  • »29.12.09 - 11:11
    Profile Visit Website
  • Butterfly
    Butterfly
    Norbi
    Posts: 99 from 2004/6/19
    http://www.mplayerhq.hu/DOCS/HTML/en/advaudio-volume.html
  • »29.12.09 - 11:45
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Korni
    Posts: 473 from 2006/2/23
    From: the Planet of ...
    It's not a bug. Software mixing isn't supported yet on a Mini. Anyway, RUN >NIL: <path>/MPlayer -gui 1 -volume 60 %sp
    http://korni.ppa.pl/modkowypaczek/ | My Rifle, My Bunny, and Me
  • »29.12.09 - 11:53
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    boot_wb
    Posts: 874 from 2007/4/9
    From: Kingston upon ...
    @Norbi & Korni

    Thanks guys, I'll give that a go.

    Rich
    www.hullchimneyservices.co.uk

    UI: Powerbook 5,6 (1.67GHz, 128MB VRam): OS3.1, OSX 10.5.8
    HTPC: Mac Mini G4 (1,5GHz, 64MB VRam): OS3.1 (ZVNC)
    Audiophile: Efika 5200b (SB Audigy): OS3.1 (VNC + Virtual Monitor)

    Windows free since 2011!
  • »29.12.09 - 11:55
    Profile Visit Website
  • Fab
  • MorphOS Developer
    Fab
    Posts: 1331 from 2003/6/16
    There are a couple solutions indeed. But first, that global mixing volume not working on mini is not a real "bug", but a consequence of the lack of hardware mixer in mini (this stuff just works on pegasos or efika, for instance). For Mac mini, it would need a totally software solution at AHI level, which doesn't exist at the moment.

    Anyway, back to mplayer :
    - You can use like said above the options listed in the documentation, but they don't set the volume level in mplayer, but rather apply a filter and keep the mplayer volume at 100%, so it's not what you want, IMO

    - Add "-volume 50" to the command line to set initial volume at 50%

    And just for fun, you can change volume at runtime with rexx too:
    rx "address MPLAYER.1; 'volume abs 50'"

    (the rexx interface also exposes all mplayer internal commands through the "RAW" rexx command)
  • »29.12.09 - 12:00
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    boot_wb
    Posts: 874 from 2007/4/9
    From: Kingston upon ...
    Thanks Fab - interesting to know about the Rexx interface too.

    Really appreciate your hard work on MPlayer and OWB. :-)

    Rich
    www.hullchimneyservices.co.uk

    UI: Powerbook 5,6 (1.67GHz, 128MB VRam): OS3.1, OSX 10.5.8
    HTPC: Mac Mini G4 (1,5GHz, 64MB VRam): OS3.1 (ZVNC)
    Audiophile: Efika 5200b (SB Audigy): OS3.1 (VNC + Virtual Monitor)

    Windows free since 2011!
  • »29.12.09 - 12:03
    Profile Visit Website
  • jPV
  • Yokemate of Keyboards
    Yokemate of Keyboards
    jPV
    Posts: 2221 from 2003/2/24
    From: po-RNO
    And as MorphOS has a nice command for sending AREXX commands directly to programs.. this might look little cleaner:

    RXCmd MPLAYER.1 "volume abs 50"

    And as speaking of Mac mini as a media player... I've just configured my MorphOS on mini to be controlled with remote controller :) I don't need keyboard or mouse at all to be able watch DVDs or other videos, listening music or watch photos. Now it's easy to take mini with only remote control to other places etc.

    I used MMKeyboard to map buttons as I want... DVD button starts DVD playing directly, music button opens AMPlifier with all my mp3s, photo button opens ShowGirls with my digital photo directory and video button opens Ambient drawer with my video files. I can browse and rotate pictures in SG.. and browse and start playing videos in Ambient etc.

    Then I also have little arexx script to control all players with one script. Remote controller's play, pause, stop, prev, next and volume buttons work with all players (mplayer, amplifier, anr, songplayer, amigaamp).

    BTW. I also tried another USB remote control device, but didn't get it work with Poseidon... it had option to control the mouse too, while this working device works as keyboard only. I'm guessing that keyboard+mouse combo devices don't work properly.. anyone knows anything about it?
    The wiki based MorphOS Library - Your starting point for MorphOS
    Software and other things made by me
  • »29.12.09 - 15:46
    Profile Visit Website