You are not logged in.

#1 2013-04-24 21:50:43

toni
Member
Registered: 2011-10-15
Posts: 437

oss4 - annoying hell beep

It seems that I have problems with my sound card. I am using OSS, and at system boot, when it is initialized, a constant, continuous and very very loud and annoying beep starts to sound and it does not stop never. I cannot work trying to investigate what is happening by making use of ossdetect, ossinfo and comands like that because the beep does not stop and it so annoying that I have to shutdown the laptop.... so please, how can I solve this?

I highly apprecite if someone can help me. I have searched in arch wiki related to oss and read a lot of information but I have not work with my laptop as this sound is very annoying...

ossinfo output:

Version info: OSS 4.2 (b 2007/201303142121) (0x00040100) GPL
Platform: Linux/i686 3.8.8-1-ARCH #1 SMP PREEMPT Wed Apr 17 12:10:14 CEST 2013 (localhost)

Number of audio devices:	0
Number of audio engines:	0
Number of MIDI devices:		0
Number of mixer devices:	0


Device objects
 0: osscore0 OSS core services

MIDI devices (/dev/midi*)

Mixer devices

Audio devices

Nodes
  /dev/dsp -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_in -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_out -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_ac3 -> /dev/oss/oss_hdaudio0/spdout0
  /dev/dsp_mmap -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_multich -> /dev/oss/oss_hdaudio0/pcm0

ossdetect -v output:

Detected Intel High Definition Audio (PPT)
USB support available in the system, adding USB driver
Detected Generic USB audio/MIDI device (BETA)

Last edited by toni (2013-05-01 10:58:36)

Offline

#2 2013-04-26 00:33:33

toni
Member
Registered: 2011-10-15
Posts: 437

Re: oss4 - annoying hell beep

It seems that I have successfully blacklisted pcspkr by inserting install pcspkr /bin/false in modprobe.conf in /etc/modprobe.d/modprobe.conf and then adding this file to files section in /etc/mkinitcpio.conf and finally doing mkinitcpio -p linux.

I guess if there is a way to correctly configure oss and be sure that it works by keeping blacklisted pcspkr because if I have not properly configured oss, and I remove the blacklist done, a loud beep starts to sound. So I only want to remove the blacklist when I am sure oss is correctly configured. I want to avoid the annoying beep that never stops.

Any ideas?

Offline

#3 2013-04-26 19:51:30

toni
Member
Registered: 2011-10-15
Posts: 437

Re: oss4 - annoying hell beep

Unfortunately, I have not solved this yet... I have done a lot of thing that I have found in arch forum but nothing works for me.

Below I post some outputs related to some commands executed from console. I have blacklisted pcspkr in a different ways but nothing works, this is loaded by systemd.
I continue having no sound and that annoying beep continues once logging.

Once logging I do the following:

1.-  Output for systemctl status oss.service

oss.service - Open Sound System v4
   Loaded: loaded (/usr/lib/systemd/system/oss.service; enabled)
   Active: activating (start) since vie 2013-04-26 19:42:18 CEST; 1min 42s ago
 Main PID: 438 (soundon)
   CGroup: name=systemd:/system/oss.service
           ├─438 /bin/sh /usr/sbin/soundon
           ├─463 /usr/sbin/ossvermagic -z -s
           └─464 /usr/sbin/ossvermagic -z -s

2.- Output for ossinfo -v3

No /dev/mixer device available in your system.
Perhaps Open Sound System is not installed or running.

3.- Output for ossmix -a

/dev/mixer: No such file or directory

4.- At this point I do the following.
Output for systemctl status oss.service:

oss.service - Open Sound System v4
   Loaded: loaded (/usr/lib/systemd/system/oss.service; enabled)
   Active: activating (start) since vie 2013-04-26 19:42:18 CEST; 2min 24s ago
 Main PID: 438 (soundon)
   CGroup: name=systemd:/system/oss.service
           ├─ 438 /bin/sh /usr/sbin/soundon
           ├─ 463 /usr/sbin/ossvermagic -z -s
           ├─ 464 /usr/sbin/ossvermagic -z -s
           ├─4944 sh -c gunzip -c /usr/lib/modules/3.8.8-2-ARCH/kernel/driver...
           └─4946 /bin/sh /usr/bin/gunzip -c /usr/lib/modules/3.8.8-2-ARCH/ke...

