Got MPD running ! ( no sound output yet. Help needed, USB audiio)

425 views
Skip to first unread message

samuel wang

unread,
Jan 14, 2013, 10:13:37 AM1/14/13
to al...@googlegroups.com
Had to manually compile the kernels awhile  back.
loaded the kernels
install dbus avahi and mpd.
create groups and users for those 3 installed.
had to configure alsa too. Alsa configuration files missing. ( well , i just copied and pasted the alsa configs from my desktop :P lazy me )

And Configured MPD to run ! finally.
When i connected to it via an external client over intranet...and press play.. i get this error
http://pastebin.com/vxzLSQwF

Would anybody know how to get around it ?

some of the output from the system.

cat /proc/asound/cards
 0 [default        ]: USB-Audio - C-Media USB Headphone Set 
                      C-Media USB Headphone Set   at usb-orion-ehci.0-1, full speed
# cat /proc/asound/modules
 0 snd_usb_audio
# cat /proc/asound/devices
  0: [ 0]   : control
 16: [ 0- 0]: digital audio playback
 24: [ 0- 0]: digital audio capture
 33:        : timer

Joao Cardoso

unread,
Jan 14, 2013, 11:27:39 AM1/14/13
to al...@googlegroups.com


On Monday, January 14, 2013 3:13:37 PM UTC, samuel wang wrote:
Had to manually compile the kernels awhile  back.

What changes had you to make? what are the differences from the stock kernel configuration? Can you please attach the kernel configuration?
 
loaded the kernels

The kernel modules, you mean? Your do you really had to start a new kernel?
 
install dbus avahi and mpd.
create groups and users for those 3 installed.

they wasn't created at the package install time? Or was something wrong with the default users and groups?
 
had to configure alsa too. Alsa configuration files missing. ( well , i just copied and pasted the alsa configs from my desktop :P lazy me )

The Alt-F Alsa  package uses a very old Alsa version, are the configuration files compatible?


And Configured MPD to run ! finally.

And what configuration is that?
 
When i connected to it via an external client over intranet...and press play.. i get this error
http://pastebin.com/vxzLSQwF

Would anybody know how to get around it ?

I'm afraid I can't help you. I don't have a USB audio card to experiment with and no Alsa knowledge at all.
If you succeed, please report back, so I can incorporate your results in future releases.

Thanks,
Joao

samuel wang

unread,
Jan 15, 2013, 12:50:21 PM1/15/13
to

Kernel config changes are :
CONFIG_SOUND=m
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m

and a few others. Attached config file wthout the dot.
http://www.mediafire.com/?azvj7vuri076k31

can't upload to here for some reason

Did not have to load a new kernel. Thankfully.

For dbus and avahi .. Avahi's group was created but avahi user was not
dbus group and user was not created i think. 

Needed an audio group too for MPD to access the sound card. Needed to create an MPD user manually too.

The config i was referring to for MPD is the one found in /etc/mpd.conf  Was using a system wide confg file.


And for the ALSA bit , yes it is old version of alsa. I was wondering if you could get a newer version of alsa-libs as well as the alsa-utils compiled so i wouldn't have to configure Alsa's config files manually.

Joao Cardoso

unread,
Jan 16, 2013, 3:09:28 PM1/16/13
to al...@googlegroups.com


On Tuesday, January 15, 2013 5:45:27 PM UTC, samuel wang wrote:

Kernel config changes are :
CONFIG_SOUND=m
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m

and a few others. Attached config file wthout the dot.
http://www.mediafire.com/?azvj7vuri076k31

OK, thanks .

can't upload to here for some reason

Google Groups sucks!
 
Did not have to load a new kernel. Thankfully.

For dbus and avahi .. Avahi's group was created but avahi user was not
dbus group and user was not created i think. 

Needed an audio group too for MPD to access the sound card. Needed to create an MPD user manually too.

The config i was referring to for MPD is the one found in /etc/mpd.conf  Was using a system wide confg file.

But you have changed it, haven't you? There are some configuration available out there for other NAS, using the same setup as yours.
If you suceed, can you please post  mpd.conf and alsa.conf?
 
And for the ALSA bit , yes it is old version of alsa. I was wondering if you could get a newer version of alsa-libs as well as the alsa-utils compiled so i wouldn't have to configure Alsa's config files manually.

I first tried to use a more recent version, but failed at the first attempt. As Alsa was not really used, I found it easy to use an old Alsa version...





On Tuesday, January 15, 2013 12:27:39 AM UTC+8, Joao Cardoso wrote:

samuel wang

