LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   CD/DVD contents are not auto refreshing (https://www.linuxquestions.org/questions/programming-9/cd-dvd-contents-are-not-auto-refreshing-888742/)

kkpal 06-28-2011 06:41 AM

CD/DVD contents are not auto refreshing
 
Hi,

When I eject CD from CDROM by pushing eject button(mounted on CDROM) it still shows CD and it's contents in nautilus file browser. If I replaced the CD it still shows contents of older CD.
If I eject CD manually by file browser then there is no such issue.
I know this is the kernel issue because this issue has come after updating my kernel from linux 2.6.33 to linux-netbook-2.6.35. I am using MeeGo.
I want to know which kernel parameter(or module) I have to add.

Thanks & Regards
K K Pal

harryhaller 06-28-2011 06:55 AM

You should unmount the CD by using the umount command, just as you should mount a CD by using the mount command.

The command
Code:

df -h
will show you what is mounted, for example:
Code:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              19G  5.3G  13G  31% /mnt/hda1

To unmount that device you then enter the command
Code:

umount /dev/sda1

or

umount /mnt/hda1

In your case the command will probably be
Code:

umount /media/cdrom
It is very important to unmount devices thus, otherwise files may not get updated properly. Obviously this is not so much of an issue with read-only devices but, as you see, you can still get problems if you do not mount and unmount devices properly.

Nominal Animal 06-28-2011 07:43 PM

Like Auke said, it's a bug in MeeGo.

I would expect the problem to be in HAL and not in the kernel. Have you verified by booting into the other kernel? Or did you do some kind of an upgrade, and only assumed it was a kernel issue? Note that even if you only select one package to be upgraded in your package manager, it may have to upgrade related packages too; you may not have noticed that.

If it really is a kernel configuration issue, it should be easy to compare the configuration between the working kernel and the nonworking kernel:
Code:

grep -ve '^#' /boot/config-*2.6.33* | sort -g > /tmp/config.working
grep -ve '^#' /boot/config-*2.6.35* | sort -g > /tmp/config.nonworking
diff -Naur /tmp/config.nonworking /tmp/config.working

The above outputs an unified diff, with - before settings only in the nonworking kernel config, and + before settings only in the working kernel config. Alternatively, it could be an issue with the cdrom sysctl defaults. You can see the settings the current kernel uses (usually 1 0 0 0) by running
Code:

cat /proc/sys/dev/cdrom/{autoclose,autoeject,check_media,lock}
and the capabilities for available cdrom drives using
Code:

cat /proc/sys/dev/cdrom/info
I suspect the problem is that somehow HAL mishandles the eject button event (or never receives it due to some kind of a conflict between HAL and the kernel), so that in the nonworking kernel, the button opens the tray (at the hardware level) without any kind of notification sent to applications.

Hope this helps.

kkpal 06-29-2011 01:17 AM

Thanks @harryhaller for your reply but I am not looking for that kind of solution.

@Nominal Animal:
I didn't found hald daemon in both netbooks. I replaced the kernel 2.6.33 to 2.6.35 by using rpm -Uvh. I did it for some wlan drivers.
It didn't showed any error or conflict while upgrading.
I have already done diff thing but it was not helpful. I also matched the installed packages(rpm -qa) in both netbooks but everything are same except kernel.
The output of
cat /proc/sys/dev/cdrom/{autoclose,autoeject,check_media,lock}
is 1 0 0 1
is same in both netbooks.
Quote:

the button opens the tray (at the hardware level) without any kind of notification sent to applications.
You are absolutely correct. There is no dbus signal in nonworking kernel netbook if I push eject button.
Kernel loads "nls_utf8" module in both netbooks for CD/DVD but the module size is not same.
In working kernel size is 977 and in nonworking it is 989.

Nominal Animal 06-29-2011 06:00 AM

Quote:

Originally Posted by kkpal (Post 4398753)
I didn't found hald daemon

I wonder if MeeGo uses DeviceKit instead of HAL? Does
Code:

devkit --monitor
work? Does it output anything on either netbook when you press the physical eject button?

Another possibility is that the button is handled via ACPI. Does
Code:

cat /sys/bus/acpi/devices/*/input/input*/name
differ on the two netbooks? If they do, you might try acpi=force or acpi=off kernel boot option.

A yet another is that the eject button is handled as a normal key. Does
Code:

cat /sys/class/input/*/*/name
differ on the two networks? Does
Code:

xev
output anything when you press the physical eject button?

kkpal 06-29-2011 11:28 AM

Outputs of everything are same in both netbook except dbus-monitor.
Quote:

Does it output anything on either netbook when you press the physical eject button?
Yes dbus-monitor gives the output in 2.6.33 netbook but not in 2.6.35. It means application is not getting any notification from hardware.

nothing in xev in both netbook it(xev) may be MeeGo bug. I have already reported this bug to MeeGo. But I have to fix this issue asap.

Nominal Animal 07-01-2011 03:17 PM

Can you see the event in the Linux input subsystem? This command will show a hex dump of all input events:
Code:

sudo sh -c 'for F in /dev/input/event* ; do dd if=$F of=/dev/stdout bs=16 & done | hexdump -x'
You should see absolutely all input events there. The output lines are struct input_event structures defined in /usr/include/linux/input.h .

If you can see it on both netbooks, then the problem is between kernel input mapping and DBUS. (The mapping for the eject button might have changed.) Seeing the relevant output from above, from working and nonworking netbooks, should make it easy to create a fix.

If you can see the event only on the working netbook, then it is a kernel issue, I think.

kkpal 07-04-2011 01:58 AM

Quote:

sudo sh -c 'for F in /dev/input/event* ; do dd if=$F of=/dev/stdout bs=16 & done | hexdump -x'
There is no output in both netbooks. It's not giving any output for media insert/eject or hardware plugin.
It gives output only when I press any key(keypad/keyboard). Behavior is same for both netbooks.


All times are GMT -5. The time now is 05:44 PM.