Ubuntu

Intrepid/Jaunty: K3B fails to rip to MP3

Reported by Sokraates on 2008-09-07
112
This bug affects 10 people
Affects Status Importance Assigned to Milestone
k3b
Fix Released
Medium
kdemultimedia (Ubuntu)
Undecided
Unassigned
Nominated for Jaunty by Marius B. Kotsbak
Nominated for Karmic by Marius B. Kotsbak

Bug Description

Clean installation of Kubuntu Intrepid Ibex, last updated 07.09.2008, ca. 12:00 CET. Using a new user.

Kubuntu-restricted-extras, lame, libmp3lame0 and libk3b3-extracodecs are installed (by the way: Shouldn't lame etc be installed with Kubuntu-restricted-extras? I had to install them manually). libk3b2mp3 is not available.

Ripping a CD to MP3 fails with "Command failed: lame -h *snip*", "Error while encoding track 1". Starting k3b from the command line doesn't provide further details.

Ripping to ogg works.

I have the same problem on a fresh install of Kubuntu Intrepid made on 29/10/2008.

Furthermore (I don't know if it's related or not) trying to rip an audio cd to mp3 using konqueror results in files containing only garbage.

To ogg both work.

Stefan Ebner (sebner) wrote :

I can confirm this to so setting to "Confirmed"

Changed in k3b:
status: New → Confirmed
cosi (rg-cosiworld) wrote :

Same here. K3B fails immediately, event if I exchange lame with cat.
Ripping in Konqueror via audiocd: produces white noise, which is probably not related to the k3b bug.

I'm using x64. Are you, too?

jetpeach (jetster) wrote :

is there a workaround? same problem here...

I have the same problem:

* k3b fails to rip on calling lame
* using audiocd:// in konqueror and copying results in file containing garbage

This is on a 32 bit install of Kubuntu.

This is very basic functionality that users expect should work without issue. For this reason, I would like to see this bug fixed quickly, or at least a workaround suggested.

steviedons (steviedons) wrote :

I am seeing the exact same issue with K3B and the white noise when using audiocd:// using a fully updated 32bit version of Kubuntu.

Andrej (zagar-macek) wrote :

The same problem on my machine. But I have a workaround:

1.) Use k3b to extract wav-files
2.) Run the following script to convert wav-files into mp3-files

     find -name *wav | awk '{system( "lame -h \"" $0 "\" \"" substr($0,0,match($0,".wav")) ".mp3\"")}'

Chris Purves (chris-northfolk) wrote :

https://bugs.launchpad.net/ubuntu/+source/k3b/+bug/297320 appears to be the same bug with a workaround:

Edit the lame settings in k3b and enable both "Swap Byte Order" and "Write Wave Header"

Leo Milano (lmilano) wrote :

Yes, the workaround mentioned by Chris works for me on k3b. However, Dolphin has the same issue (try using audiocd:/ and dragging an mp3 from the MP3 Subdirectory, it will create a whitenoise sounding mp3). Notably, you can't configure this in the System Settings in Kubuntu, and fixing it in K3b doesn't fix it for Dolphin.

Hope this helps.

emuman (emuman-gmx) wrote :

See KDE bug https://bugs.kde.org/show_bug.cgi?id=171065. There is a big/little endian check in encoderlame.cpp. Perhaps this check doesn't work. To fix the static noise, command line option -x should added.

Leo Milano (lmilano) wrote :

Emuman, are you a KDE dev? THanks for the link to the upstream bug report.

This page suggests apparently more robust methods for checking endianness at runtime:
http://unixpapa.com/incnote/byteorder.html

Something like a runtime check:
  int am_big_endian()
  {
     long one= 1;
     return !(*((char *)(&one)));
  }

It seems like __BYTE_ORDER is not always properly defined. Oh well, hope this helps!

emuman (emuman-gmx) wrote :

No, I'm not an KDE dev. The solution from Chris to enable "Swap Byte Order" shows that the error is a little/big endian problem. But why __BYTE_ORDER is undefined in Intrepid? Maybe a runtime check is the proper solution. IMHO the check should be done in lame and not in the application calling lame.