unread,
Jan 18, 2013, 11:48:03 AM1/18/13
to al...@googlegroups.com
Was going through the package folders from the svn revision.. and found that there were make files for alsa-utils in the multimedia folder.

However ,  i was not able to build alsa-utils. One of the dependencies failed to built. libtool or something like that. Latest checkout as of yesterday. The RC 2 revision.

Would it be possible for you to build to alsa-utils as it is pretty useful in configuring alsa. Doesn't quite matter what version of alsa and alsa-utils it is.

Would be looking into the configs for other NASes out there. Shall post it the config if i succeed



Joao Cardoso (Alt-F)

unread,
Jan 18, 2013, 12:23:24 PM1/18/13
to al...@googlegroups.com

On Friday 18 January 2013 08:48:03 samuel wang wrote:

> Was going through the package folders from the svn revision.. and found

> that there were make files for alsa-utils in the multimedia folder.

>

> However , i was not able to build alsa-utils. One of the dependencies

> failed to built. libtool or something like that. Latest checkout as of

> yesterday. The RC 2 revision.

>

> Would it be possible for you to build to alsa-utils as it is pretty useful

> in configuring alsa. Doesn't quite matter what version of alsa and

> alsa-utils it is.

 

Please try the attached, untested, package (use 'ipkg install filename.ipk') and report back if it is working, so I will release it.

 

>

> Would be looking into the configs for other NASes out there. Shall post it

> the config if i succeed

 

Thanks

Joao

 

Again posting by e-mail, as attaching doesn't work in Google Groups under Chrome Beta in linux!

alsa-utils_1.0.18_arm.ipk

samuel wang

unread,
Jan 19, 2013, 2:57:44 AM1/19/13
to al...@googlegroups.com
Still No do , Alsa it self isn't detecting the sound card even though the kernel detects it.

cat /proc/asound/cards does show my sound card

but aplay -l doesnt.

Would be compiling a newer version of alsa-libs and see how it goes.

As for the alsa-utils, all works well except for the dependency error of alsa_lib instead of alsa-lib. Should be alsa-lib

And dbus doesn't create the neccesary dbus user for use of dbus

Joao Cardoso

unread,
Jan 19, 2013, 11:34:04 AM1/19/13
to al...@googlegroups.com

On Saturday, January 19, 2013 7:57:44 AM UTC, samuel wang wrote:
Still No do , Alsa it self isn't detecting the sound card even though the kernel detects it.

Can you please post the kernel output where the sound card is detected? Just for future reference.
Are you sure that the sound card is supported by the kernel?
Does kernel modules autoload? Or does you have to load them?

cat /proc/asound/cards does show my sound card

but aplay -l doesnt.

Would be compiling a newer version of alsa-libs and see how it goes. 

I have already done it, they are attached.

For alsaconf you will need the 'bash' and 'dialog' packages.
'modinfo' is also needed, I also attach it (modinfo in in reality busybox-1.20.2, copy it to /sbin/ and make it executable)

forked-daapd also depends on alsa-lib, can you please check that is iw working with the new version?

As for the alsa-utils, all works well except for the dependency error of alsa_lib instead of alsa-lib. Should be alsa-lib

Fixed now
 

And dbus doesn't create the neccesary dbus user for use of dbus

dbus post-install package script does

adduser -S -g "DBUS Daemon" -G sys -u 6 -h /var/lib/dbus dbus

Doesn't it exists on your system? 

Thanks, Joao

modinfo
alsa-utils_1.0.26_arm.ipk
alsa-lib_1.0.26_arm.ipk
dialog_1.1-20070704_arm.ipk

samuel wang

unread,
Jan 20, 2013, 1:08:30 PM1/20/13
to al...@googlegroups.com
Output from dmesg.

input: C-Media USB Headphone Set   as /class/input/input3
generic-usb 0003:0D8C:000C.0003: input: USB HID v1.00 Device [C-Media USB Headphone Set  ] on usb-orion-ehci.0-1/input3

# cat /proc/asound/cards

 0 [default        ]: USB-Audio - C-Media USB Headphone Set 
                      C-Media USB Headphone Set   at usb-orion-ehci.0-1, full speed

Here's the weirdest part , i could find it under /proc/asound/cards... and it's still not detected under alsa

Anyway , i did a little experimenting here... went ahead and installed debian on my dns323... and guess what, alsa with usb and everything works. MPD plays .. a little high cpu usage playing flac but tolerable.