5.-As in step 2 it is said that maybe open sound system is not installed and running, first I do soundoff and then soundon:
5.1- Output for soundoff

OSS not loaded.

5.2- Output for soundon

/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory
/tmp/oss.tmpmodule: No such file or directory

(....)

6.- Again output for systemctl status oss.service after doing soundon:

oss.service - Open Sound System v4
   Loaded: loaded (/usr/lib/systemd/system/oss.service; enabled)
   Active: activating (start) since vie 2013-04-26 19:42:18 CEST; 2min 59s ago
 Main PID: 438 (soundon)
   CGroup: name=systemd:/system/oss.service
           ├─ 438 /bin/sh /usr/sbin/soundon
           └─6421 sync

Again I show output twice again

oss.service - Open Sound System v4
   Loaded: loaded (/usr/lib/systemd/system/oss.service; enabled)
   Active: active (exited) since vie 2013-04-26 19:45:39 CEST; 9s ago
  Process: 438 ExecStart=/usr/sbin/soundon (code=exited, status=0/SUCCESS)

7.- Now again I execute the commands you have told me.
7.1- Output for ossinfo -v3

Version info: OSS 4.2 (b 2007/201303142120) (0x00040100) GPL
Platform: Linux/x86_64 3.8.8-2-ARCH #1 SMP PREEMPT Tue Apr 23 10:28:14 CEST 2013 (localhost)

Number of audio devices:    5
Number of audio engines:    9
Number of MIDI devices:        0
Number of mixer devices:    1


Device objects
 0: osscore0 OSS core services
 1: oss_hdaudio0 Intel HD Audio interrupts=444 (444)
    HD Audio controller Intel HD Audio
    Vendor ID    0x80861e20
    Subvendor ID 0x10431457
     Codec  0: Unknown (0x10ec0270/0x10431457)
     Codec  3: Unknown (0x80862806/0x80860101)
 2: oss_usb0 USB audio core services

MIDI devices (/dev/midi*)

Mixer devices
 0: High Definition Audio 0x10ec027 (Mixer 0 of device object 1)
    Device file /dev/oss/oss_hdaudio0/mix0, Legacy device /dev/mixer0
    Priority: 10
    Caps:
    Device handle: PCI14571043-0000:00:1b.0-mx01
    Device priority: 10


