# udev-197 and sound

## OYTIS

Greetings!

After udev update I have some strange problems with sound. alsamixer works OK, sound card is shown and properly controlled, there are BEEPs after login and in xterm, but when I try to play sound with mplayer it outputs "Failed to initialize audio driver 'alsa:device=hw=1.0'". There is aso no sound in youtube etc. I checked /proc/asound/cards and /proc/asound/devices, but they seem OK.

```

>> cat /proc/asound/cards

<<

 0 [Generic        ]: HDA-Intel - HD-Audio Generic

                      HD-Audio Generic at 0x90244000 irq 44

 1 [SB             ]: HDA-Intel - HDA ATI SB

                      HDA ATI SB at 0x90240000 irq 16

```

```

>> cat /proc/asound/devices

<<

  1:        : sequencer

  2: [ 0- 3]: digital audio playback

  3: [ 0- 0]: hardware dependent

  4: [ 0]   : control

  5: [ 1- 0]: digital audio playback

  6: [ 1- 0]: digital audio capture

  7: [ 1- 0]: hardware dependent

  8: [ 1]   : control

 33:        : timer

```

What else could be checked?

----------

## Veldrin

this could be the same as my issue.

check permission on /dev/snd/* (ls -la /dev/snd).

if there permission part shows crw-rw----+, then the acl is correct, if the + is missing (i.e. crw-rw----) then the acl is missing.

as temporary workaround,. you may add you user to the audio group (logout and login again) and the sound should be working again. 

V.

----------

## SamuliSuominen

 *Veldrin wrote:*   

> 
> 
> this could be the same as my issue.
> 
> 

 

Is sys-auth/consolekit built with or without USE="acl"?

Does emerging consolekit print any kernel warnings about missing items... when built with USE="acl" enabled?

----------

## OYTIS

Thank you for your answers.

1. There is no '+' in the access rights. Actually, it's the first time I hear about it.

2. consolekit and udev are built with "acl" USE flag.

3. My user is already in group "audio" and group audio has all necessary permissions for /dev/snd/*

```

>> ls -la /dev/snd/*

<<

total 0

drwxr-xr-x  3 root root      260 Jan 29  2013 .

drwxr-xr-x 15 root root     3480 Jan 28 20:53 ..

drwxr-xr-x  2 root root      100 Jan 29  2013 by-path

crw-rw----  1 root audio 116,  5 Jan 29  2013 controlC0

crw-rw----  1 root audio 116,  9 Jan 29  2013 controlC1

crw-rw----  1 root audio 116,  2 Jan 29  2013 controlC29

crw-rw----  1 root audio 116,  4 Jan 29  2013 hwC0D0

crw-rw----  1 root audio 116,  8 Jan 29  2013 hwC1D0

crw-rw----  1 root audio 116,  3 Jan 29  2013 pcmC0D3p

crw-rw----  1 root audio 116,  7 Jan 29  2013 pcmC1D0c

crw-rw----  1 root audio 116,  6 Jan 28 20:49 pcmC1D0p

crw-rw----  1 root audio 116,  1 Jan 29  2013 seq

crw-rw----  1 root audio 116, 33 Jan 29  2013 timer

```

My udev-rules (namely 70-udev-acl.rules) contain the string that is supposed to enable acl

```
SUBSYSTEM=="sound", TAG+="udev-acl"
```

but for some reason it doesn't work.

UPD:

And no, there were no warnings concerning acl or kernel while building consolekit.

----------

## Fenril

Hi,

I have the same issue. After my recent update, i have no sound, on my both soundcards. Alsa detects correctly soundcards, and modules are all loaded. For example, Audacious says :

```
snd_pcm_open failed: No such device.
```

Did anyone find a solution ?

----------

## SamuliSuominen

 *Fenril wrote:*   

> Hi,
> 
> I have the same issue. After my recent update, i have no sound, on my both soundcards. Alsa detects correctly soundcards, and modules are all loaded. For example, Audacious says :
> 
> ```
> ...

 

Is CONFIG_DEVTMPFS=y enabled in kernel and is /dev mounted now as devtmpfs? See `cat /proc/mounts |grep /dev` output.

Is udev and udev-mount in the boot runlevel? See `rc-update show |grep udev` output.

Just guessing.

----------

## Fenril

Thanks for your help.

Here asked informations :

```
# cat /proc/mounts |grep /dev

/dev/root / ext4 rw,noatime,data=ordered 0 0

udev /dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=1018131,mode=755 0 0

devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0

shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0

/dev/sda8 /home ext4 rw,noatime,data=ordered 0 0

/dev/sda2 /mnt/Windows fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0
```

```
                 udev | boot                  sysinit

           udev-mount |                       sysinit

```

----------

## SamuliSuominen

 *Fenril wrote:*   

> Thanks for your help.
> 
> Here asked informations :
> 
> ```
> ...

 

I should have said "sysinit" runlevel and not "boot" runlevel. You should remove udev from "boot" runlevel and leave it just to "sysinit" runlevel.

I'm not saying this is your problem with sound, just noticed it while looking for something else.

So it seems I was looking at quite wrong things in your problem, lets wait for what others have to say.

----------

## Fenril

So we have to wait ? udev is really a crappy system...

----------

## OYTIS

Yes, and there is one more strange thing here. When I launch mplayer as a root there are no error messages, and by console output it seems that mplayer plays the track correctly, but there is no sound still.

----------

## sick4noise

I was having the same symptoms after upgrading to udev-197-r8 and kernel 3.5.7.  After trying just about everything suggested on the interwebs, I finally discovered that setting CONFIG_SOUND_OSS_CORE_PRECLAIM=N fixed the issue.  You can find it under Device Drivers -> Sound Card Support -> Preclaim OSS device numbers.

----------

## SamuliSuominen

 *sick4noise wrote:*   

> I was having the same symptoms after upgrading to udev-197-r8 and kernel 3.5.7.  After trying just about everything suggested on the interwebs, I finally discovered that setting CONFIG_SOUND_OSS_CORE_PRECLAIM=N fixed the issue.  You can find it under Device Drivers -> Sound Card Support -> Preclaim OSS device numbers.

 

I have it "=y" here and it still works. I guess it's worth to test anyway.

----------

## Pilsner

I would suggest you to try starting mplayer when no X server is started. Could it be that some DM sound back-end blocks the sound.

----------

## OYTIS

No, unfortunately turning off X server didn't help. Neither did updating the kernel to 3.7.9 and disabling  CONFIG_SOUND_OSS_CORE_PRECLAIM. There should be something with udev.

----------

## FRIGN

Considering that the udev-developers are messing the system up and will force you to use systemd in future versions of it, I would recommend you to downgrade to udev-171-r10 (just mask all versions above udev-181 in /etc/portage/package.mask with

```
>=sys-fs/udev-181
```

or alternatively use the gentoo-fork eudev.

Please let me know if that fixed your problem!

----------

## SamuliSuominen

 *FRIGN wrote:*   

> Considering that the udev-developers are messing the system up and will force you to use systemd in future versions of it, I would recommend you to downgrade to udev-171-r10 (just mask all versions above udev-181 in /etc/portage/package.mask with
> 
> ```
> >=sys-fs/udev-181
> ```
> ...

 

sounds like you are grabbing a hammer for tightening a screw  :Razz: 

there is currently no reason to use eudev; it's at same'ish level with udev 197 feature wise (you lose just predicatable network naming support with eudev, but if you don't need one, it doesn't matter which one you run)

Masking isn't recommended since many apps in tree already required 197 and 171 is on it's way out of portage

And 197 runs perfectly fine without systemd, there is no point to even discuss if support for non-systemd systems will be dropped or not, it'd be purely guessing, and it surely isn't happening for gentoo's sys-fs/udev

----------

## FRIGN

 *ssuominen wrote:*   

>  *FRIGN wrote:*   Considering that the udev-developers are messing the system up and will force you to use systemd in future versions of it, I would recommend you to downgrade to udev-171-r10 (just mask all versions above udev-181 in /etc/portage/package.mask with
> 
> ```
> >=sys-fs/udev-181
> ```
> ...

 

It is narrow-minded to guess that. From what I've seen from the developers in the past I can't really trust them any more. My recommendation to go back to 171-r10 is actually based on the fact that it has been the last version with the high amount of deprecations actually preparing udev for a systemd-only environment.

Eudev is actually not on the same level of 197, it is actually below, which doesn't make it worse. We are working on improving the codebase to make it better also in sense of code-cleanup. It is still a young project.

----------

## Fenril

So, is it recommendable to downgrade or not udev ? I still don't have sound, if anyone found a solution...

----------

## VoidMage

 *Fenril wrote:*   

> So, is it recommendable to downgrade or not udev ? I still don't have sound, if anyone found a solution...

 

It's quite likely udev isn't the real problem here.

Is there anything interesting in the output of alsa-info ?

----------

## Fenril

As i said and the author of the topic explained, alsa correctly detects soundcards : with alsaconf, it auto detects, alsamixer shows correctly controls volume and switches for both my soundcards, and all modules are loaded. I use 3.6.11 kernel, with Alsa kernel modules (not Alsa from Portage).

----------

## Scorcerer

Hello.

Same problem here - as OP described, the only difference is that i tried to move from alsa-only setup to pulseaudio. Ran into identical permissions problem. Udev (or ConsoleKit?) just won't set right ACLs on sound devices despite having identical config as arch installation i have on different machine...

----------

## kopancek

Hi all, I ran into the same issue today after upgrading to udev-197. 

Because the ACL is not set on the sound devices, there is a temporary workaround for me to set it manually on each device in /dev/snd by using this command:

```
setfacl -m u:username:rw /dev/snd/*
```

Just replace username with the name of user...

Is there any way to add this to udev rules, so I would not have to run this on my own?  :Smile:  I have never written any udev rule, so complete udev novice...

----------

## SamuliSuominen

I mentioned in https://forums.gentoo.org/viewtopic-t-949450.html that the udev-acl rules that come with ConsoleKit might just not be compatible with new udev anymore, I haven't figured out yet if it's possible to fix them

I'm not sure yet :-/

Help would of course be appericiated

----------

## kopancek

 *ssuominen wrote:*   

> I mentioned in https://forums.gentoo.org/viewtopic-t-949450.html that the udev-acl rules that come with ConsoleKit might just not be compatible with new udev anymore, I haven't figured out yet if it's possible to fix them
> 
> I'm not sure yet :-/
> 
> Help would of course be appericiated

 

I just did a udevadm test /class/sound/controlC0 and found out that udev-acl rules are not being called at all! 

On my system, udev rules are in a (new?) location in:

/lib64/udev/rules.d

The consolekit and also some other rules are in /usr/lib/udev/rules.d so I made a symlink:

/lib64/udev/rules.d/70-udev-acl.rules -> /usr/lib/udev/rules.d/70-udev-acl.rules

and everything now works as expected  :Smile:  Hope this helps everyone soon  :Smile: 

----------

## SamuliSuominen

 *kopancek wrote:*   

>  *ssuominen wrote:*   I mentioned in https://forums.gentoo.org/viewtopic-t-949450.html that the udev-acl rules that come with ConsoleKit might just not be compatible with new udev anymore, I haven't figured out yet if it's possible to fix them
> 
> I'm not sure yet :-/
> 
> Help would of course be appericiated 
> ...

 

OH OK! Now I understand! This is mentioned in the postinst message of udev, all you need to do is re-emerge consolekit, no symlink required.

Re-emerge every package that has a file in /usr/lib/udev/ and it should move to /lib/udev/

This is the message:

 *Quote:*   

> 
> 
> "Please re-emerge all packages on your system which install"
> 
> "rules and helpers in /usr/lib/udev. They should now be in"
> ...

 

----------

## kopancek

 *ssuominen wrote:*   

> 
> 
> OH OK! Now I understand! This is mentioned in the postinst message of udev, all you need to do is re-emerge consolekit, no symlink required.
> 
> Re-emerge every package that has a file in /usr/lib/udev/ and it should move to /lib/udev/
> ...

 

Thanks, this was the real remedy, I somehow missed the message... Everything from /usr/lib/udev/rules.d is after re-emerge in /lib64/udev/rules.d

----------

## OYTIS

Didn't solve the problem for me, unfortunately.

----------

## Fenril

Same here. Nothing helped me. I'm begining to be really tired with udev, it's not the first time...

----------

## OYTIS

Well, maybe it's not exactly udev.

When I remove /etc/asound.conf or just set the default soundcard to something other than my real soundcard mplayer works well. That still is not a solution for me, because I want sound not only in mplayer but also in firefox.

My current /proc/asound/cards

```
 0 [VirMIDI        ]: VirMIDI - VirMIDI

                      Virtual MIDI Card 1

 1 [Generic        ]: HDA-Intel - HD-Audio Generic

                      HD-Audio Generic at 0x90244000 irq 45

 2 [SB             ]: HDA-Intel - HDA ATI SB

                      HDA ATI SB at 0x90240000 irq 16

29 [ThinkPadEC     ]: ThinkPad EC - ThinkPad Console Audio Control

                      ThinkPad Console Audio Control at EC reg 0x30, fw unknown
```

And my /etc/asound.conf

```
pcm.!default {

    type hw

    card 2

}

ctl.!default {

    type hw           

    card 2

}
```

Any ideas?

----------

## OYTIS

Looks like my sound card was held by timidity which launched at startup. For some reason it can't be used by more than one process anymore.

----------

## OYTIS

OK, my alsa wasn't configured properly (dmix was actually disabled), and timidity daemon, which was launched at startup disallowed all other processes from using sound card. I don't know why this problem emerged after udev update. My problem seems solved now, waiting for Fenril's report.

----------

## Featherfoot

I have the same problem.

----------

## SamuliSuominen

 *Featherfoot wrote:*   

> I have the same problem.

 

Which problem is that? I've noticed 3 different issues in this forums thread so far. If you are looking for help, you should provide way more information than just "same problem"

----------

## Featherfoot

I have no audio and I am hoping to follow the topic to see if anybody can come up with something enlightening.

I just recovered from a video problem that I thought was udev related (not sure now if it actually was...) Now I have no audio, and my TV tuner won't work because the devices are missing from /dev .These all sound like they're udev related. I'm surprised that we don't get any warning about things that massively change our world and then get eselect news notices on stuff that's irrelevant.

----------

## SamuliSuominen

 *Featherfoot wrote:*   

> I have no audio and I am hoping to follow the topic to see if anybody can come up with something enlightening.
> 
> I just recovered from a video problem that I thought was udev related (not sure now if it actually was...) Now I have no audio, and my TV tuner won't work because the devices are missing from /dev .These all sound like they're udev related. I'm surprised that we don't get any warning about things that massively change our world and then get eselect news notices on stuff that's irrelevant.

 

There hasn't been any changes related to audio/video with the udev upgrade that would cause user visible issues.

In fact, the sound issues mentioned so far have been almost completely unrelated, except for the fact everything installed to /usr/lib/udev needed a re-emerge to move files over to /lib/udev, but stable users never had this problem, only ~arch users, and news items are targeted for stable users. Thus, postinst message was enough for this.

So in other words, you need to provide way more information than just 'it doesn't work, looks like udev related' to get help at forums.

----------

## Featherfoot

I challlenge you to be an arch user on gentoo. You can't do it over time...

Tvtime, which I used needs /dev/sound and /dev/video0. Those are missing now but they were there a month ago.. (I'm aware that it is in the throes of going unmaintained, but it is the best one out there, IMHO). 

Sound as anyone who's used gentoo for a long time will know, is held together with bailing wire and chewing gum, especially when you have more than 1 device.

So who would be surprised that something that changed the device layouts would cause massive disruptions.

Nevertheless, we soldier on, and most of the time it's fun. I do appreciate being able to use the forums to help find out what's wrong with my system. I cherish the people who answer questions, no matter what I say when I'm frustrated. Thank you, guys.

----------

## SamuliSuominen

 *Featherfoot wrote:*   

> I challlenge you to be an arch user on gentoo. You can't do it over time...
> 
> Tvtime, which I used needs /dev/sound and /dev/video0. Those are missing now but they were there a month ago.. (I'm aware that it is in the throes of going unmaintained, but it is the best one out there, IMHO). 
> 
> Sound as anyone who's used gentoo for a long time will know, is held together with bailing wire and chewing gum, especially when you have more than 1 device.
> ...

 

You mean media-tv/tvtime? Looks like the maintainer of it decided it's too broken to be kept in Portage and it's now about to be removed according to package.mask:

```

# Markos Chandras <hwoarang@gentoo.org> (22 Mar 2013)

# Fails with automake-1.12 (#424289)

# Problems with the alsa patches (#403389)

# Herd has not interest in it and needs a maintainer

# Removal in a month unless a new maintainer steps up

# and fix all the bugs

# Alternatives: media-tv/me-tv, media-tv/mythtv

media-tv/tvtime

```

So, true, I don't care about tvtime or how much it breaks. I'm of course sorry if you haven't found maintained alternative for it. Or have you?

----------

## Featherfoot

I just tried me-tv, but I don't think it is a complete TV package. I couldn't do any settings for the TV tuner, that I could see, at least. 

I've had mythtv running in the past and just tried installing it,  but the setup is massive and it's way beyond what I want to do with TV on my PC, which is watch when my wife is using the big TV in the living room.

Neither of them popped up with a picture, of course, and the sound didn't work either.

I've thought about grabbing the tvtime source and seeing if I can fix the video and audio to  be more tolerant than they are now.

In the end, I'll probably boot into Windows 7.

----------

## SamuliSuominen

 *Featherfoot wrote:*   

> I just tried me-tv, but I don't think it is a complete TV package. I couldn't do any settings for the TV tuner, that I could see, at least. 
> 
> I've had mythtv running in the past and just tried installing it,  but the setup is massive and it's way beyond what I want to do with TV on my PC, which is watch when my wife is using the big TV in the living room.
> 
> Neither of them popped up with a picture, of course, and the sound didn't work either.
> ...

 

There is nothing I or any other udev maintainer can do about single media-tv package which isn't used by any of us, and is even abandoned by the maintainer.

However we are always looking for new contributors, maintainers and developers -- so if you end up fixing the package, let us know through the bugzilla. That's how open source works, afterall.

----------

## Featherfoot

 *Quote:*   

> 
> 
> There is nothing I or any other udev maintainer can do about single media-tv package which isn't used by any of us, and is even abandoned by the maintainer.
> 
> However we are always looking for new contributors, maintainers and developers -- so if you end up fixing the package, let us know through the bugzilla. That's how open source works, afterall.
> ...

 

I understand that, but it is a significant commitment to carry a project like that through to a working product. You have to understand a lot about things like alsa, udev, and X that you have previously dealt with in "command mode." Not a pleasant thought.

----------

## Fenril

Hi,

Just to say since i have updated my kernel to 3.7.10 i retrieve sound on both my soundcard without touching anything in my configuration. So i still don't know if it was from udev or from Alsa, maybe udev incompatibilities with Alsa drivers from < 3.7 kernel version.

----------