To continue testing for alsa on alt -f .. i flashed back alt-f firmware :)
For the dbus package on a clean install of alt-f , it installed everything correctly. users and group all were created .
Alsa-lib and alsa-utils work great. ( Btw, alsaconf has long been depreciated. It's replaced by alsactl in alsa-utils )

So, there are probably a few things i can narrow down to...

1. Alt-f kernel doesn't have sound support enabled.. leading to alsa not being able to detect the card despite the modules being loaded.

2. Some hotplugging mechanism is missing. Udev was running on the debian installation and seemed to be handling all the hotplugging of devices.
 ( i tried the busybox's version of udev  , mdev, to no avail.)

I am tempted to compile a kernel for alt-f with sound support enabled and flash it.. No serial cable made for the dns323 here though.. a tad.. risky :/
Is it safe to compile the uKernel and cat uKernel > /dev/mtdblock2  ? That's what i did with the original dlink firmware before returning to alt-f firmware.

Joao Cardoso

unread,
Jan 20, 2013, 2:20:11 PM1/20/13
to al...@googlegroups.com


On Sunday, January 20, 2013 6:08:30 PM UTC, samuel wang wrote:
Output from dmesg.

input: C-Media USB Headphone Set   as /class/input/input3
generic-usb 0003:0D8C:000C.0003: input: USB HID v1.00 Device [C-Media USB Headphone Set  ] on usb-orion-ehci.0-1/input3

# cat /proc/asound/cards
 0 [default        ]: USB-Audio - C-Media USB Headphone Set 
                      C-Media USB Headphone Set   at usb-orion-ehci.0-1, full speed

Here's the weirdest part , i could find it under /proc/asound/cards... and it's still not detected under alsa

Anyway , i did a little experimenting here... went ahead and installed debian on my dns323...

I'm not surprised for everything to work under Debian, Alt-F is not Debian.
 
and guess what, alsa with usb and everything works. MPD plays .. a little high cpu usage playing flac but tolerable.

To continue testing for alsa on alt -f .. i flashed back alt-f firmware :)

You could install Debian under Alt-F without flashing, with the advantage of (k)exec or chroot it when needed: Setup->Debian.
From the command line, try the 'debian' command; within Debian, try 'alt-f' (or similar) to kexec Alt-F from within Debian.

Not tested lately, and there was a problem with a give package version not being available, search the forum or the wiki for a solution if this happens.

For the dbus package on a clean install of alt-f , it installed everything correctly. users and group all were created .
Alsa-lib and alsa-utils work great.

The new last versions, right?
 
( Btw, alsaconf has long been depreciated. It's replaced by alsactl in alsa-utils )

OK, I will remove it from the alsa-utils package, as well as the bash and dialog dependencies (needed only for alsaconf)
 
So, there are probably a few things i can narrow down to...

1. Alt-f kernel doesn't have sound support enabled..

No, it hasn't. I thought you knew that :-o
 
leading to alsa not being able to detect the card despite the modules being loaded.

2. Some hotplugging mechanism is missing.

Definetively. Alt-F "hotplug" is a simple shell script, hot.sh (and hot_aux.sh). hot.sh uses busybox 'mdev' to create device nodes and load kernel modules.

 
Udev was running on the debian installation and seemed to be handling all the hotplugging of devices.
 ( i tried the busybox's version of udev  , mdev, to no avail.)

It is very limited. It is configured in /etc/mdev,conf
 
I am tempted to compile a kernel for alt-f with sound support enabled and flash it.

You don't need to flash it, you can kexec a new kernel and initramfs/initrd from within Alt-F.

Do you remember the "TryIt" option under System->Firmware, after uploading a new Alt-F flashable file?
What it does is to extract the kernel and initramfs from the file (using the 'dns323-fw' binary, just type its name to see its usage), put them in the '/root' directory and issue a reboot; the /etc/init.d/rcE script, after stopping all services and unmounting filesystem. does a kexec of the found kernel/initramfs. That's the same mechanism used to launch Debian from within Alt-F (and Alt-F from within Debian)

And as you have already build kernel modules, then you already have a kernel built!
You can just extract the initramfs from a flashable Alt-F file (or just unpack the Alt-F-0.1RC2.tar downloadable file -- its there, or build one using the mkinitramfs.sh script) and use your built kernel with that initramfs.

Not simpler? I think it is, at least it is more flexible, even if at the beginning it doesn't look so.

For more details, please look at the "Does the kernel support Wifi? Or how to re compile kernel?" topic, that I will answer next.
 
No serial cable made for the dns323 here though.. a tad.. risky :/

Yes.
That's the kexec advantage, no flashing involved, just exec the new kernel/initramfs, replacing the original (in memory). That's also the way how most linux distributions does a "reboot" nowadays, not rebooting to the BIOS.

 
Is it safe to compile the uKernel and cat uKernel > /dev/mtdblock2  ? That's what i did with the original dlink firmware before returning to alt-f firmware.

Don't understand what you mean.
 

samuel wang

unread,
Jan 21, 2013, 12:45:16 PM1/21/13
to al...@googlegroups.com
Ah. about the sound not enabled in the kernel.. I meant that i thought i could enable it just by loading those modules.. :P but it doesn't seem to be working that way.

Oh oh , you mean , if i just put the kernel and initramfs in the root directory, rcE would automatically kexec the found kernel  and initramfs ?

That would be extremely convinient :P Would be compiling a new kernel for it then..

And for the Alsa packages. Yes , the new ones.

Will post back here once i get results from the new kernel !



Joao Cardoso

unread,
Jan 21, 2013, 2:18:11 PM1/21/13
to al...@googlegroups.com


On Monday, January 21, 2013 5:45:16 PM UTC, samuel wang wrote:
Ah. about the sound not enabled in the kernel.. I meant that i thought i could enable it just by loading those modules.. :P but it doesn't seem to be working that way.

Oh oh , you mean , if i just put the kernel and initramfs in the root directory, rcE would automatically kexec the found kernel  and initramfs ?

Yes, as long as they are called zImage and rootfs.arm.cpio*
You can find them in the 'binaries' folder build tree after running a successful 'make O=...' and  './mkinitramfs sqfs'
And not the root, '/', but the '/root' folder, which is in tempfs. Make sure that /Alt-F/root does not exists, or the copy will be made to disk, not tempfs.

As I have 'export BINARIES=$BLDDIR/binaries/dns323' set, I copy then to the box using
scp $BINARIES/rootfs.arm.cpio-sq.lzma $BINARIES/zImage root@nas:

For RC2, /etc/init.d/rcE says:

# do a kexec to a new kernel/rootfs instead of a reboot
if test -f /root/zImage; then
cd /root

initrfs=$(ls rootfs.arm.cpio*)
if test -f "$initrfs"; then # make sure that only one exists
echo "rcE: starting a new kernel and initramfs"
kexec -l zImage --command-line="console=ttyS0,115200" \
--initrd="$initrfs" && kexec -e
fi
fi

samuel wang

unread,
Jan 22, 2013, 6:50:32 AM1/22/13
to al...@googlegroups.com
Phew. managed to compile the kernel and the initramfs. And kexec loaded them just fine.

loaded the new kernel and dmesg output said snd-usb-audio was registerd
usbcore: registered new interface driver snd-usb-audio

Decided to built-in those alsa and snd-usb-audio along with a dummy alsa card... just to see if alsa would detect it
And weirdly enough, alsa detected neither the dummy card nor the usb sound card.

I'm kinda stumped..not too sure how to proceed from here.. Will be looking up more on ALSA.



Joao Cardoso

unread,
Jan 22, 2013, 12:00:22 PM1/22/13
to al...@googlegroups.com


On Tuesday, January 22, 2013 11:50:32 AM UTC, samuel wang wrote:
Phew. managed to compile the kernel and the initramfs. And kexec loaded them just fine.

Something worth reporting? Less clear instructions? How could them be improved?


loaded the new kernel and dmesg output said snd-usb-audio was registerd
usbcore: registered new interface driver snd-usb-audio


-And no card-specific module was loaded?
-What does 'lsusb' reports? (you have to install the usbutills package, or 'cat /proc/bus/usb/devices'.
-Do you have the right modules.* under /lib/modules/2.6.35.14 ? Remember that if you have installed the Alt-F kernel-modules, which are resident in disk, its files will shadow the ones presents in your initramfs... (this is a union mounting feature). You have to uninstall the kernel-modules package to make your own initramfs files reappear
 
Decided to built-in those alsa and snd-usb-audio along with a dummy alsa card... just to see if alsa would detect it
And weirdly enough, alsa detected neither the dummy card nor the usb sound card.

I'm kinda stumped..not too sure how to proceed from here.. Will be looking up more on ALSA.

Please keep us informed, your results might be important for other setups, such as wifi or 3G USB adapters to use in our cottages :-)
 

samuel wang

unread,
Jan 22, 2013, 1:30:42 PM1/22/13
to al...@googlegroups.com
kexec and stuff worked really well. Couldn't be better :P

i have always thought snd-usb-audio was the generic driver for all usb sound cards.

Anyway here''s the lsusb output
ioBus 001 Device 002: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Oh oh , here's the weird thing i've built the kernel using the commands
make O=$BLDDIR linux26-menuconfig 
make O=$BLDDIR linux26

And a zImage file was given out. Assumed it was the one that i've just built with Alsa support built in
After kexec and reboot , snd-usb-audio was registered automatically but none of the sound kernel modules was found in /lib/modules/2.5.25.14
And yes , kernel-modules was Not installed. Used the cpio from the tar file uploaded here.

Anyway, for the fun of it , i enabled KSM ( kernel samepage merging or something like that) Really popular stuff on android.. And the RAM usage was cut down by quite a bit
It does have some CPU usage as a penalty..but negligible.
total used free shared buffers
Mem: 61944 36268 25676 0 5596
-/+ buffers: 30672 31272
Swap: 178172 0 178172

With only samba and nmbd in the background.


Back to the usb audio topic. I still have no idea how or what to do.

How does Alt -f manage mdev again ? some hotplug sh file ?
I am gonna try the kernel configurations listed here http://wiki.gentoo.org/wiki/Udev





Joao Cardoso

unread,
Jan 22, 2013, 2:24:40 PM1/22/13
to al...@googlegroups.com


On Tuesday, January 22, 2013 6:30:42 PM UTC, samuel wang wrote:
kexec and stuff worked really well. Couldn't be better :P

i have always thought snd-usb-audio was the generic driver for all usb sound cards.

Anyway here''s the lsusb output
ioBus 001 Device 002: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Oh oh , here's the weird thing i've built the kernel using the commands
make O=$BLDDIR linux26-menuconfig 
make O=$BLDDIR linux26

BuildRoot dependencies are not trivial, that will build the kernel, but I'm not sure if it install it in the binaries folder, I always look at the file time stamp.
 

And a zImage file was given out. Assumed it was the one that i've just built with Alsa support built in
After kexec and reboot , snd-usb-audio was registered automatically but none of the sound kernel modules was found in /lib/modules/2.5.25.14

It depends on how you created the initramfs.
As I said in the other topic, kernel modules not specified in the KMOD variable of the configfs script, which is run by the makefile on (at least) a plain 'make O=...', are removed from the rootfs.
 
And yes , kernel-modules was Not installed. Used the cpio from the tar file uploaded here.

Anyway, for the fun of it , i enabled KSM ( kernel samepage merging or something like that) Really popular stuff on android.. And the RAM usage was cut down by quite a bit
It does have some CPU usage as a penalty..but negligible.
total used free shared buffers
Mem: 61944 36268 25676 0 5596
-/+ buffers: 30672 31272
Swap: 178172 0 178172

With only samba and nmbd in the background.


Back to the usb audio topic. I still have no idea how or what to do.

How does Alt -f manage mdev again ? some hotplug sh file ?

Hot plugging is done by mdev (see 'cat /proc/sys/kernel/hotplug' output) , which calls /usr/sbin/hot.sh on selected devices (mostly disk related blçock devices), see /etc/mdev.conf

samuel wang

unread,
Jan 23, 2013, 1:38:27 PM1/23/13
to
HOLY CRAP. I DID IT.

I GOT ALSA TO DETECT THAT DARN SOUNDCARD WHOOOOOOOOO.   The solution lies in mdev not creating those required nodes.

requires these to be added
controlC[0-9] 0:0 0664 >snd/
pcmC[0-9]D[0-9][cp] 0:0 0664 >snd/
timer 0:0 0664 >snd/
seq 0:0 0664 >snd/

and those sound modules to be loaded.
And a generic alsa configuration found in every distribution /usr/share/alsa. So i copied it over.

# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: default [C-Media USB Headphone Set ], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

WOOOOOOOOOOOOOOOOOO ! HOLY COW.

Anyway, here's the link i got it from

http://docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:mdev

Who would have ever thought to look at mdev :P

AND YES , SOUND WORKS ON MPD. WHOOOOOOOOOOooooo. IT worked out finally. Thank you for your help :P glad i stuck with it. Learnt alot from it.

Now for a way to make these settings survive a reboot. Hmm.

Joao Cardoso

unread,
Jan 23, 2013, 8:52:20 PM1/23/13
to al...@googlegroups.com


On Wednesday, January 23, 2013 6:36:26 PM UTC, samuel wang wrote:
HOLY CRAP. I DID IT.

I GOT ALSA TO DETECT THAT DARN SOUNDCARD WHOOOOOOOOO. 

Good Job!
 
  The solution lies in mdev not creating those required nodes.

requires these to be added
controlC[0-9] 0:0 0664 >snd/
pcmC[0-9]D[0-9][cp] 0:0 0664 >snd/
timer 0:0 0664 >snd/
seq 0:0 0664 >snd/

and those sound modules to be loaded.

You mean that you have to load the modules manually?
I though that you said that that you had compiled the kernel modules as builtin, not as loadable modules?

I would appreciate if you could compile all them as modules, then try to use them with the stock RC2 Alt-F kernel.
If that succeeds, the 'lsmod' output and the kernel config will be welcome also.

I  will apply your changes to mdev.conf.

Packages have a configuration file that specifies configuration files to preserve across updates. What files should be there for alsa-lib and alsa-utils? None? There is no need to preserve them, as users will not need to customize them?

And what about mpd.conf for local audio? Can you please post it?

I'm afraid that I'm too far away from sound...

 
And a generic alsa configuration found in every distribution /usr/share/alsa. So i copied it over. 

So I have to change alsa-lib and alsa-utils package file list to include all those.


# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: default [C-Media USB Headphone Set ], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

WOOOOOOOOOOOOOOOOOO ! HOLY COW.

Anyway, here's the link i got it from

http://docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:mdev

Who would have ever thought to look at mdev :P

AND YES , SOUND WORKS ON MPD. WHOOOOOOOOOOooooo. IT worked out finally. Thank you for your help :P glad i stuck with it. Learnt alot from it.

Now for a way to make these settings survive a reboot. Hmm.

That is the easiest part :-)

They should all be resident in disk, under /Alt-F/, so they will be preserved across reboots.
If some is not under /Alt-F/, then probably its parent folder is also not there, so create it directly after using 'aufs.sh' (use the option to remount with notify).

Thanks,
Joao
 
 

samuel wang

unread,
Jan 24, 2013, 1:28:56 AM1/24/13
to al...@googlegroups.com

Oh oh , the previous kernel was just kexeced onto the system.. and i rebooted after that.

Here's the lsmod

# lsmod
Module                  Size  Used by    Not tainted
snd_usb_audio          59644  1
snd_usbmidi_lib        12284  1 snd_usb_audio
snd_rawmidi            12660  1 snd_usbmidi_lib
snd_seq_device          3644  1 snd_rawmidi
snd_pcm_oss            29748  0
snd_mixer_oss          10860  1 snd_pcm_oss
snd_pcm                45177  3 snd_usb_audio,snd_pcm_oss
snd_timer              13004  1 snd_pcm
snd_hwdep               3968  1 snd_usb_audio
snd                    29076 10 snd_usb_audio,snd_usbmidi_lib,snd_rawmidi,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_hwdep
snd_page_alloc          3580  1 snd_pcm
soundcore               3248  1 snd
usblp                   7840  0

Config file. Without the dot. Same as the one posted earlier.
http://www.mediafire.com/?azvj7vuri076k31

Mpd conf relevant to the audio output section. It can be found commented in the default settings. Just uncomment the necessary bits and modify whatever needed.
audio_output {
        type            "alsa"
        name            "My ALSA Device"
        device          "hw:0,0"        # optional
        format          "44100:16:2"    # optional
        mixer_type      "software"      # optional
#       mixer_device    "default"       # optional
        mixer_control   "Speaker"               # optional
#       mixer_index     "0"             # optional
}

Lastly , how do i make changes to /etc/mdev.conf survive the reboot ?

Joao Cardoso

unread,
Jan 24, 2013, 10:31:05 AM1/24/13
to al...@googlegroups.com


On Thursday, January 24, 2013 6:28:56 AM UTC, samuel wang wrote:

Oh oh , the previous kernel was just kexeced onto the system.. and i rebooted after that.

Fine. So I can just build a new kernel-module package and it will be usable with the current RC2 kernel.

I will also recreate the alsa-lib and alsa-utils packages, including /usr/share/alsa contents in the packages, and an install script that modifies mdev.conf as needed. Is anything missing?
 
Here's the lsmod

# lsmod
Module                  Size  Used by    Not tainted
snd_usb_audio          59644  1
snd_usbmidi_lib        12284  1 snd_usb_audio
snd_rawmidi            12660  1 snd_usbmidi_lib
snd_seq_device          3644  1 snd_rawmidi
snd_pcm_oss            29748  0
snd_mixer_oss          10860  1 snd_pcm_oss
snd_pcm                45177  3 snd_usb_audio,snd_pcm_oss
snd_timer              13004  1 snd_pcm
snd_hwdep               3968  1 snd_usb_audio
snd                    29076 10 snd_usb_audio,snd_usbmidi_lib,snd_rawmidi,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_hwdep
snd_page_alloc          3580  1 snd_pcm
soundcore               3248  1 snd
usblp                   7840  0


All them was automatically loaded? 
Do you think that OSS is needed? I think to have read somewhere that it not being used anymore in some distros.
 
Config file. Without the dot. Same as the one posted earlier.
http://www.mediafire.com/?azvj7vuri076k31

Mpd conf relevant to the audio output section. It can be found commented in the default settings. Just uncomment the necessary bits and modify whatever needed.
audio_output {
        type            "alsa"
        name            "My ALSA Device"
        device          "hw:0,0"        # optional
        format          "44100:16:2"    # optional
        mixer_type      "software"      # optional
#       mixer_device    "default"       # optional
        mixer_control   "Speaker"               # optional
#       mixer_index     "0"             # optional
}

Lastly , how do i make changes to /etc/mdev.conf survive the reboot ?

Having Alt-F packages installed:

aufs.sh -n
cp
/etc/mdev.conf /Alt-F/etc/
aufs
.sh -r

If you now edit /etc/mdev.conf, the changes should go to /Alt-F/etc/mdev.conf, which is on disk, and at boot time the /Alt-F/etc/mdev.conf will shadow the one present in the firmware (union mount). Never directly change anything under /Alt-F without first execute 'aufs.sh -n'.

Thanks,
Joao

samuel wang

unread,
Jan 24, 2013, 1:44:13 PM1/24/13
to
 Yeah , that sounds good to go. After insmod-ing those kernel modules, they were auto-loaded.
Nothing is missing out , good to go  :)

Yeah those modules with OSS in it are not needed for mpd to play. Tested it out without those modules. Mpd plays fine.

If i wanted to flash a  kernel that i've compiled.. how do i do it ? After the kexec ?

Joao Cardoso

unread,
Jan 24, 2013, 4:25:49 PM1/24/13
to al...@googlegroups.com


On Thursday, January 24, 2013 6:42:08 PM UTC, samuel wang wrote:
 Yeah , that sounds good to go. After insmod-ing those kernel modules,

ah, but without doing the insmod?
They should be loaded  as needed, it is for that that the modules.* files exists in /lib/modules/2.6.35.14: the vendor and device id of the card match one of the entries, which makes the kernel load the necessary module. Only if this does not happens one need to modprobe the right module.
In that case we can instruct mdev to call hot.sh and it will do the modprobe.

But we need to know first what module(s) is/are really necessary, dependent modules will be loaded automaticaly.

For example, from your list in the previous post, snd_pcm_oss is not in use (has a ref count of zero), and snd_mixer_oss is only nedded because of it, so none should really be needed.

they were auto-loaded.
Nothing is missing out , good to go  :) 