Leo Milano (lmilano) wrote :

I agree, lame should check for this internally, instead of asking the caller to figure it out. But since this has been like this forever, it is hard to change at this point, I guess.

I did a bit of search around my system (I have 8.04 and 8.10 in two separate partitions). This is an AMD Athlon machine. In both cases, the endian order is defined, in what appears to be the proper place (/media/sda1/usr/include/bits), and to the correct value (__LITTLE_ENDIAN). This file is included in libc6-dev

So this doesn't seem to have changed. I am not sure why this regression was introduced, but I thought I should share what I learned in case it helps someone else figure out what's going on.

I'm using Kubuntu Intrepid 2.6.27-9-generic x86_64 and LAME 64bits version 3.98

When using audiocd:/ in Dolphin or Konqueror I was getting the white noise problem. I looked at what parameters were being passed to lame and the -x switch was included, telling lame to use big-endian byte order on my little-endian system.

As a crude hack to resolve this I renamed /usr/bin/lame to lame-actual and saved a new script as /usr/bin/lame. The new script contained:

lame-actual --big-endian -x "$@"

this ensures lame always operates in little-endian mode. (Set big-endian and then swap it). Another -x is passed in "$@" but this is ignored.

Using audiocd:/ now works, and k3b works with the wave header and swap byte order options.
Hopefully the upstream developers will get this sorted in 4.2.

Ilja Pavkovic (ipavkovic) wrote :

less intrusive is:

create dir ~/bin

create a script ~/bin/lame with

  #!/bin/sh
  usr/bin/lame --big-endian -x "$@"

chmod +x ~/bin/lame

if you have created the dir ~/bin you must relogin to get ~/bin as part of your PATH (see ~/.profile)

Xiborg (xiborg) wrote :

I had the exactly same problem with KDE 4.1.x on Intrepid x86.
I tried several workarounds and fixes mentioned here, but none has worked for me.

Yesterday I got the KDE 4.2 packages for Intrepid and K3b with lame works again!

cheers
Xiborg

Changed in k3b:
status: Unknown → Confirmed
Changed in k3b:
status: Confirmed → Triaged
julos (julos68) wrote :

Same problem on a fresh installed Kubuntu 8.10 (2.6.27-11-generic): I couldn't rip an audio CD to MP3 using K3B.

I installed lame and it still didn't work.

As mentioned above, the workaround "solved the problem":
--> Edit the lame settings in k3b and enable both "Swap Byte Order" and "Write Wave Header"

I have upgraded Intrepid to Jaunty on Kubuntu and I still have the problem. The elegant workaround at

https://bugs.launchpad.net/ubuntu/+source/k3b/+bug/267399/comments/15

does not work for me either.

For the record, although I am running KDE 4.2.2, K3b is 1.0.5 on KDE 3.5.10.

dpkg -l lame gives

ii lame 3.98-0.0 LAME Ain't an MP3 Encoder

Kindly solve this issue.

Thanks.

Manually changing the K3b settings works fine for me:
"--> Edit the lame settings in k3b and enable both "Swap Byte Order" and "Write Wave Header""

Please enable these per default.

In addition, k3b should somehow ask the user that he has to install lame, or even better ask him to install kubuntu-restricted-extras and let that one depend on lame. It could even be done like in amarok that the suer just has to click "Ok" and the packets are installed. Currently, one has to find that out manually.

Thank you so much Ralf Jung. I did what you suggested and it now works!

Because it is not obvious how to do it, I have recorded below my sequence of steps:

Settings -> Configure K3b -> Plugins -> Audio Encoder -> External Audio Encoder -> Configure -> Mp3 Lame -> Edit

Tick the checkboxes for Swap Byte Order and Write Wave Header in the popup.

Then Apply -> OK twice and you are good to go.

Once more, many thanks for the workaround.

Leo Milano (lmilano) wrote :