Audio devices
HD Audio play pcm1                /dev/oss/oss_hdaudio0/pcm0  (device index 0)
    Legacy device /dev/dsp0
    Caps: DUPLEX TRIGGER MMAP
    Modes: IN/OUT
      Out engine  1: 0/HD Audio play pcm1
                     Available for use
      Engine      2: 5/HD Audio play pcm1 (vmix)
                     Available for use
      Engine      3: 6/HD Audio play pcm1 (vmix)
                     Available for use
      Engine      4: 7/HD Audio play pcm1 (vmix)
                     Available for use
      Engine      5: 8/HD Audio play pcm1 (vmix)
                     Available for use
    Input formats (0x00001010):
      AFMT_S16_LE    - 16 bit signed little endian
      AFMT_S32_LE    - 32 bit signed little endian
    Output formats (0x00001010):
      AFMT_S16_LE    - 16 bit signed little endian
      AFMT_S32_LE    - 32 bit signed little endian
    Device handle: PCI14571043-0000:00:1b.0-au01
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 8
    Native sample rates (min - max): 44100 - 192000 (44100,48000,96000,192000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play pcm2                /dev/oss/oss_hdaudio0/pcm1  (device index 1)
    Legacy device /dev/dsp1
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 1/HD Audio play pcm2
                     Available for use
    Input formats (0x00001010):
      AFMT_S16_LE    - 16 bit signed little endian
      AFMT_S32_LE    - 32 bit signed little endian
    Output formats (0x00001010):
      AFMT_S16_LE    - 16 bit signed little endian
      AFMT_S32_LE    - 32 bit signed little endian
    Device handle: PCI14571043-0000:00:1b.0-au02
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 2
    Native sample rates (min - max): 44100 - 192000 (44100,48000,96000,192000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio play spdifout            /dev/oss/oss_hdaudio0/spdout0  (device index 2)
    Legacy device /dev/dsp4
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 2/HD Audio play spdifout
                     Available for use
    Input formats (0x00001410):
      AFMT_S16_LE    - 16 bit signed little endian
      AFMT_AC3        - AC3 (Dolby Digital) encoded audio
      AFMT_S32_LE    - 32 bit signed little endian
    Output formats (0x00001410):
      AFMT_S16_LE    - 16 bit signed little endian
      AFMT_AC3        - AC3 (Dolby Digital) encoded audio
      AFMT_S32_LE    - 32 bit signed little endian
    Device handle: PCI14571043-0000:00:1b.0-au03
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 2
    Native sample rates (min - max): 32000 - 192000 (32000,44100,48000,88200,96000,176400,192000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio rec mix4                 /dev/oss/oss_hdaudio0/pcmin0  (device index 3)
    Legacy device /dev/dsp5
    Caps: DUPLEX TRIGGER MMAP
    Modes: IN/OUT
      In engine   1: 3/HD Audio rec mix4
                     Available for use
      Engine      2: 5/HD Audio play pcm1 (vmix)
                     Available for use
      Engine      3: 6/HD Audio play pcm1 (vmix)
                     Available for use
      Engine      4: 7/HD Audio play pcm1 (vmix)
                     Available for use
      Engine      5: 8/HD Audio play pcm1 (vmix)
                     Available for use
    Input formats (0x00001010):
      AFMT_S16_LE    - 16 bit signed little endian
      AFMT_S32_LE    - 32 bit signed little endian
    Output formats (0x00001010):
      AFMT_S16_LE    - 16 bit signed little endian
      AFMT_S32_LE    - 32 bit signed little endian
    Device handle: PCI14571043-0000:00:1b.0-au04
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 2
    Native sample rates (min - max): 44100 - 192000 (44100,48000,96000,192000)
    HW Type: Not indicated.
    Minimum latency: Not indicated

HD Audio rec select               /dev/oss/oss_hdaudio0/pcmin1  (device index 4)
    Legacy device /dev/dsp6
    Caps: TRIGGER MMAP
    Modes: INPUT 
      In engine   1: 4/HD Audio rec select
                     Available for use
    Input formats (0x00001010):
      AFMT_S16_LE    - 16 bit signed little endian
      AFMT_S32_LE    - 32 bit signed little endian
    Output formats (0x00001010):
      AFMT_S16_LE    - 16 bit signed little endian
      AFMT_S32_LE    - 32 bit signed little endian
    Device handle: PCI14571043-0000:00:1b.0-au05
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 2
    Native sample rates (min - max): 44100 - 192000 (44100,48000,96000,192000)
    HW Type: Not indicated.
    Minimum latency: Not indicated


Nodes
  /dev/dsp -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_in -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_out -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_ac3 -> /dev/oss/oss_hdaudio0/spdout0
  /dev/dsp_mmap -> /dev/oss/oss_hdaudio0/pcm0
  /dev/dsp_multich -> /dev/oss/oss_hdaudio0/pcm0

7.2- Output for ossmix -a

Selected mixer 0/High Definition Audio 0x10ec0270
Known controls are:
codec1.jack.int-speaker.mode <mix2|mix3> (currently mix2)
codec1.jack.int-speaker.mute ON|OFF (currently OFF)
codec1.jack.black.mode1 <mix3|input> (currently mix3)
codec1.jack.black [<leftvol>:<rightvol>] (currently 35.9:35.9 dB)
codec1.jack.black.mute1 ON|OFF (currently OFF)
codec1.jack.black.pcm2 [<leftvol>:<rightvol>] (currently 52.4:52.4 dB)
codec1.jack.black.pcm2-mute ON|OFF (currently OFF)
codec1.jack.black.mix1-mute ON|OFF (currently OFF)
codec1.jack.int-mic [<leftvol>:<rightvol>] (currently 35.9:35.9 dB)
codec1.jack.black.mode2 <mix2|mix3> (currently mix2)
codec1.jack.black.mute2 ON|OFF (currently OFF)
codec1.record.mix4.mute.mix3 ON|OFF (currently OFF)
codec1.record.mix4.mute.int-mic ON|OFF (currently OFF)
codec1.record.mix4.mute.mix1 ON|OFF (currently OFF)
codec1.record.mix4 [<leftvol>:<rightvol>] (currently 38.9:38.9 dB)
codec1.record.select.select <mix3|int-mic|mix1> (currently mix3)
codec1.record.select [<leftvol>:<rightvol>] (currently 38.9:38.9 dB)
codec1.misc.pcm1 [<leftvol>:<rightvol>] (currently 52.4:52.4 dB)
codec1.misc.mix3 [<leftvol>:<rightvol>] (currently 38.9:38.9 dB)
codec1.misc.int-mic [<leftvol>:<rightvol>] (currently 38.9:38.9 dB)
codec1.misc.mix1 <mix3|int-mic> (currently mix3)
codec1.misc.pcm1-mute ON|OFF (currently OFF)
codec1.misc.mix1-mute ON|OFF (currently OFF)
codec1.misc.mix2 <pcm1|mix1> (currently pcm1)
codec4.jack.int-digout.mute ON|OFF (currently OFF)
vmix0-enable ON|OFF (currently ON)
vmix0-rate <decimal value> (currently 48000) (Read-only)
vmix0-channels <Stereo|Multich> (currently Stereo)
vmix0-src <Fast|High|OFF> (currently Fast)
vmix0-outvol <monovol> (currently 25.0 dB)
vmix0-invol <monovol> (currently 25.0 dB)
vmix0.pcm5 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm6 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm7 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm8 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)

/var/log/soundon.log

+++ /proc/opensound/devfiles +++
sndstat 249 0
midi 249 1
mixer 249 2
oss/oss_hdaudio0/mix0 248 3
oss/oss_hdaudio0/pcm0 248 4
oss/oss_hdaudio0/pcm1 248 6
oss/oss_hdaudio0/spdout0 248 8
oss/oss_hdaudio0/spdout1 248 10
oss/oss_hdaudio0/spdout2 248 12
oss/oss_hdaudio0/spdout3 248 14
oss/oss_hdaudio0/pcmin0 248 16
oss/oss_hdaudio0/pcmin1 248 18
lrwxrwxrwx 1 root root      26 may  1 11:59 /dev/dsp -> /dev/oss/oss_hdaudio0/pcm0
lrwxrwxrwx 1 root root      26 may  1 11:59 /dev/dsp0 -> /dev/oss/oss_hdaudio0/pcm0
lrwxrwxrwx 1 root root      26 may  1 11:59 /dev/dsp1 -> /dev/oss/oss_hdaudio0/pcm1
lrwxrwxrwx 1 root root      29 may  1 11:59 /dev/dsp10 -> /dev/oss/oss_hdaudio0/spdout3
lrwxrwxrwx 1 root root      26 may  1 11:59 /dev/dsp2 -> /dev/oss/oss_hdaudio0/pcm2
lrwxrwxrwx 1 root root      26 may  1 11:59 /dev/dsp3 -> /dev/oss/oss_hdaudio0/pcm3
lrwxrwxrwx 1 root root      29 may  1 11:59 /dev/dsp4 -> /dev/oss/oss_hdaudio0/spdout0
lrwxrwxrwx 1 root root      28 may  1 11:59 /dev/dsp5 -> /dev/oss/oss_hdaudio0/pcmin0
lrwxrwxrwx 1 root root      28 may  1 11:59 /dev/dsp6 -> /dev/oss/oss_hdaudio0/pcmin1
lrwxrwxrwx 1 root root      28 may  1 11:59 /dev/dsp7 -> /dev/oss/oss_hdaudio0/pcmin2
lrwxrwxrwx 1 root root      29 may  1 11:59 /dev/dsp8 -> /dev/oss/oss_hdaudio0/spdout1
lrwxrwxrwx 1 root root      29 may  1 11:59 /dev/dsp9 -> /dev/oss/oss_hdaudio0/spdout2
lrwxrwxrwx 1 root root      29 may  1 11:59 /dev/dsp_ac3 -> /dev/oss/oss_hdaudio0/spdout0
lrwxrwxrwx 1 root root      26 may  1 11:59 /dev/dsp_in -> /dev/oss/oss_hdaudio0/pcm0
lrwxrwxrwx 1 root root      26 may  1 11:59 /dev/dsp_mmap -> /dev/oss/oss_hdaudio0/pcm0
lrwxrwxrwx 1 root root      26 may  1 11:59 /dev/dsp_multich -> /dev/oss/oss_hdaudio0/pcm0
lrwxrwxrwx 1 root root      26 may  1 11:59 /dev/dsp_out -> /dev/oss/oss_hdaudio0/pcm0
crw-rw-rw- 1 root root 249,  1 may  1 11:59 /dev/midi
crw-rw-rw- 1 root root 249,  2 may  1 11:59 /dev/mixer
lrwxrwxrwx 1 root root      26 may  1 11:59 /dev/mixer0 -> /dev/oss/oss_hdaudio0/mix0
crw-rw-rw- 1 root root 248,  3 may  1 11:59 /dev/oss/oss_hdaudio0/mix0
crw-rw-rw- 1 root root 248,  4 may  1 11:59 /dev/oss/oss_hdaudio0/pcm0
crw-rw-rw- 1 root root 248,  6 may  1 11:59 /dev/oss/oss_hdaudio0/pcm1
crw-rw-rw- 1 root root 248, 16 may  1 11:59 /dev/oss/oss_hdaudio0/pcmin0
crw-rw-rw- 1 root root 248, 18 may  1 11:59 /dev/oss/oss_hdaudio0/pcmin1
crw-rw-rw- 1 root root 248,  8 may  1 11:59 /dev/oss/oss_hdaudio0/spdout0
crw-rw-rw- 1 root root 248, 10 may  1 11:59 /dev/oss/oss_hdaudio0/spdout1
crw-rw-rw- 1 root root 248, 12 may  1 11:59 /dev/oss/oss_hdaudio0/spdout2
crw-rw-rw- 1 root root 248, 14 may  1 11:59 /dev/oss/oss_hdaudio0/spdout3

Loading mixer settings from /usr/lib/oss/etc/mixer.save

Last edited by toni (2013-05-01 11:01:45)

Offline

#4 2013-04-27 08:39:16

Thaodan
Member
From: Dortmund, Nordrein-Westfalen
Registered: 2012-04-28
Posts: 448

Re: oss4 - annoying hell beep

Are you sure that you enabled input-mix-mute ?
See  https://wiki.archlinux.org/index.php/OS … t_channels


Linux odin 3.13.1-pf #1 SMP PREEMPT Wed Mar 5 21:47:28 CET 2014 x86_64 GNU/Linux

Offline

#5 2013-04-27 11:24:57

toni
Member
Registered: 2011-10-15
Posts: 437

Re: oss4 - annoying hell beep

Thaodan wrote:

Are you sure that you enabled input-mix-mute ?
See  https://wiki.archlinux.org/index.php/OS … t_channels

I have already solved this issue. As you said and in the link you provided says it was a problem related to Microphone playing through output channels:

"By default, OSS plays back the microphone through the speakers. To disable this in ossxmix find the Misc section and uncheck every input-mix-mute box. "

In my case there was a conflict with mic-in in ossxmix: The conflict was between section "codec1 | jack | int-mic" and "codec1 | misc | int-mic" so by muting int-mic in misc I have solved the problem. Now, once log in in Arch, the beep only sound less than a second and then stops as when oss service is initialized, file "mixer.save" in "/usr/lib/oss/etc" is read and there int-mic is set to mute.

Anyway, despite beep is kept less than a second, it would be great to avoid it so any ideas here? Maybe, by default, avoid OSS plays back the microphone through the speakers without waiting to read mixer.save file on oss service initialized?

Also, as a result of the migration to the new laptop, there are two pending issues related to oss that I have pending to solve:

1). I have an executable script to execute ossxmix in background on arch boot up. This executable script is placed at "~/.config/autostart" folder with the name "ossxmix.desktop". See below script:

[Desktop Entry]
Type=Application
Exec=/usr/local/bin/ossxmix_bg
Hidden=false
X-GNOME-Autostart-enabled=true
Name[en_US]=OSSXMIX
Name=Open Sound System Mixer
Comment[en_US]=Open Sound System Mixer
Comment=Open Sound System Mixer

Note: path "/usr/local/bin/" exists as well as the executable script ossxmix_bg

also ossxmix_bg code is the following:

#!/bin/sh
exec /usr/bin/ossxmix -b

ISSUE: ossxmix  is not executed once log in. Any ideas here?

2). In my old laptop, previous to do the migration to the new one, I could control volume through volume icon/button (that in the system tray - at the far-right of the top Gnome panel-), I mean, when I modified the volume from ossxmix that volume was updated in the gnome control volume, and vice versa. There was a kind of binding but I do not remember how I did it in the past.... I read from a arch wiki or something... I do not remember, but now it is not working. ossxmix was fully integrate with gnome volume control.