Yeah those modules with OSS in it are not needed for mpd to play. Tested it out without those modules. Mpd plays fine.

If i wanted to flash a  kernel that i've compiled.. how do i do it ? After the kexec ?

You should *NOT* flash trunk!
If you have checkout RC2, then you can -- but I guess that's too big and will no fit flash.

using 

./mkinitramfs.sh sqfs
./mkfw.sh sqfs

is the safest way to go, as it will notice errors. At the end you will find the .bin file in the binaries folder

samuel wang

unread,
Jan 25, 2013, 7:14:07 AM1/25/13
to al...@googlegroups.com
Ah , previously on the kernel with the built-in modules , they were loaded automatically after detecting the sound card.

Here are those fully required ones. Removed the dummy device modules and stuff.


 lsmod
Module                  Size  Used by    Not tainted
snd_usb_audio          59644  0
snd_usbmidi_lib        12284  1 snd_usb_audio
snd_rawmidi            12660  1 snd_usbmidi_lib
snd_seq_device          3644  1 snd_rawmidi
snd_pcm                45177  1 snd_usb_audio

snd_timer              13004  1 snd_pcm
snd_hwdep               3968  1 snd_usb_audio
snd                    29076  7 snd_usb_audio,snd_usbmidi_lib,snd_rawmidi,snd_seq_device,snd_pcm,snd_timer,snd_hwdep

