FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 06-17-2012, 11:26 AM
 
Default Muting internal speakers

On Thu, Jun 14, 2012 at 10:52:16PM +0200, Nelson Marambio wrote:
> Since the change from Win 7 to Arch there is just one function I
> really miss up to now. Perhaps someone of you can help me out.
>
> Is it possible that Arch deactivates the internal speakers of my
> laptop when I plug in my USB-headset and turn input / output to this
> ?
>
> In Windows I could define the USB headset as default for in-/output
> so Win made a fallback to internal speakers only when I plugged out
> the headset again.
>
> It would be really great if Arch was that comfortable too. I know in
> GNOME there are just two clicks to do for switching to another audio
> hardware but ...
>
> Warm regards,
> Nelson.

I think this module [1] would solve your problem. (If you didn't abandon PA
already)

https://wiki.archlinux.org/index.php/PulseAudio#Automatically_switch_to_Bluetooth_or_US B_headset
 
Old 06-18-2012, 12:34 PM
"Stephen E. Baker"
 
Default Muting internal speakers

On 15/06/2012 8:30 PM, Oon-Ee Ng wrote:

Still not on my laptop, but I searched around, posted it a while back on
the pulseaudio wiki. Here it is

http://www.freedesktop.org/wiki/Software/PulseAudio/FAQ#How_do_I_switch_the_default_sound_card.2C_movi ng_all_applications.3F

Again, not sure if by now there's a way to run this script whenever a card
is plugged in and out, if you do find that let me know =). Like I said, I
just bind the script to a shortcut key using xbindkeys


I'm not sure how 'recommended' it is, but there is a method of running
scripts when devices are plugged in using udev rules. There is a guide
here
http://www.banquise.org/hardware/how-to-automatically-run-a-script-after-inserting-a-usb-device-on-ubuntu/
though it involves being able to identify which device your usb sound
device is.


(Rather than blindingly following the example I recommend reading
through http://www.reactivated.net/writing_udev_rules.html to understand
what you are doing)
 
Old 06-18-2012, 01:41 PM
Ralf Mardorf
 
Default Muting internal speakers

On Mon, 2012-06-18 at 08:34 -0400, Stephen E. Baker wrote:
> it involves being able to identify which device your usb sound
> device is.

"So run:
udevinfo -a -p /sys/block/sda
(replace sda with you device)" -
http://www.banquise.org/hardware/how-to-automatically-run-a-script-after-inserting-a-usb-device-on-ubuntu/

What is the name for the sound device?

FWIW, you get unique device name listed in /proc/asound/

A Swissonic device
spinymouse@precise:~$ ls -hAl /proc/asound/ | grep card3
dr-xr-xr-x 2 root root 0 Jun 18 15:14 card3
lrwxrwxrwx 1 root root 5 Jun 18 15:14 U0x170b0x11 -> card3
A Korg device
spinymouse@precise:~$ ls -hAl /proc/asound/ | grep card3
dr-xr-xr-x 2 root root 0 Jun 18 15:14 card3
lrwxrwxrwx 1 root root 5 Jun 18 15:14 nanoKONTROL -> card3

but what names are used for "udevinfo -a -p /sys/block/[...]"?

spinymouse@precise:~$ ls /sys/block/
loop0 loop2 loop4 loop6 ram0 ram10 ram12 ram14 ram2 ram4 ram6
ram8 sda sr0
loop1 loop3 loop5 loop7 ram1 ram11 ram13 ram15 ram3 ram5 ram7
ram9 sdb
 
Old 06-18-2012, 01:48 PM
Ralf Mardorf
 
Default Muting internal speakers

On Mon, 2012-06-18 at 15:41 +0200, Ralf Mardorf wrote:
> On Mon, 2012-06-18 at 08:34 -0400, Stephen E. Baker wrote:
> > it involves being able to identify which device your usb sound
> > device is.
>
> "So run:
> udevinfo -a -p /sys/block/sda
> (replace sda with you device)" -
> http://www.banquise.org/hardware/how-to-automatically-run-a-script-after-inserting-a-usb-device-on-ubuntu/
>
> What is the name for the sound device?
>
> FWIW, you get unique device name listed in /proc/asound/
>
> A Swissonic device
> spinymouse@precise:~$ ls -hAl /proc/asound/ | grep card3
> dr-xr-xr-x 2 root root 0 Jun 18 15:14 card3
> lrwxrwxrwx 1 root root 5 Jun 18 15:14 U0x170b0x11 -> card3
> A Korg device
> spinymouse@precise:~$ ls -hAl /proc/asound/ | grep card3
> dr-xr-xr-x 2 root root 0 Jun 18 15:14 card3
> lrwxrwxrwx 1 root root 5 Jun 18 15:14 nanoKONTROL -> card3
>
> but what names are used for "udevinfo -a -p /sys/block/[...]"?
>
> spinymouse@precise:~$ ls /sys/block/
> loop0 loop2 loop4 loop6 ram0 ram10 ram12 ram14 ram2 ram4 ram6
> ram8 sda sr0
> loop1 loop3 loop5 loop7 ram1 ram11 ram13 ram15 ram3 ram5 ram7
> ram9 sdb