I know that I have one script and one system tray applet to do this, ossvol and ossvolctl, see below. They are placed at /usr/bin

ossvol:

#!/bin/bash
#
# ossvol is a simple script to manage oss volume levels and muting.
#
# Script by: Daniel J Griffiths <ghost1227@archlinux.us>

# Configure stuff
VOLSTORE=$XDG_CONFIG_HOME/ossvol/volume
MUTSTORE=$XDG_CONFIG_HOME/ossvol/volume.muted
CHANNEL="vmix0-outvol"
ARGUMENT=$2

# You shouldn't have to edit below here.
[ ! -d $XDG_CONFIG_HOME/ossvol ] && mkdir $XDG_CONFIG_HOME/ossvol

err() {
    echo "$1"
    exit 1
}

usage() {
    echo "usage: ossvol [option] [argument]"
    echo
    echo "Options:"
    echo "     -i, --increase - increase volume by [argument]"
    echo "     -d, --decrease - decrease volume by [argument]"
    echo "     -t, --toggle   - toggle mute on and off"
    echo "     -h, --help     - display this"
    exit
}

toggle() {
    if [ -f $MUTSTORE ]; then
        ossmix $CHANNEL `cat $VOLSTORE`
        rm $MUTSTORE
    else
        VOLUME=$(ossmix $CHANNEL | awk '{print $10}' | awk -F : '{print $1}')
        ossmix $CHANNEL 0
        echo $VOLUME > $VOLSTORE
        touch $MUTSTORE
    fi
}