snd_page_alloc          3580  1 snd_pcm
soundcore               3248  1 snd

What's the actual size of the kernel partition o.o

Disk /dev/mtdblock2: 1 MB, 1572864 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

It's this partition isn't it ?

Joao Cardoso

unread,
Jan 25, 2013, 10:20:23 AM1/25/13
to al...@googlegroups.com
Yes:

# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00010000 00002000 "MTD1"
mtd1: 00010000 00010000 "MTD2"
mtd2: 00180000 00010000 "Linux Kernel"
mtd3: 00630000 00010000 "File System"
mtd4: 00030000 00010000 "u-boot"

 # dmesg | sed -n '/Creating/,/u-boot/p}'
Creating 5 MTD partitions on "physmap-flash.0":
0x000000000000-0x000000010000 : "MTD1"
0x000000010000-0x000000020000 : "MTD2"
0x000000020000-0x0000001a0000 : "Linux Kernel"
0x0000001a0000-0x0000007d0000 : "File System"
0x0000007d0000-0x000000800000 : "u-boot"

You might want to read /usr/www/cgi-bin/firmware2_proc.cgi

samuel wang

unread,
Jan 25, 2013, 12:52:25 PM1/25/13
to al...@googlegroups.com
How do you get the kernel-modules package to build those additional sound modules  ? The mk and config.in file doesn't show that
 
