You are not logged in.

#1 2010-08-27 12:45:07

cipater
Member
From: Athens
Registered: 2010-06-09
Posts: 20

Force mono sound

Hi everyone.

The jack input on my laptop is semi-broken and the result is that I only get sound from one of the two speakers.
The question is: Is there a way to force system-wide mono output?

I'm using alsa, openbox and the sound card is hda-intel, if it makes a difference.

Last edited by cipater (2010-09-12 15:18:36)

Offline

#2 2010-08-27 12:57:03

tsv
Member
From: UK
Registered: 2008-12-03
Posts: 71
Website

Re: Force mono sound

I was trying to accomplish this myself a while back and didn't get that far, though I'm sure it must be possible. Same question has been asked in this thread but only with a tiny amount of success by the look of it.

Offline

#3 2010-08-27 13:04:06

cipater
Member
From: Athens
Registered: 2010-06-09
Posts: 20

Re: Force mono sound

Thanks, I'll look into it.
Did you get around it somehow, or did you just buy a new laptop? tongue
In windows, winamp and k-lite had simple mono options, so it wasn't really an issue, but finding apps in linux that do the same has proven a bit harder than expected. (without resorting to command line for every file that is)

Offline

#4 2010-08-27 13:12:51

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Force mono sound

Hm. my approach would be rather a physical:
Use a mono 3.5 mm plug and solder it to a stereo 3.5 mm jack.
Connect the mono plug to both L+R channel of the stereo jack.
Or use a stereo plug (depending on which channel is broken) with
solely L or R channel for this.

HTH,
D$


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#5 2010-08-27 13:29:51

cipater
Member
From: Athens
Registered: 2010-06-09
Posts: 20

Re: Force mono sound

I'll try that if software solutions fail, thanks.
I also tried what was recommended on the thread link above, but no luck.
I didn't have a ~/.asoundrc , so I tried creating it and I also tried applying that to alsa.conf. Neither worked...

Offline

#6 2010-08-27 14:53:30

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Force mono sound

Look into how to downmix from 5.1 to 2.1 or 2.0 and apply the same concept to downmix from 2.0 to mono.

Mind you that your output is still stereo but you must downmix/route all audio to the channel/output that still works.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#7 2010-09-12 00:57:50

cipater
Member
From: Athens
Registered: 2010-06-09
Posts: 20

Re: Force mono sound

Finally found the time to solve it.

For whoever is interested, create a file in your home folder called .asoundrc and write the following in it.

 
pcm.card0 {
      type hw
      card 0
  }
  pcm.mono {
      type route
      slave.pcm card0
      slave.channels 2
      ttable.0.0 0.5
      ttable.0.1 0.5
      ttable.1.0 0.5
      ttable.1.1 0.5 
  }
  pcm.!default {
      type route
      slave.pcm card0
      slave.channels 2
      ttable.0.0 0.5
      ttable.0.1 0.5
      ttable.1.0 0.5
      ttable.1.1 0.5 
  }

As far as I understood, this only applies to my user.
I got the info at http://alsa.opensrc.org/index.php/Talk:.asoundrc .

Offline

#8 2010-09-12 01:52:37

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Force mono sound

cipater wrote:

As far as I understood, this only applies to my user.

Of course - you're writing to a file in *your* home directory. Would you prefer every user be able to read your files??

If you want it "global", put it in /usr/share/alsa/alsa.conf

Offline

#9 2010-09-12 07:32:51

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Force mono sound

brebs wrote:

If you want it "global", put it in /usr/share/alsa/alsa.conf

I believe you mean /etc/asound.conf


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#10 2010-09-12 15:15:04

cipater
Member
From: Athens
Registered: 2010-06-09
Posts: 20

Re: Force mono sound

I seem to be having different problems now.
It works perfectly if I start audacious and then just play.
But sound on youtube doesn't work and after I've tried playing something on it and then play audacious again, I get a message saying
"snd_pcm_open failed: Device or resource busy."
This has to do with allowing multiple instances on alsa, right?
Any ideas about what part of the code messes with it?
Multiple instances worked fine before.

Offline

#11 2010-10-03 10:57:52

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: Force mono sound

cipater wrote:

Finally found the time to solve it.

For whoever is interested, create a file in your home folder called .asoundrc and write the following in it.

 
pcm.card0 {
      type hw
      card 0
  }
  pcm.mono {
      type route
      slave.pcm card0
      slave.channels 2
      ttable.0.0 0.5
      ttable.0.1 0.5
      ttable.1.0 0.5
      ttable.1.1 0.5 
  }
  pcm.!default {
      type route
      slave.pcm card0
      slave.channels 2
      ttable.0.0 0.5
      ttable.0.1 0.5
      ttable.1.0 0.5
      ttable.1.1 0.5 
  }

As far as I understood, this only applies to my user.
I got the info at http://alsa.opensrc.org/index.php/Talk:.asoundrc .

Will it force to mono permanently?

Offline

#12 2010-10-03 12:14:18

cipater
Member
From: Athens
Registered: 2010-06-09
Posts: 20

Re: Force mono sound

No. Deleting (or moving) the file you created and maybe also restarting your computer will revert to whatever your previous settings were.

Offline

#13 2010-10-03 12:33:15

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: Force mono sound

So I can move this file and do

# service alsa restart

?
Will it work?

Update: no, it doesn't work at all. Created a file, restarted ALSA and nothing changed.

Last edited by Mr. Alex (2010-10-03 16:45:24)

Offline

#14 2010-12-15 21:16:55

nemamradfazole
Member
Registered: 2010-03-18
Posts: 40
Website

Re: Force mono sound

Alex, you must close all applications using ALSA, then restart ALSA (# /etc/rc.d/alsa restart) and then try playing something - it worked for me now. But unfortunately it doesn't work as I imagined - it doesn't add a new card which I would be able to switch to in alsamixer, it just changes the setting.

Offline

Board footer

Powered by FluxBB