increase() {
    if [ -f $MUTSTORE ]; then
        TMPVOL=`cat $VOLSTORE`
        NEWVOL=`expr $TMPVOL + $ARGUMENT`
        ossmix $CHANNEL +$NEWVOL
        echo $NEWVOL > $VOLSTORE
        rm $MUTSTORE
    else
        ossmix $CHANNEL +$ARGUMENT
        VOLUME=$(ossmix $CHANNEL | awk '{print $10}' | awk -F : '{print $1}')
        echo $VOLUME > $VOLSTORE
    fi
}

decrease() {
    if [ -f $MUTSTORE ]; then
        TMPVOL=`cat $VOLSTORE`
        NEWVOL=`expr $TMPVOL - $ARGUMENT`
        ossmix $CHANNEL -- -$NEWVOL
        echo $NEWVOL > $VOLSTORE
        rm $MUTSTORE
    else
        ossmix $CHANNEL -- -$ARGUMENT
        VOLUME=$(ossmix $CHANNEL | awk '{print $10}' | awk -F : '{print $1}')
        echo $VOLUME > $VOLSTORE
    fi
}

case "$1" in
	'-i'|'--increase')
	increase
	;;
	'-d'|'--decrease')
	decrease
	;;
	'-t'|'--toggle')
	toggle
	;;
	''|'-h'|'--help')
	usage
	;;
	*)
	err "Unrecognized option \`$1', see ossvol --help"
	;;