Kernel was still oversized no matter what when sound was enabled :P


Would you ever  consider enabling ksm in the kernel ?

Joao Cardoso

unread,
Jan 25, 2013, 2:06:16 PM1/25/13
to al...@googlegroups.com


On Friday, January 25, 2013 5:52:25 PM UTC, samuel wang wrote:
How do you get the kernel-modules package to build those additional sound modules  ?

see this topic for the short story and read the HowToCreatePackages for a detailed explanation.
 
The mk and config.in file doesn't show that
 
Kernel was still oversized no matter what when sound was enabled :P

Perhaps the KSM stuff you have compiled-in? see the differences for a stock kernel config
 
Would you ever  consider enabling ksm in the kernel ?

See above. Only about 1KB free on the kernel flash partition! Peanuts, some say ;-)
In the project beginning I refrain myself from adding comments on my scripts to save just a few BYTES!

 

Joao Cardoso

unread,
Jan 25, 2013, 3:06:23 PM1/25/13
to
The kernel as well as all base packages (not the disk-installable ones), are compiled for space-saving, not execution speed as is usual.
All kernel stuff that I think that it is not necessary is removed...

You can compress the kernel with lzma, CONFIG_KERNEL_LZMA=y,  that will reduce its size from 1571380 to 1173804.

Looonger boot times, of course. The rootfs is already lzma compressed.

