# Setting up C-Media USB Headphone Set in mixer mode

**URL:** <https://discourse.mopidy.com/t/setting-up-c-media-usb-headphone-set-in-mixer-mode/1409>\
**Category:** Misc\
**Created:** [November 28, 2016, 9:31pm UTC](https://discourse.mopidy.com/t/setting-up-c-media-usb-headphone-set-in-mixer-mode/1409 "2016-11-28T21:31:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheoL](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@TheoL](https://discourse.mopidy.com/u/TheoL)\
**Post date:** [November 28, 2016, 9:31pm UTC](https://discourse.mopidy.com/t/setting-up-c-media-usb-headphone-set-in-mixer-mode/1409/1 "2016-11-28T21:31:54Z")

</div>

I’ve recently purchased a C-Media USB Headphone Set USB sound card. And am able to play MPD through it. I can’t however play a second sound when mopidy is playing a stream. If a play a file with aplay I get the following error:

aplay: main:722: audio open error: Device or resource busy

How can I configure Mopidy so that it uses mixing and doesn’t ‘claim’ the device? I’m relatively new to Raspbian. And I’m using raspbian Jessie latest release.

Much obliged

p.s. Thanx for creating this great music player. I already used Pi MusicBox for a long time. But decided to try Mopidy without Wouter’s add ons.

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [November 28, 2016, 9:46pm UTC](https://discourse.mopidy.com/t/setting-up-c-media-usb-headphone-set-in-mixer-mode/1409/2 "2016-11-28T21:46:00Z")

</div>

You probably need to configure an alsa dmix device. [Impossible to stream another sound when mpd is used (Device or resource busy)](https://discourse.mopidy.com/t/impossible-to-stream-another-sound-when-mpd-is-used-device-or-resource-busy/1301)

---

<div class="post-metadata">

**Author:** ![TheoL](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@TheoL](https://discourse.mopidy.com/u/TheoL)\
**Post date:** [November 28, 2016, 9:49pm UTC](https://discourse.mopidy.com/t/setting-up-c-media-usb-headphone-set-in-mixer-mode/1409/3 "2016-11-28T21:49:30Z")

</div>

Thank you. I’ll give it a try

---

<div class="post-metadata">

**Author:** ![TheoL](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@TheoL](https://discourse.mopidy.com/u/TheoL)\
**Post date:** [December 3, 2016, 2:32pm UTC](https://discourse.mopidy.com/t/setting-up-c-media-usb-headphone-set-in-mixer-mode/1409/4 "2016-12-03T14:32:05Z")

</div>

The link you’ve provided helped me out a lot. But I had to add some permissions (ipc\_perm). So for anyone who comes across the same problem. Here’s my /etc/asound.conf

> pcm.dmixed {  
> type dmix  
> ipc\_key 1024  
> ipc\_key\_add\_uid 0  
> ipc\_perm 0666  
> slave.pcm “hw:1,0”  
> }  
> pcm.dsnooped {  
> type dsnoop  
> ipc\_key 1025  
> slave.pcm “hw:0,0”  
> }

> pcm.duplex {  
> type asym  
> playback.pcm “dmixed”  
> capture.pcm “dsnooped”  
> }

> pcm.!default {  
> type plug  
> slave.pcm “duplex”  
> }

> ctl.!default {  
> type hw  
> card 1  
> }

My [audio] config section in /etc/mopidy/mopidy.conf is the following:

> [audio]  
> mixer\_volume = 100  
> output = alsasink device=dmixed

These config work for me. I’m running mopidy on raspberry jessie with mopidy installed as service.

---

<div class="post-metadata">

**Author:** ![TheoL](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@TheoL](https://discourse.mopidy.com/u/TheoL)\
**Post date:** [February 3, 2018, 4:11pm UTC](https://discourse.mopidy.com/t/setting-up-c-media-usb-headphone-set-in-mixer-mode/1409/5 "2018-02-03T16:11:08Z")

</div>

This week I received a mini Hifiberry. And a hard time getting it to work with ALSA. The previous config worked perfectly for a cheap USB sound card. But the hifiberry mini also needs a soft volume. After searching around I came accross this simple asound.conf which works perfect and is much more simple.

> pcm.!default {  
> type plug  
> slave.pcm “softvol” #make use of softvol  
> }
> 
> pcm.softvol {  
> type softvol  
> slave {  
> pcm “dmix” #redirect the output to dmix (instead of “hw:0,0”)  
> }  
> control {  
> name “PCM” #override the PCM slider to set the softvol volume level globally  
> card 0  
> }  
> }

Configuring Mopidy is also much more simple.

> [audio]  
> mixer = alsamixer  
> output = autoaudiosink
> 
> [alsamixer]  
> card = 0  
> control = PCM

Just in case someone runs into the same problem