Resp. in /sys/"whatever"
 
Old 06-18-2012, 01:56 PM
"Nelson Marambio"
 
Default Muting internal speakers

/dev/* ?
/var/media/* ?

-------- Original-Nachricht --------
> Datum: Mon, 18 Jun 2012 15:48:26 +0200
> Von: Ralf Mardorf <ralf.mardorf@alice-dsl.net>
> An: arch-general@archlinux.org
> Betreff: Re: [arch-general] Muting internal speakers

> On Mon, 2012-06-18 at 15:41 +0200, Ralf Mardorf wrote:
> > On Mon, 2012-06-18 at 08:34 -0400, Stephen E. Baker wrote:
> > > it involves being able to identify which device your usb sound
> > > device is.
> >
> > "So run:
> > udevinfo -a -p /sys/block/sda
> > (replace sda with you device)" -
> >
> http://www.banquise.org/hardware/how-to-automatically-run-a-script-after-inserting-a-usb-device-on-ubuntu/
> >
> > What is the name for the sound device?
> >
> > FWIW, you get unique device name listed in /proc/asound/
> >
> > A Swissonic device
> > spinymouse@precise:~$ ls -hAl /proc/asound/ | grep card3
> > dr-xr-xr-x 2 root root 0 Jun 18 15:14 card3
> > lrwxrwxrwx 1 root root 5 Jun 18 15:14 U0x170b0x11 -> card3
> > A Korg device
> > spinymouse@precise:~$ ls -hAl /proc/asound/ | grep card3
> > dr-xr-xr-x 2 root root 0 Jun 18 15:14 card3
> > lrwxrwxrwx 1 root root 5 Jun 18 15:14 nanoKONTROL -> card3
> >
> > but what names are used for "udevinfo -a -p /sys/block/[...]"?
> >
> > spinymouse@precise:~$ ls /sys/block/
> > loop0 loop2 loop4 loop6 ram0 ram10 ram12 ram14 ram2 ram4 ram6
> > ram8 sda sr0
> > loop1 loop3 loop5 loop7 ram1 ram11 ram13 ram15 ram3 ram5 ram7
> > ram9 sdb
>
> Resp. in /sys/"whatever"
>
 
Old 06-18-2012, 02:24 PM
"Stephen E. Baker"
 
Default Muting internal speakers

On 18/06/2012 9:48 AM, Ralf Mardorf wrote:

On Mon, 2012-06-18 at 15:41 +0200, Ralf Mardorf wrote:

On Mon, 2012-06-18 at 08:34 -0400, Stephen E. Baker wrote:

it involves being able to identify which device your usb sound
device is.

"So run:
udevinfo -a -p /sys/block/sda
(replace sda with you device)" -
http://www.banquise.org/hardware/how-to-automatically-run-a-script-after-inserting-a-usb-device-on-ubuntu/

What is the name for the sound device?

FWIW, you get unique device name listed in /proc/asound/

A Swissonic device
spinymouse@precise:~$ ls -hAl /proc/asound/ | grep card3
dr-xr-xr-x 2 root root 0 Jun 18 15:14 card3
lrwxrwxrwx 1 root root 5 Jun 18 15:14 U0x170b0x11 -> card3
A Korg device
spinymouse@precise:~$ ls -hAl /proc/asound/ | grep card3
dr-xr-xr-x 2 root root 0 Jun 18 15:14 card3
lrwxrwxrwx 1 root root 5 Jun 18 15:14 nanoKONTROL -> card3

but what names are used for "udevinfo -a -p /sys/block/[...]"?

spinymouse@precise:~$ ls /sys/block/
loop0 loop2 loop4 loop6 ram0 ram10 ram12 ram14 ram2 ram4 ram6
ram8 sda sr0
loop1 loop3 loop5 loop7 ram1 ram11 ram13 ram15 ram3 ram5 ram7
ram9 sdb

Resp. in /sys/"whatever"

/sys/block/ is block devices (i.e. hard drives, potential ram drives,
loop back devices), so it wouldn't be in there. I'm not sure where in
/sys it would be, but if you check the last few lines dmesg after
plugging it in it should tell you.
 
Old 06-18-2012, 02:43 PM
Ray Kohler
 
Default Muting internal speakers

On Mon, Jun 18, 2012 at 10:24 AM, Stephen E. Baker
<baker.stephen.e@gmail.com> wrote:
> On 18/06/2012 9:48 AM, Ralf Mardorf wrote:
>>
>> On Mon, 2012-06-18 at 15:41 +0200, Ralf Mardorf wrote:
>>>
>>> On Mon, 2012-06-18 at 08:34 -0400, Stephen E. Baker wrote:
>>>>
>>>> it involves being able to identify which device your usb sound
>>>> device is.
>>>
>>> "So run:
>>> udevinfo -a -p /sys/block/sda
>>> (replace sda with you device)" -
>>>
>>> http://www.banquise.org/hardware/how-to-automatically-run-a-script-after-inserting-a-usb-device-on-ubuntu/
>>>
>>> What is the name for the sound device?
>>>
>>> FWIW, you get unique device name listed in /proc/asound/
>>>
>>> A Swissonic device
>>> spinymouse@precise:~$ ls -hAl /proc/asound/ | grep card3
>>> dr-xr-xr-x 2 root root 0 Jun 18 15:14 card3
>>> lrwxrwxrwx 1 root root 5 Jun 18 15:14 U0x170b0x11 -> *card3
>>> A Korg device
>>> spinymouse@precise:~$ ls -hAl /proc/asound/ | grep card3
>>> dr-xr-xr-x 2 root root 0 Jun 18 15:14 card3
>>> lrwxrwxrwx 1 root root 5 Jun 18 15:14 nanoKONTROL -> *card3
>>>
>>> but what names are used for "udevinfo -a -p /sys/block/[...]"?
>>>
>>> spinymouse@precise:~$ ls /sys/block/
>>> loop0 *loop2 *loop4 *loop6 *ram0 *ram10 *ram12 *ram14 *ram2 *ram4 *ram6
>>> ram8 *sda *sr0
>>> loop1 *loop3 *loop5 *loop7 *ram1 *ram11 *ram13 *ram15 *ram3 *ram5 *ram7
>>> ram9 *sdb
>>
>> Resp. in /sys/"whatever"
>>
> /sys/block/ is block devices (i.e. hard drives, potential ram drives, loop
> back devices), so it wouldn't be in there. * I'm not sure where in /sys it
> would be, but if you check the last few lines dmesg after plugging it in it
> should tell you.

Try /sys/class/sound/card0 (or card1, or whatever number).
 
Old 06-18-2012, 04:50 PM
Ralf Mardorf
 
Default Muting internal speakers

On Mon, 2012-06-18 at 10:43 -0400, Ray Kohler wrote:
> Try /sys/class/sound/card0 (or card1, or whatever number).

Without USB
spinymouse@precise:~$ ls /sys/class/sound
card0 card2 controlC1 dmmidi dmmidi2 midi midi2 midiC1D0
pcmC0D0c pcmC1D0c pcmC2D0c seq
card1 controlC0 controlC2 dmmidi1 hwC0D0 midi1 midiC0D0 midiC2D0
pcmC0D0p pcmC1D0p pcmC2D0p timer
With USB
spinymouse@precise:~$ ls /sys/class/sound
card0 card3 controlC2 dmmidi1 hwC0D0 midi2 midiC1D0
pcmC0D0c pcmC1D0p seq
card1 controlC0 controlC3 dmmidi2 midi midi3 midiC2D0
pcmC0D0p pcmC2D0c timer
card2 controlC1 dmmidi dmmidi3 midi1 midiC0D0 midiC3D0
pcmC1D0c pcmC2D0p



Should be ok for the needs of the OP, since he doesn't need just one
special device.

OT:
I was thinking of another issue that happens to rtirq users. Some unique
names changed, e.g. ICE1712 became ice1, so we can't distinguish between
ICE1712 and ICE1724 anymore to set up the prio for soft IRQs and even
for other cards rtirq settings needs to be different for different
kernel versions.
 

Thread Tools




All times are GMT. The time now is 12:42 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org