But remember, the kernel will be fully expanded at runtime, and there is only 64MB of RAM.

This is not an android phone, with 4GB of internal flash memory and 512MB of RAM (as my low/medium range phone has), our box is more like more a toaster :-) For comparison, the box has 8MB of flash and 64MB of RAM



 

Joao Cardoso

unread,
Jan 27, 2013, 12:06:58 PM1/27/13
to al...@googlegroups.com


On Thursday, January 24, 2013 6:42:08 PM UTC, samuel wang wrote:
 Yeah , that sounds good to go. After insmod-ing those kernel modules, they were auto-loaded.

Nothing is missing out , good to go  :)

I have just released, and announced under the NEWS topic, the new alsa-lib, alsa-utils and kernel-modules packages.

Do you mind undoing all your changes, including restoring the stock mdev.conf and removing or renaming your /usr/share/alsa (you know how to redo that, if something goes wrong), and try using the packages with a stock RC2 kernel?

Thanks,
Joao


samuel wang

unread,
Jan 28, 2013, 12:55:01 AM1/28/13
to al...@googlegroups.com
Yaayy , that's great to hear :)


restored the stock mdev and renamed the alsa folder.  And reflashed the rc2 firmware.


Those required lines are added properly when installing the new alsa-lib. However those changes do not survive a reboot.

