[SOLVED] Switch all audio input/output to USB headset

Hi, I have a USB headset that I frequently plug/unplug from the computer. Is there a way to make it the default sound device when plugged, and automatically switch back to the motherboard's on-board audio device when unplugged?
Last edited by stavrakis (2012-04-26 15:57:56)

I have an Intel HDA 5.1 internal audio card, and a 5.1 USB headset, using the modules snd_hda_intel and snd_usb_audio respectively. The internal card is set as card 0, and the usb headset is set as card 1.
I'm using ALSA right now, but I wouldn't have a problem switching to Pulseaudio if it's easier.
EDIT: I used pulseaudio and solved it for applications that are not already playing sound (not shown on pavucontrol's Playback tab)
I created a udev rule, which executes a script when card1 is inserted, since I know it is the USB sound device:
SUBSYSTEM=="sound", KERNEL=="card1", ACTION=="change", RUN+="/home/stavros/bin/pulse-ins.sh"
This script (pulse-ins.sh) executes another script as the current user:
#!/bin/bash
su -c "/home/stavros/bin/pulse_insert_card.sh & exit" stavros
pulse_insert_card.sh contains the following:
#!/bin/bash
/usr/bin/pacmd set-default-sink alsa_output.usb-0d8c_USB_Sound_Device-00-Device.analog-surround-51
/usr/bin/pacmd set-default-source alsa_input.usb-0d8c_USB_Sound_Device-00-Device.analog-stereo
These 2 scripts and the udev rule automatically change pulseaudio's default output & mic input when the card is inserted. However, applications already playing music have to be switched manually through pavucontrol.
Sometimes, the card is incorrectly identified as "Analog Stereo Duplex", with no 5.1 option. In that case killing pulseaudio and letting it start again solves the problem.
Last edited by stavrakis (2012-03-31 11:49:43)

Similar Messages

  • Utility to switch between Bluetooth headset and built-in audio input/output

    I'm looking for a utility that will switch the Sound preference settings between my Mac's built-in audio input/output device and my Bluetooth headset for use with applications such as Skype.
    The way I envision it working is that I would click an icon at the top of the screen and it would toggle the Sound preferences settings from
    Output = Line Out (or Digital Out)
    Input = Line In (or Digital In)
    to
    Output = (my Bluetooth headset)
    Input = (my Bluetooth headset)
    or vice-versa.
    That's it. It doesn't need to automatically detect my headset as I might be using the headset on another device. Just a button that would toggle between the built-in and Bluetooth device settings.
    Has anyone seen anything like this?

    Thanks, it works great.
    It would be even better if one could define device groups. e.g. Headset, built-in devices, etc. I'll drop a note to the developer.

  • Audio Input Output on MacBook Pro 13 inch

    I want to buy a MacBook Pro 13 inch but the problem is the audio input output port.
    I usually need to use both jacks because in one I record my guitar and in the other I use my headphones.
    Is it possible to get a splitter and to make from one jack, two, input and output or do I need to buy USB headphones?
    A splitter would be the best solution

    From the manual:
    +"*Audio out port.* Connect external speakers, headphones (including iPhone), or digital audio equipment. You can specify audio analog line in functionality, to support line-level microphones and audio equipment, by selecting Audio In in the Sound pane of System Preferences."+
    +"Choose Apple () > System Preferences, and open Sound preferences. Specify whether you want the port to be used for audio input or audio output."+
    This means you must choose whether you want the single audio port on the 13" MBP to be input or output. It mentions iPhone headphones, but those will work only as headphones, not as a combined mic/headset when connected to the MBP.
    (As in, "Oh, now I get it!")
    Thinking on your comment, I see what you mean by 'an extra port' - the iMic has both in and out, meaning you'd actually have three counting the internal port on the MBP.
    Looking back at your first post, you mention USB headphones. That would be fine as well - set the MBP's audio port to be used for input, and connect the USB headphones and use those for output. No 'extra' port that way, and USB headphones are cheaper than an iMic.
    EDIT: The caveat there is that the audio in on the MBP (true for all MBPs, not just the 13") is a line-level input, not a microphone input. So, the MBP is expecting a line-level signal, meaning preamplified audio. If your guitar puts out a line-level signal or you're using a powered mic, fine. Else, you may need the iMic, which can take either line-level or microphone (non-preamplified) input.

  • After OS Upgrade, System Preferences won't recognize audio input/output.

    When I got an iPhone, I had to upgrade to OS 10.5.8, as well as upgrade Safari (to 4.0.3) and iTunes (to 9.0.1) for everything to run smoothly, and it does.
    However, since I went though the motions last week with these upgrades, System Preferences or Utilities doesn't want to recognize my audio input/output jacks. It won't recognize when I plug in my stereo or my headphones. I hook up my computer to my stereo all the time to listen to music in the living areas of my apartment, and now I can't because it isn't reading the jack.
    Any suggestions? How can I get the system to fix this problem?

    Check your Audio MIDI Setup settings.
    These are user-to-user forums where everyday folk post questions and offer answers to each other. Apple does not contribute to this message board. None of us has any idea what Apple is going to do until they do it.
    If you feel it's a "problem" did you post in the Product Feedback area?

  • All audio input dead -- internal mic, USB mic

    Hey folks, for some reason my iMac G5 suddenly will not recognize any sources of audio input.
    In the Sound pref pane, the "internal microphone" option under the Input tab is not even there anymore. Only line-in.
    In addition, when I check input levels with an external (USB) mic, I get zilch. Otherwise, the USB on this machine works fine, and furthermore this same mic works without a hitch on a G4 Powerbook.
    Since this is happening on two very different hardware channels, it must be a software issue.
    I've tried resetting the system's audio by restarting, running Garage Band, running Audacity, anything I could think of. Nothing works.
    As to what could have triggered this change, three events happened recently around the same time involving audio on this machine: iTunes 10.0.1 update; Rogue Amoeba SoundSource update from 2.0 to 2.5; and a PRAM reset when I recently had all audio output also die. (The PRAM reset fixed the output issue.)
    Any ideas?

    Just to follow up, this thread was resolved here:
    http://discussions.apple.com/thread.jspa?messageID=12433876#12433876

  • Garageband Quits Every Time I Change Audio Input/Output

    Hi. I own a Plantronics headset that came with MacSpeech Dictate when I bought that software a few years ago. It shows up on my Mac as a C-Media USB Audio device.
    I'm trying to use it with Garageband. So, in Garageband, I've gone into Preferences and the Audio/MIDI section.
    When I choose the C-Media USB Audo device as either "Audio Input" or "Audio Output" (I want to use the headset for both), Garageband asks if I want to "Change audio driver" and I then click yes. Then Garageband has a status bar saying "Initializing audio driver." Then, before it finishes initializing, Garageband quits. This happens every single time.
    So, I'm not sure what to do. I don't even understand why Garageband is looking for a driver when my headset is a USB device that works with all programs -- it's not a MIDI keyboard.
    Sometimes, after I restart Garagband after the quit, I see that it has changed the device. But this happens more frequently for the Audio Output Device. For instance, the C-Media device is now selected for Audio Output. But I keep selecting it for Audio Input as well and Garageband keeps quitting and when I restart it, the Audio Input device hasn't changed and still says Built-in Microphone.
    I can't imagine I'm the only one who's had this problem. If anyone knows the solution, I'd appreciate it.
    Thanks!
    M

    Thanks for the reply. it got me halfway there. Now it will open for the audio side, but still crashes as soon as I switch to Midi.
    There were no Midi configs in my library, but there's a folder full of them in the main Library. Most of the files in there I don't care about, but there are several that I don't want to lose. Should i trash the folder and then re-install the ones I want?

  • Input/Output Error USB 2.0 External Hard Drive

    I recently started having problems with an external hard drive setup that I did not have prior to trying to setup the drive to be compatible with Time Machine.
    The hard drive enclosure that I have has 2 bays for two SATA drives. I have used this enclosure without any problems until I tried to get 1 drive to act as the backup drive for Time Machine and the other to be storage. I formatted them using Drive Genius. I used the option for GUILD or GUIL which it said was the better format for using with Time Machine.
    The first problem I ran into since reformatting the drives is I got an "input/output" error the first couple times I connected the drive via USB to my Mac. I could still use the drives but I got weird errors every once in a while like "input/output error" or "device was not ejected properly" even though the device had not been unplugged.
    Now the drives will not mount using OS 10.5.5. The drives show up when I open Disk Utility, but I cannot get them to mount. I have ran Disk Utility First Aid, and it says the drives are fine. There is one error that shows up when I run the "Repair Disk" feature. It reads "Invalid content in Journal". But Disk Utility also says "The volume was repaired successfully".
    I have seen some posts when I do a search in google about this issue and it seems this is a known issue. Every suggestion I see says to insert your Tiger DVD and reformat the drive using that and the problem will be solved. The only problem with that is I have a lot of important files on the drive that I cannot lose. I had the files backed up until I moved them to the new drive a while back. Now I do not have a backup because I was in the process of switching to bigger drives and erased the old drives after doing so because everything was working fine.
    I am hoping someone out there may have some suggestions (other than erasing the drive) to get my dives to mount so I can transfer the data off to another drive and reformat after.
    Thanks,
    Paul Rugg

    I have similar problems with my USB external HD. Reformatting or repartitioning will not solve your problem. I've tried that 2 times already. The problem will reappear. My HD was running great until last month, when it suddenly without warning disappears from disk utility and the mac altogether. It not only dismounts itself, but also ejects itself, while still physically connected and the power is still on. The HD has its own power supply of course and is directly connected to one of the iMac USB ports. I have erased, repartitioned, disk verified, rebuild spotlight indexes, cleared PRAM and NVRAM, but nothing has solved the problem.
    It is application independent, and not related to like iTunes as another post had suggested. Nothing to do with Mac applications. It seems to be USB related.
    Messages in the Console seem to indicate something wrong with 'USB transactions passed their expiration point' and 'USB cannot enumerate something', but these statements are a bit cryptic to me. Perhaps an Apple system engineer can someday shed some light here.
    thanks much for any assistance.

  • Setting up audio input/output devices

    I'm running AA3 with an Alesis USB 2.0 mixer attached to my computer. I want the mixer to act as my audio input device, and the computer's soundcard to act as the output. Now, when using AA1.5, I could simply set the audio input device as the USB mixer, and the output device as the soundcard, and I could record and playback without any issue. However, when I go to set the mixer as my input device, AA3 also seems to want to make this my output device. I do not want the mixer to act as the output, I want all output to go through the soundcard. How can I make this distinction in AA3? Let me know if you need more information, I'll be happy to provide it.
    Cheers!
    Sean

    >So, while working in AA1.5, I'd arm a track for recording, hit record, and it would record the sound source I plugged into the mixer. Then I'd hit play, and it would play what I just recorded through my speakers, which are hooked into my soundcard. Then, I'd arm a different track for recording, and once I hit record, I would hear the track I'd just recorded playing through my speakers, while recording a new track, which was being brought in through the mixer. I'm still not entirely clear on why this isn't possible in AA3, or if it is, and I'm just missing something.
    That's a different issue. And it's perfectly possible in 3.0, assuming that you have your sound device set up correctly to use ASIO, and Audition's input and output assignments set to use what's available in it. In fact there are more options in 2.0 and 3.0, because if you use the ASIO driver directly, you can use real-time monitoring
    through Audition rather than through the mixer direct path (which is the usual way). The advantage is that you can add channel effects like reverb to the monitor mix, which often helps singers. This only applies to the monitor feed though - what's actually recorded is 'dry', so you still have all of the effects options available afterwards. To use this mode set the monitoring to 'Audition Mix'.
    But however you look at it, the overall monitoring situation works fine - or believe me, just about every user going would have complained about it by now!
    So, you can't really compare AA1.5 and 3.0 from a monitoring point of view - the ASIO situation makes them look somewhat different. 1.5 effectively ignores monitoring - it just uses the Windows APIs and DLLs to record, which is essentially what's provided by the operating system. And that's why it works with any sound device that the OS recognises. But with 2.0 and 3.0 you are entirely reliant on a system that bypasses most of the OS in order to work faster (lower latency).
    One of the snags with this is that a lot of sound device providers that aren't producing what might be described as 'pro' devices - in other words the providers of on-board sound chips, and a few more besides - don't always provide anything like an acceptable ASIO driver for their devices, and that's why ASIO4ALL was developed.

  • Audio input/output issues

    I just bought a Mac Book Pro and realized there is only one jack for both input/output.  How do I record a guitar directly into Logic while still monitoring through headphones if there is only one jack for both?

    there is a USB dongle for that, they sell them at Guitar Center or online for about $30

  • About the digital audio input/output

    So, those accept optical digital audio, and what kind of other digital audio signals?, what kind of adapter i need to use this feature?, so it is compatible with any 5.1 audio system like home theathers etc?

    so it is compatible with any 5.1 audio system like home theathers etc?
    As long as the stereo has a digital optical audio input, yes.
    The port is a "mini-Toslink" port so you'll need a mini-Toslink to Toslink adapter and then a standard digital optical audio cable (Toslink cable). Sometimes you can find a cable with one of each plug at either end.
    -Doug

  • Strange audio produced when Dynex USB Headset is combined with Realtek ALC888

    t seems that just when I connected my Xbox 360 pc controller, my Dynex USB Headset began acting up.
    Whenever I use the microphone function, the audio comes out as though I was talking through a Nintendo Entertainment System (8 bit-ish sound), no matter what I play the sound through. (So it sounds the same, whether I play it through my Creative desktop speakers or through my headset.)
    I've tried almost every kind of troubleshooting technique I could think of.
    Removing the drivers then installing older ones worked for awhile, then began acting up again.
    I tried rebooting (of course), that didn't fix it.
    Updating sound drivers; nada.
    I recall disabling the sound chip through my BIOS, booting, rebooting, enabling it, then booting, although that only fixed it temporarily. I've tried the headset in another computer with the same OS, and it worked fine, so I don't think it's the microphone.
    I've tried shutting down as many electronics as I could (cellphone, air purifier, xbox controller, unnecessary monitors, wireless mice, even lights), although nothing could fix the odd sounds.
    Later, when I was completely cleaning off the Realtek drivers once again, I decided to just listen to sound trough my headset's earpiece. Everything had 8-bit sounds. Even music files, which originally played normally through my desktop speakers. However, I think my headset it still functioning ok from a hardware perspective, since I plugged it into my other XP machine, and it still worked fine.
    Computer specs:
        * MSI P6NGM-FD motherboard
        * Windows XP SP3
        * Realtek drivers, updated to R256
        * Dynex USB Mon Headset
    Also, here's a small soundclip of me saying hello, then blowing on the microphone.
    Link
    If anyone can help, that would be great.

    Quote from: Wonkanoby on 10-January-11, 08:29:01
    might be irrelevant but most msi usb problems relate to this
    https://forum-en.msi.com/index.php?topic=57472.0
    The issue in there doesn't seem to apply to me, but thank you for the heads up anyways.

  • PS4 Audio output to USB Headset and HDMI

    Hi, I'm having an issue with the audio output from my PS4. I have a capture card (Elgato Game Capture HD) which is connected to my PS4 through the HDMI cable. I also have a Sony Gold Wireless Headset. Whenever I connect the headset using the USB bluetooth connector and have the audio settings set to allow the headset to receive both Chat and Game audio, the game audio going through the HDMI - and thus the Elgato -  is muted. Whenever I set the headset to receive just Chat audio, this then unmutes the HDMI game audio. I would like to be able to receive game and chat audio through the wireless headset, whilst also having game audio through the HDMI, however I have as yet not been able to find a setting to allow this. My question therefore is, is it possible to have game audio through the HDMI whilst also using a headset receiving game audio? Thanks in advance for any help.

    MarvUK wrote:
    I want to play audio from my MacBookPro (13inch) through my Roberts stereo which has a standard USB port, which can be selected as the source for playing through the speakers. Does anyone know of a cable I can use to connect the audio output on my MacBook to the USB input on my stereo?
    I would have thought this was a pretty standard conversion but cant find anyone selling something with a 3.5mm jack on one end and a USB jack on the other?
    Thanks in advance!
    Why don't you use the USB port on your computer to get the audio out? USB to USB.
    Message was edited by: BobTheFisherman

  • Audio input/output problems with Mac Mini

    at first, my sound just stopped working all together and for some reason the monitor was getting no signal from the mac mini. i unplugged everything for a minute and plugged it back in and the monitor was working again, but still nothing with the sound. no sound coming out from even the internal speaker, and the audio in jack (which i use frequently) stopped working as well.
    this is the really strange part: after tinkering around trying to fix the problem i realized the only sound that comes out it is from the internal speaker, but it only comes out when i have something connected to the headphones jack.
    has anyone ever had a problem like this? i'm just trying to figure out if it is something i can take care of myself, or if i might need some repairs done.

    OK, then two things to do.
    First reset parameter RAM - it's an area of non-volatile memory used for system settings and hardware configuration. It it gets corrupted, it can cause odd problems.
    Reset PRAM
    -Shut down the computer.
    -Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in the next step but one.
    -Turn on the computer.
    -Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    -Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    -Release the keys.
    Next, perform an SMC reset. The SMC is the device which controls system hardware and devices, so if there is a problem with hardware components not functioning, it could be that.
    To reset the SMC on an Intel mini:
    -From the Apple menu, choose Shut Down (or if the computer is not responding, hold the power button until it turns off).
    -Unplug all cables from the computer, including the power cord and any display cables.
    -Wait at least 15 seconds.
    -Plug the power cord back in, making sure the power button is not being pressed at the time.
    -Then reconnect your keyboard and mouse to the computer.
    -Press the power button on the back to start up your computer.

  • Audio Input/output under windows xp

    trying to stream AUDIO OVER INTERNET cant get music and mic to work at same time on my mac pro using as a pc on a seperate dhad drive via bootcamp

    There is nothing wrong. Mac OS X does not play-thru the sound input to the computer speakers by itself. You need to run some application that takes the input and plays it out the speakers.
    Here is a small simple app that does precisely that one function and nothing else, LineIn.
    http://www.versiontracker.com/dyn/moreinfo/macosx/18987
    The description does not mention Snow Leopard (10.6), so if it does now work with Snow Leopard, let me know.

  • Audio Input with Edirol USB-PreAmp

    I use a Mac Pro and an Edirol UA-25 EX Audio-Interface. The Mac shows me the up und down moving audio-levels in settings and premiere cs4 offers me the interface to choose in the audio-menu. but i dont know how to get my voice in my project. if anybody knows the answer...
    thanks

    You mean VO recording?  That's pretty well covered in the Help file.

Maybe you are looking for

  • Can't see ishuffle on my mac during setup or download songs

    I'm trying to set up my child's Christmas present, an ishuffle 2G. Following instruction manual. 3rd step - set up suffle using onscreen instructions when they appear.  THEY DIDN'T. So I charged the battery and that's as far as I got. My computer is

  • Lost pictures in recent events of iphoto 08

    over the last 3 days i have imported some picture from my canon g7 into iphoto 08. they were there and working fine until today. the pictures just all of the sudden disappeared. the events are still there but when i click on the event, the pictures s

  • How do i get my airplay to work

    I'm trying to get my airplay to work from my ipod to my itunes on my mac desktop.  Can't seem to get it but I've never really used it before so I'm trying to get it to load.  any help would be great

  • Cannot catch Exception thrown by ADF (source of exception is EJB)

    Even I tried to use try catch block, it still shows unwanted error popup (showing errors) automatically generated by adf. I know the source of this error is EJB, I try to insert duplicate field which must be unique. So EJB throws jdbc exception. How

  • How can implement running total in oracle forms

    I want to implement a running total in oracle form like 100 100 300 400 200 600 500 1100 200 1300 100 1400 PROCEDURE calculate_srno IS current_rownum     integer:=:System.Cursor_Record; starting_srno integer:=:rs_1; last_rownum integer; BEGIN      la