The problem is: this workaround is impossible to figure out by a new user. We need to do better! Also, I still can't listen to mp3's from a CD in Dolphin using audiocd:/ - it seems like we need a more fundamental solution for this bug.

Cheers!

I would say whoever can do that should change the settings of that lame mp3 entry - it should be possible to enable these two checkboxes in some global config file which is used when no local config is found, right?

For the audiocd:/ problem, I'm not sure if they are related... you might have a look at https://bugs.launchpad.net/ubuntu/+source/kdemultimedia/+bug/366141

Troy Sims (troysims72) wrote :

I'm running Jaunty, and selecting the two Lame settings do not fix my problem. So far, not a single ripping software works with Jaunty. I'm about ready to go back to Windows. This is unbelievable.

summary: - Intrepid: K3B fails to rip to MP3
+ Intrepid/Jaunty: K3B fails to rip to MP3

Using Kubuntu 9.04
I had the same problem.
I did as recommended above: Tick the checkboxes for Swap Byte Order and Write Wave Header in the popup.
then i tried #find . -name "*.[Ww][Aa][Vv]" -print -exec lame -h {} \;
and found, that lame was not installed on my system.
Using synaptic to install lame and
now I can use k3b to read a cd and convert it to mp3.

But I expect Kubuntu to do that out of the box.

cyril (ivi610) wrote :

same bug on jaunty
 k3b doesn't remember the configuration following :
"

Thank you so much Ralf Jung. I did what you suggested and it now works!

Because it is not obvious how to do it, I have recorded below my sequence of steps:

Settings -> Configure K3b -> Plugins -> Audio Encoder -> External Audio Encoder -> Configure -> Mp3 Lame -> Edit

Tick the checkboxes for Swap Byte Order and Write Wave Header in the popup.

Then Apply -> OK twice and you are good to go.

Once more, many thanks for the workaround.
"

I tried everything but it doesn't solve the problem

Changed in k3b:
status: Confirmed → Fix Released
Jonathan Thomas (echidnaman) wrote :

(The problem was with the audiocd kio slave, which K3b uses, so moving to kdemultimedia)
A fix has been committed upstream for KDE 4.3.0, so marking fix committed accordingly.

affects: k3b (Ubuntu) → kdemultimedia (Ubuntu)
Changed in kdemultimedia (Ubuntu):
status: Triaged → Fix Committed
Jonathan Thomas (echidnaman) wrote :

...but they released a few more release candidates before 4.3.0, and the fix is included in them.

Changed in kdemultimedia (Ubuntu):
status: Fix Committed → Fix Released
savage (jaclyn-ellis) wrote :

I get same result (white noise)
lame 64bits version 3.97
Qt: 4.5.2
KDE: 4.3.2 (KDE 4.3.2)
K3b: 1.68.0

All attempts at applying above suggested fixes fail to work.

Same result in dolphin

David I (david-ingamells) wrote :

I've just experienced the same problem in SuSe 11.2 and applied the old fix by editing the $HOME/.kde/share/config/h3brc file to contain the following:

[K3bExternalEncoderPlugin]
command_Mp3 (Lame)=Mp3 (Lame),mp3,lame -r --bitwidth 16 -b 160 -h --add-id3v2 --tt %t --ta %a --tl %m --ty %y --tc %c --tn %n --tg %g - %f,swap,wave
command_Flac=Flac,flac,flac -V -o %f --force-raw-format --endian=little --channels=2 --sample-rate=44100 --sign=signed --bps=16 -T ARTIST=%a -T TITLE=%t -T TRACKNUMBER=%n -T DATE=%y -T ALBUM=%m -
commands=Mp3 (Lame),Flac

note in particular the ,swap,wave

I find it very disappointing that k3b STILL hasn't been fixed to save the settings properly.

David I (david-ingamells) wrote :

oops! that should be the k2brc file.

goettlek (zoo2ropa) wrote :

Thanks for all you're guys help. It works great now thank you!

In Karmic (9.10) the settings for LAME are:

uncheck "Swap Byte Order"
check "Write Wave Header"

Changed in k3b:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.