alsa-utils works great.

And kernel-modules now has those required sound modules which are automatically loaded on reboot.




Joao Cardoso

unread,
Jan 28, 2013, 11:10:44 AM1/28/13
to al...@googlegroups.com


On Monday, January 28, 2013 5:55:01 AM UTC, samuel wang wrote:
Yaayy , that's great to hear :)


restored the stock mdev and renamed the alsa folder.  And reflashed the rc2 firmware.


Those required lines are added properly when installing the new alsa-lib. However those changes do not survive a reboot.

Thanks, fixed now and downloaded to sourceforge (also added kernel-modules as a dependency)
 

alsa-utils works great.

And kernel-modules now has those required sound modules which are automatically loaded on reboot.

Great, so it works with a vanilla RC2.

We now only need more people with USB "soundcards" to try it. I didn't found a cheap one (on physical shops) to experiment with.
 
Thanks
Joao

Joao Cardoso

unread,
Jan 28, 2013, 12:00:16 PM1/28/13
to al...@googlegroups.com
I was researching this, but found that it should bring no improvements to Alt-F.
Are you using it on your kernel?
Can you please post its statistics? 'cat /sys/kernel/mm/ksm/pages_*'

Thanks,
Joao


TJ

unread,
Feb 2, 2013, 7:02:26 PM2/2/13
to al...@googlegroups.com

Joao,

 
I have a creative 5.1 USB soundcard that I have little use for. I can do some testing, or even ship it to you.
 
T.J.
Reply all
Reply to author
Forward
0 new messages