esac

ossvolctl:

#!/usr/bin/env python2
"A simple volume control applet."

import gtk
import subprocess

__author__  = "Joakim \"JockeTF\" Soderlund"
__date__    = "2008-08-22"
__license__ = "Public domain."

# Binaries to execute.
OSSMIX  = "ossmix"
OSSXMIX = "ossxmix"

# The device to control.
DEVICE = "vmix0-outvol"

# The maximum outvol volume in decibels.
MAX_DB = 25.0

# Sets an icon for different volume levels.
LEVELS = (
	(22, "audio-volume-high"),
	(18, "audio-volume-medium"),
	(0,  "audio-volume-low"),
	(-1, "audio-volume-muted"),
)

class StatusIcon():
	"The status icon."
	def __init__(self):
		self.icon = gtk.StatusIcon()
		
		self.icon.connect("scroll-event", self.scrollEvent)
		self.icon.connect("activate", self.clickEvent)
		
		self.set_visible = self.icon.set_visible
		
		self.update()


	def scrollEvent(self, widget, event, *args):
		"Changes the volume when the user scrolls on the volume applet."
		if event.direction == gtk.gdk.SCROLL_UP:
			subprocess.call([OSSMIX, DEVICE, "--", "+%.1f" % self.getStep()])
			
		elif event.direction == gtk.gdk.SCROLL_DOWN:
			subprocess.call([OSSMIX, DEVICE, "--", "-%.1f" % self.getStep()])

		self.update()


	def clickEvent(self, widget, *args):
		"Starts or closes ossxmix when the volume applet is clicked."
		if not hasattr(self, "ossxmix"):
			self.ossxmix = subprocess.Popen([OSSXMIX, "-S"])
		else:
			if self.ossxmix.poll() == None:
				self.ossxmix.terminate()
			else:
				self.ossxmix = subprocess.Popen([OSSXMIX, "-S"])

		self.update()

		
	def getVolume(self):
		"Returns the current volume in decibels as a float."
		process = subprocess.Popen([OSSMIX, DEVICE], stdout=subprocess.PIPE)
		volume = float(process.communicate()[0].split()[-2])
		process.wait()
		
		return volume

	
	def getStep(self):
		"Returns the next volume step to make in decibels as a float."
		return (MAX_DB - self.getVolume() + 1) * 0.1


	def getIconName(self):
		"Returns the icon name for the current volume level."
		volume = self.getVolume()
		
		for level in LEVELS:
			if level[0] < volume:
				return level[1]


	def update(self, *args):
		"Updates the volume applet's tooltip and icon."
		self.icon.set_tooltip("Volume: %.1f dB" % self.getVolume())
		self.icon.set_from_icon_name(self.getIconName())


if __name__ == "__main__":
	icon = StatusIcon()
	icon.set_visible(True)
	
	try:
		gtk.main()
	except KeyboardInterrupt:
		print("")

For some reason it seems like the binding has been broken or something else happens that I do not know. Now ossxmix is not fully intregrate with gnome volume control through volume icon/button in the system tray - at the far-right of the top Gnome panel-. Any ideas here?


Thanks in advance!

Last edited by toni (2013-04-27 15:03:06)

Offline

#6 2013-04-27 13:38:12

toni
Member
Registered: 2011-10-15
Posts: 437

Re: oss4 - annoying hell beep

It seems like the script in ~/.config/autostart/ are executed before oss service is started so I think maybe this is the cause. I have observed that oss service is started too later, after log in into arch it takes a few minutes to start. So how to make oss service to start just before log in screen and before scripts in ~/.config/autostart for example?

Thanks!

Offline

#7 2013-04-28 10:59:20

toni
Member
Registered: 2011-10-15
Posts: 437

Re: oss4 - annoying hell beep

For point 2 described in the previous post I have opened a new post rather than discuss here. Below the link:
https://bbs.archlinux.org/viewtopic.php … 6#p1265146

Offline

Board footer

Powered by FluxBB